- Joined
- Oct 9, 2011
- Messages
- 45
Hey hivers,
I'm currently working on a RPG map that I started about 7 years ago and its coming close to being finished, but I'm having problems with getting variables/arrays to work.
I dont know if posting the respective trigger is gonna work, because mine are part german, so I am going to try and translate them. Heres the situation:
Theres a town with 50 citizens in it. I want the ruler to get 10 gold per living citizen every X seconds. If a citizen dies, I want his periodic taxes to become unavailable to the ruler.
I tried doing it with an array (size 49) named "CitizensAlive". Everytime a citizens dies, this trigger fires:
Unit dies... Set CitizensAlive[1] = (CitizensAlive[1] - 1)
The tax trigger looks like this:
For each (Integer CitizensAlive[1]) from 0 to 49, do (Player - Add 10 to (Owner of (Random unit from (Units of type Isenheim Guardian))) gold)
The problem: For some reason, it always gives me 500 gold every X seconds, no matter how many citizens are left. And I dont understand why, I read up on a lot of tutorials and at least in my world this trigger should work fine
I'm currently working on a RPG map that I started about 7 years ago and its coming close to being finished, but I'm having problems with getting variables/arrays to work.
I dont know if posting the respective trigger is gonna work, because mine are part german, so I am going to try and translate them. Heres the situation:
Theres a town with 50 citizens in it. I want the ruler to get 10 gold per living citizen every X seconds. If a citizen dies, I want his periodic taxes to become unavailable to the ruler.
I tried doing it with an array (size 49) named "CitizensAlive". Everytime a citizens dies, this trigger fires:
Unit dies... Set CitizensAlive[1] = (CitizensAlive[1] - 1)
The tax trigger looks like this:
For each (Integer CitizensAlive[1]) from 0 to 49, do (Player - Add 10 to (Owner of (Random unit from (Units of type Isenheim Guardian))) gold)
The problem: For some reason, it always gives me 500 gold every X seconds, no matter how many citizens are left. And I dont understand why, I read up on a lot of tutorials and at least in my world this trigger should work fine
Last edited: