Scripting Question
Posted: Mon Apr 09, 2007 5:12 pm
I've been reading through the scripting articles available on vr's website (very cool of you to put/keep those online, btw), and I've went through different examples and found some stuff to work and some other stuff to not work. One thing is that I gone thru Ares' scripting guide more than once. I've triple checked my stuff and for some reason, I just can't get things to work right.
Basically, the level starts out with 2 different groups attacking and 2 others lurking nearby. The first group to attack (melee and arty) doesn't use any Test Unit actions at all. Their attack (MELE) is activated by an 'Activates on Success' from a previous Movement action. That movement action is intially active, but put on a delay to allow the player(s) in the game to get ready/distribute units.
The second group, all melee units, uses a Test Unit action to test for Vitality Less Than (less than 100% culmative health) from the first group to attack that I mentioned above. Basically, I wanted this second group to begin rushing in as soon as the first group takes damage from the player. I have a Test Unit function for Vitality, which upon success will activate a Movement action, which upon success will activate an attack (MELE) action.
Now, the third group, all melee- is set to activate only if the player is really really close to where I stashed them at (on a hill). I started the chain with a Test Unit action for Enemies within a set Radius. Per Ares' scripting tutorial, I linked both this 3rd group of melee and 'The Player Units as Enemies' function I made based off the player's units. When this is activated upon success, this 3rd group of melee should appear via a CTRL function, then the CTRL function is set to activate on success a Movement action (so none of the units in the 3rd group gets stuck on trees). After the movement action is successful, it is set to activate an attack (MELE) function.
I also have a wight sunk in a nearby area of deep water, but only comes out and attack if any of the player(s)' units are really close. The wight uses the same style chain reaction of functions, except that I used the ATTACK function instead of the Suicide function, because I just want him to rush at the player(s) on the level instead of sneaking/wandering around when triggered.
The problem? None of the Test Unit functions I setup seem to work properly. The 3rd group that should only activate when I'm close to them (I even set the radius to 1 last night out of curiousity), activates, appears and attacks even though I'm (player units) a good distance away from them. The wight does the same even though I'm not even close to the water. I tried changing some things around, and one time my units (player units) got confused and even though the wight hadn't surfaced, they had tried to attack it. Regardless of what I do, the 2nd group automatically attacks from the get-go and doesn't even pick up the Movement action, it just goes straight to the attack (MELE) action.
I downloaded Chaos and I guess it was made for a later version of OSX.
I've checked through all the action settings, and they are correct. I must be missing something incredibly simple, or shouldn't be using a certain type of action for certain units...? What's making this not work the way I want?
Thanks
Basically, the level starts out with 2 different groups attacking and 2 others lurking nearby. The first group to attack (melee and arty) doesn't use any Test Unit actions at all. Their attack (MELE) is activated by an 'Activates on Success' from a previous Movement action. That movement action is intially active, but put on a delay to allow the player(s) in the game to get ready/distribute units.
The second group, all melee units, uses a Test Unit action to test for Vitality Less Than (less than 100% culmative health) from the first group to attack that I mentioned above. Basically, I wanted this second group to begin rushing in as soon as the first group takes damage from the player. I have a Test Unit function for Vitality, which upon success will activate a Movement action, which upon success will activate an attack (MELE) action.
Now, the third group, all melee- is set to activate only if the player is really really close to where I stashed them at (on a hill). I started the chain with a Test Unit action for Enemies within a set Radius. Per Ares' scripting tutorial, I linked both this 3rd group of melee and 'The Player Units as Enemies' function I made based off the player's units. When this is activated upon success, this 3rd group of melee should appear via a CTRL function, then the CTRL function is set to activate on success a Movement action (so none of the units in the 3rd group gets stuck on trees). After the movement action is successful, it is set to activate an attack (MELE) function.
I also have a wight sunk in a nearby area of deep water, but only comes out and attack if any of the player(s)' units are really close. The wight uses the same style chain reaction of functions, except that I used the ATTACK function instead of the Suicide function, because I just want him to rush at the player(s) on the level instead of sneaking/wandering around when triggered.
The problem? None of the Test Unit functions I setup seem to work properly. The 3rd group that should only activate when I'm close to them (I even set the radius to 1 last night out of curiousity), activates, appears and attacks even though I'm (player units) a good distance away from them. The wight does the same even though I'm not even close to the water. I tried changing some things around, and one time my units (player units) got confused and even though the wight hadn't surfaced, they had tried to attack it. Regardless of what I do, the 2nd group automatically attacks from the get-go and doesn't even pick up the Movement action, it just goes straight to the attack (MELE) action.
I downloaded Chaos and I guess it was made for a later version of OSX.
I've checked through all the action settings, and they are correct. I must be missing something incredibly simple, or shouldn't be using a certain type of action for certain units...? What's making this not work the way I want?
Thanks