Staredit Network

Staredit Network -> UMS Assistance -> Tech advances
Report, edit, etc...Posted by sharf on 2006-05-06 at 11:50:24
ok im makeing a civilization type game. you build a building near a beacon to get cash. but when u upgrade the buildings so u gat more mins, can you make it so if its advanced you get more withougth doing more triggers? heres what i mean

Trigger
Description:
this is withougth upgrades
Players:
¤ player1-6
Conditions:
¤ p1 brings atleast 1 supplie depot to land
¤ foes bring exactly 0 supplie depot to land
¤ current player comand exactly 0 "upgrade"
¤ countdown timer is exactly 0
Actions:
¤ add 8 mins
¤ preserve trigger



Trigger
Description:
this is with upgrades
Players:
¤ player1-6
Conditions:
¤ p1 brings atleast 1 supplie depot to land
¤ foes bring exactly 0 supplie depot to land
¤ current player comand exactly 1 "upgrade"
¤ countdown timer is exactly 0
Actions:
¤ add 12 mins
¤ preserve trigger


can you get this effect withougth hav ign to do 20 more triggs for each upgrade?
Report, edit, etc...Posted by Heimdal on 2006-05-06 at 12:02:31
Yes, you can. Although if there are only 20 upgrade levels the method you have only results in 20 triggers, so that's not so bad. I'd also recommend using current player so you don't have to copy the set of triggers for every player. It looks like the rest of your trigger uses current player, but the first condition uses player 1.

Anyway, the method to use fewer triggers (and allow for a greater number of upgrades) is as follows:



Trigger
Conditions:
¤ Current Player commands at least 16 upgrade
¤ Anything else...
Actions:
¤ Add 16 minerals for current player
¤ Give 16 upgrade owned by current player to player 12


Trigger
Conditions:
¤ Current Player commands at least 8 upgrade
¤ Anything else...
Actions:
¤ Add 8 minerals for current player
¤ Give 8 upgrade owned by current player to player 12


...and so on (dividing by 2), down to:

Trigger
Conditions:
¤ Current Player commands at least 1 upgrade
¤ Anything else...
Actions:
¤ Add 1 minerals for current player
¤ Give 1 upgrade owned by current player to player 12


And finally:

Trigger
Conditions:
¤ Always
Actions:
¤ Give all upgrade owned by player 12 to current player



It seems that you wanted 4 minerals for each upgrade; in that case just multiply all the mineral amounts by 4. With the 6 triggers listed here, it will handle up to 31 upgrades.
Report, edit, etc...Posted by sharf on 2006-05-06 at 12:24:54
no i mean 20 locations u can build at and like 4 upgrade levels
Report, edit, etc...Posted by Heimdal on 2006-05-06 at 23:17:55
Alright then...there's a beacon at every location you can build something, correct?

Basically what you want to do is iterate over every beacon and see if each player has a suppy depot within a certain distance to that beacon. If they do, give them some cash. We'll do the iteration by giving the beacons away.

I've attached a map to demonstrate this. I didn't add hyper triggers so that you can actually see what's going on. This method should work for any number of beacons, and you'll only need two extra triggers for each player in the game (I did it for players 1 and 2). I also didn't include the upgrade stuff but that shouldn't be too hard. If you only have 4 upgrade levels then I'd just make a separate trigger for each one - you'd only add 3 more triggers this way.

Let me know if you have any questions.
Report, edit, etc...Posted by sharf on 2006-05-07 at 12:59:22
um when i try the link it just shows a page with a crud load of strange figures....
Report, edit, etc...Posted by Daedalus on 2006-05-07 at 13:18:02
Yeah that's a known problem (the strange figures thing). Left click on the link and use "save as" (or something like that, depends on (the version of) your browser).

I don't got time to try out anything for you at the moment, but I'm sure Heimdal has already figured out the most efficiant method smile.gif.
Next Page (1)