- Joined
- Mar 16, 2014
- Messages
- 152
Hey, I have a relatively simple trigger.
Here is the desired functionality:
If a particle item is picked up, the amount of charges in the particle combines. If the hero has over 175, 175 particles are deducted and the hero gets a shard 1. With 350 it becomes shard 2, 525 shard 3, and 700 it becomes a philosopher's stone.
This basic functionality works in-game, but for whatever reason I mess up the data of the amount of particles somewhere in the trigger. The hero gets a bigger shard/stone than they're supposed to, and they end with more particles than they're supposed to. It is very strange.
Here is the desired functionality:
If a particle item is picked up, the amount of charges in the particle combines. If the hero has over 175, 175 particles are deducted and the hero gets a shard 1. With 350 it becomes shard 2, 525 shard 3, and 700 it becomes a philosopher's stone.
This basic functionality works in-game, but for whatever reason I mess up the data of the amount of particles somewhere in the trigger. The hero gets a bigger shard/stone than they're supposed to, and they end with more particles than they're supposed to. It is very strange.
-
Phil Particles Get
-
Events
- Unit - A unit Acquires an item
-
Conditions
- (Item-type of (Item being manipulated)) Equal to Philosopher's Particles
-
Actions
- Trigger - Turn off (This trigger)
- Set VariableSet TempInteger = 0
- Set VariableSet Temp_Unit = (Hero manipulating item)
- Set VariableSet TempInt = (Charges remaining in (Item being manipulated))
- Game - Display to (All players) the text: (Particles Acquired: + (String(TempInt)))
-
For each (Integer A) from 1 to 6, do (Actions)
-
Loop - Actions
- If ((Item-type of (Item carried by Temp_Unit in slot (Integer A))) Equal to Philosopher's Particles) then do (Set VariableSet TempInteger = (TempInteger + 1)) else do (Do nothing)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- TempInteger Greater than 1
-
Then - Actions
- Item - Remove (Item being manipulated)
- Else - Actions
-
If - Conditions
- Game - Display to (All players) the text: (Particles currently have: + (String((Charges remaining in (Item carried by Temp_Unit of type Philosopher's Particles)))))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ((TempInt + (Charges remaining in (Item carried by Temp_Unit of type Philosopher's Particles))) + 0) Less than or equal to 174
-
Then - Actions
- Item - Set charges remaining in (Item carried by Temp_Unit of type Philosopher's Particles) to ((Charges remaining in (Item carried by Temp_Unit of type Philosopher's Particles)) + TempInt)
- Game - Display to (All players) the text: (Ending Particle Amount: + (String((Charges remaining in (Item carried by Temp_Unit of type Philosopher's Particles)))))
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ((TempInt + (Charges remaining in (Item carried by Temp_Unit of type Philosopher's Particles))) + 0) Equal to 175
-
Then - Actions
- Item - Remove (Item carried by Temp_Unit of type Philosopher's Particles)
- Hero - Create Philosopher's Shard 1 and give it to Temp_Unit
- Game - Display to (All players) the text: debug shard 1 made
- Game - Display to (All players) the text: (Ending Particle Amount: + (String((Charges remaining in (Item carried by Temp_Unit of type Philosopher's Particles)))))
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ((TempInt + (Charges remaining in (Item carried by Temp_Unit of type Philosopher's Particles))) + 0) Less than 350
-
Then - Actions
- Item - Set charges remaining in (Item carried by Temp_Unit of type Philosopher's Particles) to ((Charges remaining in (Item carried by Temp_Unit of type Philosopher's Particles)) + (TempInt - 175))
- Set VariableSet Particle = (Item carried by Temp_Unit of type Philosopher's Particles)
- Hero - Drop Particle from Temp_Unit.
- Hero - Create Philosopher's Shard 1 and give it to Temp_Unit
- Game - Display to (All players) the text: debug shard 1 made
- Game - Display to (All players) the text: (Ending Particle Amount: + (String((Charges remaining in (Item carried by Temp_Unit of type Philosopher's Particles)))))
- Hero - Give Particle to Temp_Unit
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ((TempInt + (Charges remaining in (Item carried by Temp_Unit of type Philosopher's Particles))) + 0) Less than 525
-
Then - Actions
- Item - Set charges remaining in (Item carried by Temp_Unit of type Philosopher's Particles) to ((Charges remaining in (Item carried by Temp_Unit of type Philosopher's Particles)) + (TempInt - 350))
- Set VariableSet Particle = (Item carried by Temp_Unit of type Philosopher's Particles)
- Hero - Drop Particle from Temp_Unit.
- Hero - Create Philosopher's Shard 2 and give it to Temp_Unit
- Game - Display to (All players) the text: debug shard 2 made
- Game - Display to (All players) the text: (Ending Particle Amount: + (String((Charges remaining in (Item carried by Temp_Unit of type Philosopher's Particles)))))
- Hero - Give Particle to Temp_Unit
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ((TempInt + (Charges remaining in (Item carried by Temp_Unit of type Philosopher's Particles))) + 0) Less than 700
-
Then - Actions
- Item - Set charges remaining in (Item carried by Temp_Unit of type Philosopher's Particles) to ((Charges remaining in (Item carried by Temp_Unit of type Philosopher's Particles)) + (TempInt - 525))
- Set VariableSet Particle = (Item carried by Temp_Unit of type Philosopher's Particles)
- Hero - Drop Particle from Temp_Unit.
- Hero - Create Philosopher's Shard 3 and give it to Temp_Unit
- Game - Display to (All players) the text: debug shard 3 made
- Game - Display to (All players) the text: (Ending Particle Amount: + (String((Charges remaining in (Item carried by Temp_Unit of type Philosopher's Particles)))))
- Hero - Give Particle to Temp_Unit
-
Else - Actions
- Item - Set charges remaining in (Item carried by Temp_Unit of type Philosopher's Particles) to ((Charges remaining in (Item carried by Temp_Unit of type Philosopher's Particles)) + (TempInt - 700))
- Set VariableSet Particle = (Item carried by Temp_Unit of type Philosopher's Particles)
- Hero - Drop Particle from Temp_Unit.
- Hero - Create Philosopher's Stone and give it to Temp_Unit
- Game - Display to (All players) the text: debug stone made
- Game - Display to (All players) the text: (Ending Particle Amount: + (String((Charges remaining in (Item carried by Temp_Unit of type Philosopher's Particles)))))
- Hero - Give Particle to Temp_Unit
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Trigger - Turn on (This trigger)
-
Events
Last edited: