Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Offline Babasparks  
#1 Posted : Monday, June 1, 2020 2:54:55 AM(UTC)
Babasparks
Private
Joined: 6/23/2012(UTC)
Posts: 6

Thanks: 6 times
Hi all.

So I have been making my own custom mission map and I took the example scripts from an original map's scripts files. The idea was to have a team attack a trigger area and then respawn if they die.

Now here's the thing, they do respawn when they die but they double each time. The other team just respawns infinetly and crashes the game! Big Smile Sometimes they don't respawn which I also do not understand.

So any help would be greatly appreciated, here are the example scripts -


Hospital Captured (Script is Active + Deactivate Upon Success)
IF
If hospital unit is owned by player
THEN
Set timer - Hospital Assault to expire in 10 secs
(Currently inactive timer, not using it until I think I need to?)

Spawn Hospital Assault Team (Is active, Deactivate upon success)(Evaluate every 10 secs)
IF
If Player has greater than or equal to 1 of unit type ranger in area - Hospital zone
THEN
Spawn an instance of Hospital Assault Team

Hospital Assault Team IF Attacked (Is active, Is subroutine)
IF
If True
THEN
Team Attacks anything in area Hospital zone

Hospital Assault Team Attack (Is active, Is subroutine)
IF
If True
THEN
Have team wander along path
Enable script - Hospital Team Destroyed

Hospital Assault Team Destroyed (Deactivate Upon success)(Evaluates every 12 seconds)
IF
If Team Hospital Assault Team is destroyed
THEN
Spawn an instance of Team Hospital Assault Team


Team Properties

Home Position - Is offmap Team spawn WP
Priority - 50
Build for - 3000 frames
Min/Max - 10 Red Guards
Team Members are AI Recruitable

Behavior
On create - Hospital Assault Team Attack script
On enemy sighted - Hospital Assault Team IF Attacked script
On All clear - Hospital Assault Team Attack script
On Destoryed 100% - None

I just want the team to always be attacking the player and respawning. The scripts will be turned off after some time, about 5 or 10 mins.









Sponsor
Offline SkyMix_RMT  
#2 Posted : Monday, June 1, 2020 12:39:19 PM(UTC)
SkyMix_RMT
Major
Joined: 2/21/2015(UTC)
Posts: 386
Portugal

Thanks: 80 times
Was thanked: 132 time(s) in 96 post(s)
The problem is that you don't deactivate your scripts, so they run infinitely.

Originally Posted by: Babasparks Go to Quoted Post

Spawn Hospital Assault Team (Is active, Deactivate upon success)(Evaluate every 10 secs)
IF
If Player has greater than or equal to 1 of unit type ranger in area - Hospital zone
THEN
Spawn an instance of Hospital Assault Team


This script will spawn the team for an infinite number of times, every 10 seconds, if a condition is met.

Originally Posted by: Babasparks Go to Quoted Post

Hospital Assault Team Destroyed (Deactivate Upon success)(Evaluates every 12 seconds)
IF
If Team Hospital Assault Team is destroyed
THEN
Spawn an instance of Team Hospital Assault Team


This script will spawn a team for an infinite number of times ever 12 seconds after the team is destroyed once.





Check out:

My Music (Techno/House/Experimental)

My Website (GeneralsCentral)

My Youtube Channel (Inactive)

World Builder Community Discord
thanks 1 user thanked SkyMix_RMT for this useful post.
Babasparks on 6/2/2020(UTC)
Offline Babasparks  
#3 Posted : Tuesday, June 2, 2020 4:17:48 AM(UTC)
Babasparks
Private
Joined: 6/23/2012(UTC)
Posts: 6

Thanks: 6 times
Thanks for the reply there SkyMix.

Okay so I see that I have deactivate upon success ticked. Are you saying I must add in: Script - Disable Script? (Disable the current script?)

I am not quite clear on the solution here, sorry :0

Edited by user Tuesday, June 2, 2020 4:19:15 AM(UTC)  | Reason: Not specified

Offline SkyMix_RMT  
#4 Posted : Wednesday, June 3, 2020 4:26:16 AM(UTC)
SkyMix_RMT
Major
Joined: 2/21/2015(UTC)
Posts: 386
Portugal

Thanks: 80 times
Was thanked: 132 time(s) in 96 post(s)
Actually, I made a mistake, ignore my last post.

The problem is that you enable script "Hospital Assault Team Destroyed" using the subroutine script "Hospital Assault Team Attack", which is activated everytime the team is created (On create), and On All clear. I think the condition "Team ___ is destroyed" does not reset if you spawn it, so the team only needs to be destroyed once for the condition to be met, which means that
Hospital Assault Team Destroyed will remain active.

You should create a new script that checks if team exists, and if false spawn it. Make it active and evaluate every 1 sec with Deactivate upon success unticked.
Check out:

My Music (Techno/House/Experimental)

My Website (GeneralsCentral)

My Youtube Channel (Inactive)

World Builder Community Discord
thanks 1 user thanked SkyMix_RMT for this useful post.
Babasparks on 6/3/2020(UTC)
Offline Babasparks  
#5 Posted : Wednesday, June 3, 2020 4:39:47 AM(UTC)
Babasparks
Private
Joined: 6/23/2012(UTC)
Posts: 6

Thanks: 6 times
Originally Posted by: SkyMix_RMT Go to Quoted Post
Actually, I made a mistake, ignore my last post.

The problem is that you enable script "Hospital Assault Team Destroyed" using the subroutine script "Hospital Assault Team Attack", which is activated everytime the team is created (On create), and On All clear. I think the condition "Team ___ is destroyed" does not reset if you spawn it, so the team only needs to be destroyed once for the condition to be met, which means that
Hospital Assault Team Destroyed will remain active.

You should create a new script that checks if team exists, and if false spawn it. Make it active and evaluate every 1 sec with Deactivate upon success unticked.


Okay awesome buddy, thanks for the help! I will get on it later today and let you know what comes of it :D

PS Nice website ;)

Update - So I tried adding the script you told me and removed the destroyed script and the other option that enabled the script. Now it just spams them in multiples lol :P

How would you lay out the script/Scripts if you were doing this?

Edited by user Wednesday, June 3, 2020 5:16:54 AM(UTC)  | Reason: Not specified

Offline Babasparks  
#6 Posted : Wednesday, June 3, 2020 6:48:57 AM(UTC)
Babasparks
Private
Joined: 6/23/2012(UTC)
Posts: 6

Thanks: 6 times
Hey, so I managed to get it right. 2 Battlemasters spawn, attack, die and respawn then attack no problem. Works with vehicles really well.

But for some reason, Guards and Helixes keep doubling regardless. I tested this out on a TEST map. Tanks cool, Guards no. Not sure why :/

Added this script set to my current mission I am working on. The team spawned but didn't work until I killed it once. Weird :/

Edited by user Wednesday, June 3, 2020 8:54:01 AM(UTC)  | Reason: Not specified

Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.