• 0

    posted a message on Trigger Exercise #3 - Tower Defense Spawning System

    So will the path be always the same for every time you play this game? ( on the picture start 2 will always take the green path? )

    Galaxy pwns GUI. ( was the same for wc3 ).

    Btw. if there around 30 "maps" with 2 paths each. And every path has around 12 nodes you get 30 * 2 * 12 = 720 values you have to write in there, with GUI. HF clicking.

    Posted in: Triggers
  • 0

    posted a message on Weekly Terraining Exercise #26: A different kind of JTE!

    Working on it.

    edit: Done

    Posted in: Terrain
  • 0

    posted a message on Trigger Exercise #3 - Tower Defense Spawning System

    Maybe you write them all down, but you don't have to save em all. Just divide the set uservalue into functions, one for each map. And the call them when a player chooses a map.

    a "H" is indeed a nice problem, but isn't it a problem with your way to? Nope since I would randomize the path in one single time. So I could always check: Next unit != current unit. With rects you would have to save that somehow.

    Just an example how I would do it (wip).

    //
    //Custom Value index 0 says how many possible paths there are. -1 means is an end unit.
    //
    //Missing: Back Walk , More Reach Triggers
    
    const int MAX_PLAYERS = 12;
    const fixed REACH_RANGE = 0.5;
    
    struct PathSystem {
    	unitgroup starters;
    	int player;
    	trigger reached;
    };
    
    PathSystem[MAX_PLAYERS] Paths;
    
    void PSUnitReachedTargetOfPlayer1 () {
    //Create for all players ( makros would be cool :D )
    }
    
    void InitPathSystem () {
    	int i = 1;
    	Paths[i].starters = UnitGroupEmpty();
    	Paths[i].player = i;
    	Paths[i].reached = TriggerCreate( "PSUnitReachedTargetOfPlayer" + IntToString( i ) );
    }
    
    void PSCreateStarter ( int player, int id ) {
    	UnitGroupAdd( Paths[player].starters, UnitFromId( id ) );
    	UnitSetCustomValue( UnitFromId( id ), 0, 0.00 );
    }
    
    void PSCreateEnd ( int player, int id ) {
    	TriggerAddEventUnitRange( Paths[player].reached, null, UnitFromId( id ), REACH_RANGE, true );
    	UnitSetCustomValue( UnitFromId( id ), -1, 0.00 );
    }
    
    void PSAddNewDirection ( int player, int casterID, int targetID ) {
    	unit u = UnitFromId( casterID );
    	UnitSetCustomValue( u, 0, UnitGetCustomValue( u, 0 ) + 1 );
    	UnitSetCustomValue( u, UnitGetCustomValue( u, 0 ), IntToFixed( targetID ) );
    }
    
    bool PSApplyOnUnit ( int player, unit creep ) {
    	int count = UnitGroupCount( Paths[player].starters, c_unitCountAll );
    	fixed r;
    	int i;
    	int random;
    	int next;
    	unit u;
    	if ( count <= 0 ) {
    		return false;
    		//No starting point
    	}
    	u = UnitGroupRandomUnit( Paths[player].starters, c_unitCountAll );
    	UnitSetPosition( creep, UnitGetPosition( u ), false );
    	while ( 1 == 0 ) {
    		r = UnitGetCustomValue( u, 0 );
    		i = FixedToInt( r );
    		if ( i = 0 ) {
    			return false;
    			//Path not finished.
    		}
    		random = RandomInt( 1, i );
    		next = UnitGetCustomValue( u, random );
    		u = UnitFromId( next );
    		UnitIssueOrder( creep, "move", c_orderQueueAddToEnd );
    		if ( i = -1 ) {
    			//exit
    			return true;
    		}
    	}
    }
    
    Posted in: Triggers
  • 0

    posted a message on Trigger Exercise #3 - Tower Defense Spawning System

    The performance with my way (uservalues) is way better than your way. You have to create 56 units, I have to create 1. You have to create 56 different triggers or one trigger with 56 ifs. For my way you have to initialise only these paths you will need in this games. So only the amount of players you have. Then you have an additional problem. What happens if ther is something like a "H" so there is a way that they can come from the the base of the H and walk up to the first cross way. There they go left or right and when they reach the other side they can walk back and forth again ...

    Your way would need like 20 times more time to load then mine. Since you want to create also rects and have to laod 56 times the units I have. And the most of my code would be loaded when the player chooses a map...

    And I wouldn't say your method is faster to do. I mean 56 units are a lot. And you have to search always the right one. And creating them uses also time.

    Btw. I've begun with writing my idea in galaxy. (need it also for my self).

    Posted in: Triggers
  • 0

    posted a message on Trigger Exercise #3 - Tower Defense Spawning System

    why only 2 random? You would need a random unit for every possible combination. Because ther might be a path that goes N and NE and NW.

    Posted in: Triggers
  • 0

    posted a message on Trigger Exercise #3 - Tower Defense Spawning System

    Why sould the path for the creep be defined?

    Path Unit UserValue Index 0 = 2 ( there are two possible ways ) Index 1 = Way one. Index 2 = Way two. You chose the way throught a random int.

    Btw. does stun interupt the order queue? If not you could set the path on creep creation through queueing the movement orders.

    You could also use unit comes in range event and different unit types. But you would need many unit types. ( left, left or right, left or right or up ... )

    Posted in: Triggers
  • 0

    posted a message on Trigger Exercise #3 - Tower Defense Spawning System

    Is it possible to use units instead of points? Since you could use the uservalue of the units for the path. Example: Unit 1 (start) uservalue index 0 = 1. That means there is one possbile path. Index 1 = id of the next unit. Unit 2 (node) uservalue index 0 = 2. That means there are two possible paths. Index 1 = first unit, Index 2 = second unit.

    End the end unit has a index 0 = -1 or something like that.

    Posted in: Triggers
  • 0

    posted a message on Weekly Terraining Exercise #26: A different kind of JTE!

    Should everyone just make one terrain or is it allowed to make two?

    Posted in: Terrain
  • 0

    posted a message on Trigger Exercise #3 - Tower Defense Spawning System

    I thought about saving the new path with a string, since you can change a point to two fixed and these to strings. Now I would add these strings together with a " " between the values. And the use StringWord( the string, n - (n-1) ).

    Posted in: Triggers
  • 0

    posted a message on Weekly Terraining Exercise #26: A different kind of JTE!

    I'm on it.

    Edit: done

    Posted in: Terrain
  • 0

    posted a message on Which UI Frame is this?

    I use this to remove the UI Frames. Later I add the Commandfield and Minimap frame again:

    frame = c_syncFrameTypeFirst;
    while (frame <= c_syncFrameTypeLast) {
            UISetFrameVisible(PlayerGroupAll(), frame, false);
            frame += 1;
        }
    

    But which frame is the one I marked? It stays also when I remove them all.

    Posted in: Triggers
  • 0

    posted a message on Behavior modification

    Wouldn't it be possible to set the Beheavier whitch creates the aura stackable and the same for the effect beheavier? Than you could simply add the aura Beheavier a second time to the leader. The Effect beheavier should than be applied two times right?

    But even this works, you need still for each effect of the aura one aura...

    If I've got some sparetime I will test it...

    cedi

    Posted in: Data
  • 0

    posted a message on [Release] Facility 17 - A Terran RPG

    What about one of these Protoss-Zerg thingies...

    It has these abilities:

    1. Illusion: Creates two illusion of itself and changes the its position. Illusions vanish after one round.

    2. Force Field: Trapps one of the heros in a force field. Stuns him for 2 rounds.

    3. Mind Beam: Attack beam which hits all three heros.

    - When it has lost 30% of its hp the thingy charges one round for a devasting attack which sets the hp of all heros to 1%.

    - When it has lost 60% of its hp it creates a link to one of the heros. The linked hero takes 25% of the damage the thingy takes.

    - When it has lost 75% it creates a second link.

    - When it has lost 90% it creates a third link.

    - When it has lost 99% it breakes all links and steals 50% of the hp of each hero.

    Btw. I really like this map...

    Posted in: Project Workplace
  • To post a comment, please or register a new account.