Page 1 of 1

The Action List

Posted: Sun Apr 27, 2008 2:26 pm
by Fildred
So I'm still working on the same level from my last question where you have ot defend the villagers of a town from an assaulting army. I have all the enemy squads in place on the other side of the river, and its time to being scripting thier attack. I know i could use attack and melee actions, but i've heard rumors and started to get an idea that perhaps some linked action lists could cause randomness to the attack?

This is my idea, im curious if it will work. There are 3 main waves of attackers, and 3 waves of ghol "hunters." I want to program the 3 main waves to activate with a melee or attack action so that they come in and attack the peasants, but use a TUNI to make sure there are no nearby player forces that will take precedent over the peasents. Those three waves will be triggered one after the other (hopefully randomly, so you dont know where or what is coming at you next - is this where i use the action list?) with delays so they dont come all at once.

Unrealted to those three attacks, the three waves of ghols will be programmed to ignore players, and just hunt down the peasents. Since the villagers are one of the victory conditions, the player will be forced to stop these fast, focused hunters. Since these three waves are the same, i assume i wont need to randomize them, but is there some way to delay them so they dont come all at the same time? Do i just give them REALLLY long trigger times? Or is there some other effective way to delay them?

Re: The Action List

Posted: Sun Apr 27, 2008 2:59 pm
by A-Red
For a clear explanation of all sorts of scripting basics, I'd recommend this tutorial. That's how I learned, and if you still have questions you should be able to get a good enough understanding of script that you can start interpreting Bungie's script and see how they did things. When you've really got that stuff down, you might try this more advanced follow-up tutorial.

Action Lists are pretty easy. You use an Actions to Activate flag, and link to all of the waves you want randomized, and then add a Choose Random Actions flag. With a wave-dispatcher, it's just slightly trickier, because you want to reuse the Action List each time you send another wave. The ACLI is going to look like this:

ACLI Wave Dispatcher
Actions to Activate: [wave 1/wave2/wave3]
Choose Random Actions
Activates on Failure: Light Victory

Now here's the trick--each time one of your waves activates, it should also activate a Munger with a Delete Action flag, which deletes the action that starts the wave (the one that the ACLI links to). Then, when the monsters from that wave are dead, activate the ACLI again. Because the wave that already got chosen has been deleted, the ACLI will only choose from the remaining waves. If the ACLI activates and all waves have been deleted, the Activates on Failure will trigger, and it will activate an Endgame action, and player victory. Or you can activate something else--that's just an example.
Fildred wrote:Since these three waves are the same, i assume i wont need to randomize them, but is there some way to delay them so they dont come all at the same time? Do i just give them REALLLY long trigger times? Or is there some other effective way to delay them?
Yeah, trigger times are basically how you would do it, assuming you have particular times when you want them to come. Or you could have one of the ghol waves come each time one of the main waves comes, or 30 seconds after each of the main waves comes, or whatever.

Posted: Sun Apr 27, 2008 8:05 pm
by Fildred
Wow thats awesome thanks. But let me ask you this: I dont want a whole wave to be destroyed before the next one comes, definitley has an "Oh my god will we ever survive this?" feel to it, which i like. What if, instead of waiting for them all to be dead, I did this: When the action list activates, one wave begins in, a munger deletes the action that activated that wave, and i instantly reactivate the actionlist, which has a trigger time of like 15 to 100, so you don't know when, but sooner or later another wave comes at you? would that work? (Im assuming the 0.00 to 0.00 time trigger is a random selection range?)

Posted: Sun Apr 27, 2008 8:57 pm
by Pyro
Yea it is possible, A-Red just said it as an example. You can do it so if wave 1 has less than 10 units wave 2 is activated. Or as you suggested, after wave 1 is activated wave 2 is activated with a delay of 240 to 300 seconds. This way the player has between 240 to 300 seconds to kill as much of the first wave as possible before the next wave arrives.