• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Evolution System

Status
Not open for further replies.
Hello guys, i have been working with these for a while now,
i have had it running for Multiplayer but after setting it up to decect at the same time, instead of having to wait for one person to finish doing it then another starting i did this,
I also use For loop integer A
But now it just aint working, here is the trigger.
  • Basic Evolution
    • Events
      • Unit - A unit Gains a level
    • Conditions
    • Actions
      • For each (Integer A) from 1 to players, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of playerhero[(Integer A)]) Equal to 8
            • Then - Actions
              • Hero - Disable experience gain for playerhero[(Integer A)]
              • -------- We shall detect if Strengh is greater than both Agility and intelligence --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (istrength[currentplayer_Copy[currentplayer]] Greater than iagility[currentplayer_Copy[currentplayer]]) and (istrength[currentplayer_Copy[currentplayer]] Greater than iIntelligence[currentplayer_Copy[currentplayer]])
                • Then - Actions
                  • Set ievolution[currentplayer_Copy[currentplayer]] = (EvolveLevel[currentplayer_Copy[currentplayer]] x 10)
                  • Set EvolveLevel[currentplayer_Copy[currentplayer]] = (EvolveLevel[currentplayer_Copy[currentplayer]] + EvolveLevel[currentplayer_Copy[currentplayer]])
                  • -------- The system will now locate the unit and create and unit. --------
                  • Unit - Create 1 Evolution[ievolution[currentplayer]] for (Owner of (Triggering unit)) at (Position of playerhero[currentplayer]) facing Default building facing degrees
                  • Unit - Remove playerhero[currentplayer_Copy[currentplayer]] from the game
                  • Set playerhero[currentplayer_Copy[currentplayer]] = (Last created unit)
                  • -------- We shall now, set up all the attributes. --------
                  • Hero - Set playerhero[currentplayer_Copy[currentplayer]] Hero-level to (EvolveLevel[currentplayer_Copy[currentplayer]] x 8), Hide level-up graphics
                  • Hero - Modify Strength of playerhero[currentplayer_Copy[currentplayer]]: Set to istrength[currentplayer_Copy[currentplayer]]
                  • Hero - Modify Agility of playerhero[currentplayer_Copy[currentplayer]]: Set to iagility[currentplayer_Copy[currentplayer]]
                  • Hero - Modify Intelligence of playerhero[currentplayer_Copy[currentplayer]]: Set to iIntelligence[currentplayer_Copy[currentplayer]]
                • Else - Actions
              • -------- We shall detect if Agility is greater than both Strength and intelligence --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (iagility[currentplayer_Copy[currentplayer]] Greater than istrength[currentplayer_Copy[currentplayer]]) and (iagility[currentplayer_Copy[0]] Greater than iIntelligence[currentplayer_Copy[currentplayer]])
                • Then - Actions
                  • Set ievolution[currentplayer_Copy[currentplayer]] = (EvolveLevel[currentplayer_Copy[currentplayer]] x 10)
                  • Set EvolveLevel[currentplayer_Copy[currentplayer]] = (EvolveLevel[currentplayer_Copy[currentplayer]] + EvolveLevel[currentplayer_Copy[currentplayer]])
                  • -------- The system will now locate the unit and create and unit. --------
                  • Unit - Create 1 Evolution[ievolution[currentplayer]] for (Owner of (Triggering unit)) at (Position of playerhero[currentplayer]) facing Default building facing degrees
                  • Unit - Remove playerhero[currentplayer_Copy[currentplayer]] from the game
                  • Set playerhero[currentplayer_Copy[currentplayer]] = (Last created unit)
                  • -------- We shall now, set up all the attributes. --------
                  • Hero - Set playerhero[currentplayer_Copy[currentplayer]] Hero-level to (EvolveLevel[currentplayer_Copy[currentplayer]] x 8), Hide level-up graphics
                  • Hero - Modify Strength of playerhero[currentplayer_Copy[currentplayer]]: Set to istrength[currentplayer_Copy[currentplayer]]
                  • Hero - Modify Agility of playerhero[currentplayer_Copy[currentplayer]]: Set to iagility[currentplayer_Copy[currentplayer]]
                  • Hero - Modify Intelligence of playerhero[currentplayer_Copy[currentplayer]]: Set to iIntelligence[currentplayer_Copy[currentplayer]]
                • Else - Actions
              • -------- We shall detect if Intelligence is greater than both Strength and Agility --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (iIntelligence[currentplayer_Copy[currentplayer]] Greater than istrength[currentplayer_Copy[currentplayer]]) and (iagility[currentplayer_Copy[0]] Less than iIntelligence[currentplayer_Copy[currentplayer]])
                • Then - Actions
                  • Set ievolution[currentplayer_Copy[currentplayer]] = (EvolveLevel[currentplayer_Copy[currentplayer]] x 10)
                  • Set EvolveLevel[currentplayer_Copy[currentplayer]] = (EvolveLevel[currentplayer_Copy[currentplayer]] + EvolveLevel[currentplayer_Copy[currentplayer]])
                  • -------- The system will now locate the unit and create and unit. --------
                  • Unit - Create 1 Evolution[ievolution[currentplayer]] for (Owner of (Triggering unit)) at (Position of playerhero[currentplayer]) facing Default building facing degrees
                  • Unit - Remove playerhero[currentplayer_Copy[currentplayer]] from the game
                  • Set playerhero[currentplayer_Copy[currentplayer]] = (Last created unit)
                  • -------- We shall now, set up all the attributes. --------
                  • Hero - Set playerhero[currentplayer_Copy[currentplayer]] Hero-level to (EvolveLevel[currentplayer_Copy[currentplayer]] x 8), Hide level-up graphics
                  • Hero - Modify Strength of playerhero[currentplayer_Copy[currentplayer]]: Set to istrength[currentplayer_Copy[currentplayer]]
                  • Hero - Modify Agility of playerhero[currentplayer_Copy[currentplayer]]: Set to iagility[currentplayer_Copy[currentplayer]]
                  • Hero - Modify Intelligence of playerhero[currentplayer_Copy[currentplayer]]: Set to iIntelligence[currentplayer_Copy[currentplayer]]
                • Else - Actions
            • Else - Actions
The Variable setup
  • Actions
    • -------- --------------------------------------------------- --------
    • -------- --------------------------------------------------- --------
    • -------- The Number values are used for each type of different stat --------
    • -------- 1 = Strength --------
    • -------- 10 = Agility --------
    • -------- 100 = Intelligence --------
    • -------- This different types are used to stop bugging, and collision. --------
    • -------- To add a new unit to strength simply, create a new trigger as --------
    • -------- Set Evolution[(Value x Highest Stat)] = (Unit you select) --------
    • -------- Obviously you would change the "Value" to the tier level. (1,2,3,4,5,6) --------
    • -------- Basic Evolution --------
    • Set Evolution[(1 x 1)] = Stength
    • Set Evolution[(1 x 10)] = Agility
    • Set Evolution[(1 x 100)] = Intelligence
    • -------- Hybrid Evolution --------
    • -------- x1 + 10 = Strength/Agility --------
    • -------- x1 + 100 = Strength/Intelligence --------
    • -------- x100 + 100= Intelligence/Agility --------
    • -------- This different types are used to stop bugging, and collision. --------
    • -------- Set Evolution[(Value x Highest Stat) + 2nd Highest Stat] = (Unit you select) --------
    • -------- Obviously you would change the "Value" to the tier level. (1,2,3,4,5,6) --------
    • Set Evolution[((2 x 1) + 10)] = Strength/Agility
    • Set Evolution[((2 x 1) + 100)] = Strength/Intelligence
    • Set Evolution[((2 x 100) + 10)] = Intelligence/Agility
    • -------- End of Evolution Setup --------
    • -------- --------------------------------------------------- --------
    • -------- --------------------------------------------------- --------
    • Set players = (Number of players in (All players matching ((((Matching player) controller) Equal to User) and (((Matching player) slot status) Equal to Is playing))))
    • For each (Integer A) from 1 to players, do (Actions)
      • Loop - Actions
        • Set currentplayer = (Player number of (Player((Integer A))))
        • Set currentplayer_Copy[(Integer A)] = currentplayer
        • Set iSkillPoints[(Integer A)] = 1
        • Set EvolveLevel[(Integer A)] = 1
        • Unit - Create 1 Organism for (Player((Integer A))) at (Center of (Playable map area)) facing Default building facing degrees
        • Set playerhero[(Integer A)] = (Last created unit)
        • Trigger - Add to Level up CHEAT <gen> the event (Player - (Player((Integer A))) skips a cinematic sequence)
Attachment :
http://www.hiveworkshop.com/forums/attachments/triggers-scripts-269/97215d1296597353-evolution-system-evolutionsystem.w3x
 
Last edited:
Level 28
Joined
Jan 26, 2007
Messages
4,789
This seems weird.

As far as I know, the currentplayer is always the same player? (last player in the player group).
currentplayer_Copy seems correct to me though.

But if you use:
[currentplayer_Copy[currentplayer]]
You will say: [currentplayer_Copy[last player]], which results in last player.
What is wrong with using "(Integer A)" instead? Because that's where the player is looped.

If you still think you're right with that currentplayer, try debugging the trigger - one of the most useful things you can do when a trigger bugs is putting some game messages with core information in it to see exactly where it went wrong.


Aside from that there are a few location leaks and a player group leak :/
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Sorry, I didn't see the edit.

As I said: completely removing the variables "currentplayer" and "currentplayer_Copy" and replacing them with "Integer A" did the trick.
You can't say I wasn't right about that :D

Map attached (I changed some things so you can see it works for multiple people).
 

Attachments

  • EvolutionSystem.w3x
    134.8 KB · Views: 39
Status
Not open for further replies.
Top