:: Home :: Get Hosted :: PPM FAQ :: Forum FAQ :: Search :: Memberlist :: Usergroups :: Register :: Profile :: Log in to check your private messages :: Log in ::
Do you want to advertise at Project Perfect Mod. Find out how to do it HERE.

The time now is Tue May 23, 2017 11:21 am
All times are UTC + 0
 Forum index » Modding Central » Tiberian Sun Editing Forum » Mapping Discussion
Abort Move to Waypoint
Moderators: Global Moderators, Tiberian Sun Moderators
Post new topic   Reply to topic Page 1 of 1 [11 Posts] View previous topic :: View next topic
Author Message
Lin Kuei Ominae
Seth


Joined: 16 Aug 2006
Location: Germany

PostPosted: Wed Oct 07, 2015 7:39 am    Post subject:   Abort Move to Waypoint Reply with quote

I have a unit and give it a simple Move to Waypoint script.
Lets assume the waypoint is far away across the map.
Is there any chance to make the unit stop via a trigger while it is on its way to the waypoint?

e.g.
An attack team is send towards the enemy, but when a certain building is attacked, the attack team should abort the mission (cancel the script) and immediately follows a new script, like move to and protect the attacked building.

In my test i created a map with 4 waypoints and 4 scripts, each script having only the single line Move to Waypoint, to one of the 4 waypoints.

4 looping trigger fire randomly after a few seconds, with Create Team action.

It works that the unit is accepting the new orders, but only when it reached the waypoints.
The unit is not aborting the current move. It always finishes moving to the waypoint and then moving to the next one.
Since the trigger fire faster than the unit can move to a waypoint, the unit is taking all the script actions like a waypoint path, moving them one after another.

\Edit
i gave each script the action Flash as the first line (Move to Waypoint is second action), to see when the unit accepts the Create Team action from the random firing triggers.
The unit flashes only when it reached the waypoints. It does not flash while on its way to them, even if the trigger are constantly firing.

Is there a way to set the TeamType or Script something like
StopCommandsWhenNewOrderIsGiven=yes
MovePriority=low
_________________
SHP Artist of Twisted Insurrection. Main Nod building SHP creator.

Public SHPs
X-Mech Calendar (28 Mechs for GDI and Nod)
5 GDI, 5 Nod, 1 Mutant unit, 1 Scrin unit, 1 GDI building

Tools
TMP Shop
C&C Executable Modifier

Last edited by Lin Kuei Ominae on Wed Oct 07, 2015 7:52 am; edited 1 time in total

Back to top
View user's profile Send private message
RP
Commander


Joined: 12 Jul 2012
Location: Mapping God Heaven

PostPosted: Wed Oct 07, 2015 7:42 am    Post subject: Reply with quote

IIRC AreTeamMembersRecruitable should be on, so that it can be 'stolen' from an existing TeamType and recruited into a new TeamType (to go to that building).
_________________


Mental Omega 3.0 Mission creator - Creator of FinalOmega: APYR 3.0 Map Editor

/ppm/'s stupidity

Back to top
View user's profile Send private message
Lin Kuei Ominae
Seth


Joined: 16 Aug 2006
Location: Germany

PostPosted: Wed Oct 07, 2015 7:54 am    Post subject: Reply with quote

I have AreTeamMembersRecruitable=yes set on each TeamType.
Yet it only follows the new script command after it has finished the last one. If the last order is something like a waypoint that can't be reached, it can never be recruited again anymore.
_________________
SHP Artist of Twisted Insurrection. Main Nod building SHP creator.

Public SHPs
X-Mech Calendar (28 Mechs for GDI and Nod)
5 GDI, 5 Nod, 1 Mutant unit, 1 Scrin unit, 1 GDI building

Tools
TMP Shop
C&C Executable Modifier

Back to top
View user's profile Send private message
RP
Commander


Joined: 12 Jul 2012
Location: Mapping God Heaven

PostPosted: Wed Oct 07, 2015 9:00 am    Post subject: Reply with quote

That's odd. Is Recruiter on as well?
Well, I assume you played around with the tags already.

It's odd, because I remember I did see something like that.
There is this TS mission where you had to deploy artillery or something at drop zone flares.
If the artillery came close to a WP, it would automatically move towards the WP and deploy.
image
_________________


Mental Omega 3.0 Mission creator - Creator of FinalOmega: APYR 3.0 Map Editor

/ppm/'s stupidity

Back to top
View user's profile Send private message
Agent Z
Rocket Cyborg


Joined: 05 Sep 2013
Location: ERROR 404: Location not found!

PostPosted: Wed Oct 07, 2015 9:47 am    Post subject: Reply with quote

RP wrote:

It's odd, because I remember I did see something like that.
There is this TS mission where you had to deploy artillery or something at drop zone flares.
If the artillery came close to a WP, it would automatically move towards the WP and deploy.
image

That is a different case, as move/attack orders given by the player can always be terminated when the units get picked up to a new team and given script orders. EDIT: (See first stage of 1st Soviet mission in YR.)

LKO did you try with more than one waypoint in the script, like if it moves from A to B and then to C? Would it then flash after it gets to C, or would it flash when it gets to B?
Quote:
If the last order is something like a waypoint that can't be reached, it can never be recruited again anymore.

Wouldn't that cause alot of lag, since it then would have to constantly attempt to move to the waypoint to not get recruited? I thought it would just terminate the move order and stay inactive until some new order is given.

Last edited by Agent Z on Wed Oct 07, 2015 9:57 am; edited 1 time in total

Back to top
View user's profile Send private message
Lin Kuei Ominae
Seth


Joined: 16 Aug 2006
Location: Germany

PostPosted: Wed Oct 07, 2015 9:52 am    Post subject: Reply with quote

RP wrote:
That's odd. Is Recruiter on as well?
Well, I assume you played around with the tags already.

It's odd, because I remember I did see something like that.
There is this TS mission where you had to deploy artillery or something at drop zone flares.
If the artillery came close to a WP, it would automatically move towards the WP and deploy.
image

Recruiter was off. But even after enabling it now, it made no difference. The unit was still moving to the waypoint and not accepting any new orders while on its way there.

ah, yes that late Nod mission with the 3 ICBMs to take down the Philadelphia.
I'll check that one.


Agent Z wrote:
LKO did you try with more than one waypoint in the script, like if it moves from A to B and then to C? Would it then flash after it gets to C, or would it flash when it gets to B?

just tested it and same effect. It first finishes moving to the 3rd waypoint before it accepts any new order.

I also tried a looping trigger that fires very quick with a Delete Team action, but it wasn't able to stop the unit while on its way. It fired like 5 times during the move from A to B and also other Create Team trigger fired with different move orders.

Agent Z wrote:
Quote:
If the last order is something like a waypoint that can't be reached, it can never be recruited again anymore.

Wouldn't that cause alot of lag, since it then would have to constantly attempt to move to the waypoint to not get recruited? I thought it would just terminate the move order and stay inactive until some new order is given.

It was an example. Not sure how the unit reacts on unreachable waypoints. Though seeing 2 harvester getting stuck on a bridge and constantly trying to get past each other, makes me assume it can try to move to the waypoint for ever.

\Edit
just tested an unreachable waypoint, it completely prevents any new script order.
Then unit reached the last waypoint and then just stood there, since there was no path to the new unreachable waypoint. After that it never accepted any new script orders and all the Create Team Actions from the constantly firing trigger were unable to select the unit again.
_________________
SHP Artist of Twisted Insurrection. Main Nod building SHP creator.

Public SHPs
X-Mech Calendar (28 Mechs for GDI and Nod)
5 GDI, 5 Nod, 1 Mutant unit, 1 Scrin unit, 1 GDI building

Tools
TMP Shop
C&C Executable Modifier

Last edited by Lin Kuei Ominae on Wed Oct 07, 2015 10:08 am; edited 1 time in total

Back to top
View user's profile Send private message
E1 Elite
Cyborg Informer


Joined: 28 May 2013

PostPosted: Wed Oct 07, 2015 10:01 am    Post subject: Reply with quote

Have you given lower Priority= for the first team than the 2nd team? Equal or higher value in the 1st team
won't allow recruitment until the team finishes its scripts.

First teamtype should have lower Priority= than the 2nd team, so that the 2nd team can recruit from the 1st
team which hasn't completed its scripts. Typically in TS, AI ini uses even numbers (like 4, 8, 12) and odd
numbers in SP maps (like 5, 7, 9). If these are the only teams involved in recruitment you can give a higher
value so that other teams do not interfere like 1st teamtype Priority=15 and 2nd teamtype Priority=17.

If there are more such cases, then these set of teams can be further isolated with Group= numbers with
Recruiter=no. Like 1st and 2nd team having Group=-3, 3rd and 4th team having Group=-4 etc. Recruiter=no
is used to disallow intergroup recruitment except for Group=-2 cases.

AreTeamMembersRecruitable=yes is needed for the first teamtype which provides the team members for
recruitment. No problem if it is in both teamtypes.

Don't know what happens on stuck units, but move to WP shouldn't be different than other attack or move
commands.

Back to top
View user's profile Send private message
Agent Z
Rocket Cyborg


Joined: 05 Sep 2013
Location: ERROR 404: Location not found!

PostPosted: Wed Oct 07, 2015 10:09 am    Post subject: Reply with quote

Also from what I know, it takes several move orders by the player to stop units from executing script orders (The transport in 1st Soviet mission in YR is an example).
Maybe they will stop if you spam other scripts/orders quickly to the team (more than 5 in a second or something)?

Quote:
Though seeing 2 harvester getting stuck on a bridge and constantly trying to get past each other, makes me assume it can try to move to the waypoint for ever.

That is a different case again, as the harvesters "know" that the path isn't really blocked, and they both try to make the other one move out of the way. If one stood still, it could have let the other one pass but since they both try to move they can never get anywhere. If an unit encounters a cliff for example, it "knows" that it is impassable, and won't attempt even to move over it (Atleast under the players command).

Last edited by Agent Z on Wed Oct 07, 2015 10:14 am; edited 1 time in total

Back to top
View user's profile Send private message
Lin Kuei Ominae
Seth


Joined: 16 Aug 2006
Location: Germany

PostPosted: Wed Oct 07, 2015 10:13 am    Post subject: Reply with quote

E1 Elite wrote:
Have you given lower Priority= for the first team than the 2nd team?

yes, tried that too.
TeamType with Script Move to Waypoint 99 had Priority=0
During the move several trigger fired with Move to Waypoint 90 with Priority=5. But they never took control of the unit until it reached Waypoint 99.

I have only this one single unit, so Group is not necessary. Though i could try it anyway.
Maybe the game can't "select" the unit when it's not close to one of the waypoints in the script.

\Edit
Using Group=1 on all TeamTypes, no success. Same behaviour.

Agent Z wrote:
Maybe they will stop if you spam other scripts/orders to the team?

the Create Team triggers to give it a new order are constantly firing. They have a text message so i see when they fire and there are like 10-20 firing while the unit is on its way to the waypoint.



\Edit
hah, seems i made a mistake in my previous Priority test.
now got the unit accept a new order while on its move. Smile
I have now Priority=0 on all the move commands and Priority=5 on a stop command. Looks funny how the unit now constantly changes direction due to the random firing move and stop trigger.

Thank you all for the help.
_________________
SHP Artist of Twisted Insurrection. Main Nod building SHP creator.

Public SHPs
X-Mech Calendar (28 Mechs for GDI and Nod)
5 GDI, 5 Nod, 1 Mutant unit, 1 Scrin unit, 1 GDI building

Tools
TMP Shop
C&C Executable Modifier

Back to top
View user's profile Send private message
Lin Kuei Ominae
Seth


Joined: 16 Aug 2006
Location: Germany

PostPosted: Wed Oct 07, 2015 1:00 pm    Post subject: Reply with quote

After some more tests there is still the waypoint issue.


If Trigger A has
Move to waypoint 99
Move to waypoint 98
Move to waypoint 97

and Trigger B gives a new order while the unit moves to 99,
the unit will skip moving to 98 and 97, but it won't start with the new script until it reached 99.

It seems the game aborts the last script but still keeps the last "move to waypoint" command in the command queue and just appends the new script command after this.


What i tried
Trigger B gives in the Script only
Flash
The unit will just stop and flash. (very close to what i want)
However the next time a Move command is given, it will still move to the previous given waypoint first, before going to the new waypoint.

Do This... Stop
The unit will stop and never be recruited again anymore

Flash
Move to Waypoint B
The unit will flash but continue moving to the last given waypoint, then go to the new waypoint B from this script



\Edit
Apparently this is only true for AircraftTypes. I was testing an aircraft, since this can move everywhere.
VehicleTypes can successfully stop and immediately take the new waypoint, ignoring the last waypoint.
_________________
SHP Artist of Twisted Insurrection. Main Nod building SHP creator.

Public SHPs
X-Mech Calendar (28 Mechs for GDI and Nod)
5 GDI, 5 Nod, 1 Mutant unit, 1 Scrin unit, 1 GDI building

Tools
TMP Shop
C&C Executable Modifier

Back to top
View user's profile Send private message
E1 Elite
Cyborg Informer


Joined: 28 May 2013

PostPosted: Fri Oct 09, 2015 12:29 pm    Post subject: Reply with quote

Tried with multiple infantry team in skirmish. Saw all the 3 possibilities when getting recruited
- moving to the last waypoint before moving to new waypoint
- stop midway and move to new waypoint
- go back to base and get assembled into new team and then move to new waypoint

It is not getting recruited into new teams if the last script is a move to waypoint in the old team and the first
script on the new team is something like guard for a limited time, may be Do this ... stop also etc.. This started
working if the move to waypoint is followed by guard for limited time instruction like

[Script_A]
0=3,20
1=5,1
2=3,21
3=5,1
4=3,22
5=5,200

[Script_B]
0=5,1
1=3,23

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [11 Posts] View previous topic :: View next topic
 Forum index » Modding Central » Tiberian Sun Editing Forum » Mapping Discussion
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © phpBB Group

Wildcard SSL Certificates
[ Time: 0.3351s ][ Queries: 11 (0.0110s) ][ Debug on ]