MCAT
  • MCAT
  • 57.5% (Neutral)
  • Private Topic Starter
18 years ago
Hi!
I have made a script which should make that water goes up than down in some water area in random intervals. Other script should make that PC player "PlyrGuard" defence their area and destroy any other unit which comes in their area. Both scripts aren't doing anything 😞. So can you please help me to repair scripts to work.

THANKS

Download Attachment: UserPostedImage gnw.zip 
5.45 KB
Delphi programmer
Sponsor
Me Myself and Pi
18 years ago
The main problem is is that you have most of your scripts in the Neutral folder. Also, when you do this, the AI won't work. (It's because the map thinks you want to override the skirmish scripts EA made for the game, so they wont work) So move all your scripts to the PlyrCivilian folder. (Even the one you put in the PlyrGaurd folder. I think that one will also deactivate the AI.) I'm not sure why scrips usually won't work in the Nuetral folder, but I know they work perfactly in a single player map. (Not skirmish or multiplayer.)

A few other notes about your scripts, you don't need to use any flag actions or conditions. The scripts will actavate as soon as the timers their waiting for expire.
In the "Down" script, you used an action to deactivate the "Start" script, this isn't necessary because when a script is check "Deactivate upon success" in the script properties, the script will deactivate itself as soon as the script action is meant. (If you uncheck this box, then the script will reactivate every frame [there are 30 frames in a second in the game to the script will reactivate 30 times a seconds] in the game for the rest of the game or until another script deactivates it. You can change it to reactivate for certain time intervals by checking the "Every #### seconds" in the Evaluate: section.)

Your scripts, as they are, will work the first time through, but wont repeat. You need to put some actions into them to reactivate the scripts after they've been deactivated. So they should look like this:

Start:

*** IF ***
True.
*** THEN ***
Set timer 'timer1' to expire between 30.00 and 90.00 seconds.



Down:

*** IF ***
Timer 'timer1' has expired.
*** THEN ***
Enable Script 'Up'.
area 'Area 8' changes altitude to 82.00 in 10.00 seconds doing 1.00 dam_/sec.
Set timer 'timer2' to expire between 5.00 and 20.00 seconds.



Up:

*** IF ***
Timer 'timer2' has expired.
*** THEN ***
area 'Area 8' changes altitude to 0.00 in 5.00 seconds doing 1.00 dam_/sec.
Set timer 'timer1' to expire between 30.00 and 90.00 seconds.
Enable Script 'Down'.



This should work, but take note, whenever you raise or lower a water field, the game lags a little during the time period.


About the guards, when you use the action that tells them to attack anything in a certain area, isn't completely true. The units will only attack their enemy that may be in the area. But you can only make the host an enemy to them, it's not possible to make any other players (skirmish or human) to be an enemy to them. (Blame EA 😠) To refer to the host as a player, use . This player really only works right if the script it's used in the PlyrCivilian folder. To make the guards an enemy to the host of the game (or vice-versa), use the action "Player\Alliances\Change how a player relates to another player."
But the best thing to do to make the guards only attack within a certain area, is to use the action "Team\Guard\Set to guard -- area." (The same action you used.)
So the script should look like this:

*** IF ***
True.
*** THEN ***
Player '' considers Player 'PlyrGuard' to be Enemy
Player 'PlyrGuard' considers Player '' to be Enemy
Team 'teamPlyrGuard' begins guarding area 'techland'


The gaurds will gaurd the area all through out the game.


Let me know if you encounter any more problem. 😉
MCAT
  • MCAT
  • 57.5% (Neutral)
  • Private Topic Starter
18 years ago
Thanks for the explanation. Script is working, but why when the water goes up or down, game start blocking. When water isn't moving, game runs ok. Why is that?
Delphi programmer
Me Myself and Pi
18 years ago
I really don't know. It might have to do with changing the impassable area around the water, the blending of the water with the land textures. But I wouldn't think that would cause the lag.
MCAT
  • MCAT
  • 57.5% (Neutral)
  • Private Topic Starter
18 years ago
Another question: How to make that guard team guard area on this method:
if somebody come in their area, they atack him and return back where they started.
>Team 'teamPlyrGuard' begins guarding area 'techland'< makes that all units come on cetner of the area and guard it, but I want, they guard in position where I placed them. Then if anyone come in area they atack it and return on position where they belong. Then if someone enter the area and get out before it dead, guards leave it alone and return back to theit position. How to do that? Must I locate every point where units are or just something else?
Delphi programmer
Me Myself and Pi
18 years ago
I think you should use the action "Set to guard -- current loction." Each unit will start guarding his location. But I'm not sure if the units will return to their loctions after attacking the enemy.

If that doesn't work out, you could just use defenses around instead of your units.