Help - Search - Members - Calendar
Full Version: Air-to-Air attack script
SWR Productions Forum > Game Modding and Development > Generals/Zerohour Modding
Casojin
I have tried to script Air-to-Air attack in my Contra shellmap (v2) but it doesn't work properly. I script the same way as Air-to-Ground attack (all of them work properly).

Script sequence
- I use camera timer as trigger (frame counter).
- I spawn 2 named Raptors (1 & 2 respectively) @ counter = 400
- I order the Raptors to attack named Helix helicopters (1 & 2 respectively and they're spawned earlier) @ counter = 395
- I script the return script for Raptors to return to spawn point after finished attacking. Return scripts are separated.
> If Helix 1 is destroyed, Raptor 1 move to spawn point.
> If Helix 2 is destroyed, Raptor 2 move to spawn point.
- I script Raptor removal for the end of the scene.

Result
- Raptors are spawned but they didn't move to attack Helix.

I tried checking the attack command many times (I copy a successful Air-to-Ground attack and change unit name a bit), so far I can't find any error.

Can anyone give me some thought how to fix this?
GDIZOCOM
If you have a _tmpchunk.dat file,remove it because it can cause problems to scripts like working properly.
Casojin
I have retry the script on a test map. If I use Unit-attack-Unit script, the Raptor would not attack Helix. However, I assign Helix to a team and order Raptor with Unit-attack-Team instead. It works on test map. When I use this on the shellmap, my Raptor would only attack if the Helix is not too far away (don't know why). Maybe I can try this with another mod and see the result.

PS: Where is "_tmpchunk.dat" located?
n5p29
that file located on your ZH folder in My Documents.

for that scripting problem, why the raptor ordered to attack at counter 395 while spawned at counter 400? isn't it illogical if a unit ordered to attack even when it haven't created yet?
Casojin
It's frame countdown timer, so 400 would come before 395.
n5p29
have you tried to make the raptors move closer to the helix first before attacking them?
Casojin
I've fixed the problem by moving the Raptor spawn points closer to Helix location. I plan to do some more testing with Air-to-Air strike script and see what works and what doesn't.

In my test map, I move Helix to a far away position and the Raptor attack script is working properly. However, the Raptor in test map is manually placed (not spawn by script). Perhaps the script-spawn Raptor might need some time to adjust its altitude before be able to receive any command. I'm not sure about this though.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2024 Invision Power Services, Inc.