Jump to content
Sign in to follow this  
johnnylump

For the gurus

Recommended Posts

Is there a scripting command that does the same thing as a switch trigger? Comref doesn't seem to have anything, but on a prayer I thought I'd try here ... or perhaps someone has a workaround.

Something like this:

Group SwitchWP WPNum

e.g. SquadOne SwitchWP 8

So if the group SquadOne was moving toward waypoint #2; this would jump it to #8.

In the mission I'm working on (which simulates a company-level command), I've got several groups each with an idenitical set of waypoints.

Using pre-defined radio commands, the player selects a group and gives a command, which switches it to the appropriate set of waypoints. Right now, each group gets its own set of switch triggers, which is cumbersome to place.

With the kind of command I'm talking about, a single dynamic command could replace all the static triggers.

i.e. CurrentSquad SwitchWP 3

(The other idea: Is there a way to change a switch trigger's waypoint synchronizations on the fly? That's really blue-sky, I know)

Share this post


Link to post
Share on other sites

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">SquadOne doMove getWPPos [group SquadOne, 8]

Maybe this?

Doolittle

Share this post


Link to post
Share on other sites

Many thanks for reply. But I believe that would only the move the group to the position of the 8th waypoint.

I would like to actually switch to that waypoint number in its waypoint cycle and execute all the waypoints after it.

Say the 9th waypoint is a "GET IN" waypoint, and I want the group to, say, skip the rest of its patrol and get in its truck and drive somewhere. This is what I'd use a switch trigger for, but I'm looking for a way to have a single command that could affect a group that is a variable.

Share this post


Link to post
Share on other sites

Keep using a switch trigger, as i don't think there's a way

of scripting to do this.

Just use a boolean condition for the switch trigger like: gogo

and in the script, where you want to switch, say: gogo = true

As long as you're using ingame waypoints, you also need to

use ingame triggers for that.

If you'd like to do it in a combined way with waypoints and

scripts, then i'd suggest you to use the waypoint type: SCRIPTED.

Waypoint type scripted can be used to start a script by entering only the scriptname into the scripted field (the box at

the bottom of the wayoint's menu).

The following parameters will be automatically passed to the

script: [group (owner of waypoint),position (coordinates),target (object where the waypoint is placed onto)]

can be shown in the script by:

hint format ["%1",_this]

If the group reaches the waypoint before the waypoint type:

scripted, the script starts and the group will wait at the waypoint before the scripted waypoint. When the script is

finished, the units will move to the waypoint after the waypoint type scripted.

e.g:

waypoint 1: move

waypoint 2: scripted

scripted: scriptname.sqs

waypoint 3: move

What happens?

group moves to waypoint 1

script starts/group stays at waypoint 1

script ends

group starts moving to waypoint 3

Now if you use any move script for the units, they will do

all what you tell them to do without moving to waypoint 3,

until the script ends.

You can use the domove command to let them move to

individual positions, and you can end the script at a certain

time to let them move on to wp 3.

hope this helps

~S~ CD

Share this post


Link to post
Share on other sites

Hi johnnylump

It sounds like your trying to command groups.

In which case use Spinor's Command Engine (click my sig) it icludes all your requirements

Another alternative is to just have 1 of your WPs for each group and then alter possition and state of the WP and set it next WP each time.

I use the above but with many WPs to give dynamic enemy strategy in BS06 (There is an editable version at the CoC) but it is a more compex version of what I just said.

Kind Regards walker

Share this post


Link to post
Share on other sites

DV Chris Death -- Thanks, I'd always wondered how that WP type worked.

Walker -- You got it. And thanks for the reference to the command engine; I'm familiar with it. Quite an accomplishment, must deeper than what I've been able to do, that's for sure. I'm just the do-it-yourself type. smile_o.gif

Cheers,

John L

Share this post


Link to post
Share on other sites
Quote[/b] ]Wait, you can move waypoints around???

Setwppos is the key wink_o.gif

You'll find it in the comref easier explained than drop-stuff biggrin_o.gif

~S~ CD

Share this post


Link to post
Share on other sites
Wait, you can move waypoints around???

Hi Dolittle

As I said I use it in BS06. biggrin_o.gif

I use it there to setpos to getposed gamelogics; saves having to put the position in by hand and easily adjustable to fine tune enemy strategies.

We hope to use something like it with our AI for the enemy strategy.

We need to train to envelop, use artilery when enemy is fixed in position (surrounded or defending an objective), concentrate and punch through a defensive line etc. This might have to be an expert system over the top of a neural net.

You can of course alter WP values such as speed and agression as well.

Kind Regards Walker

Share this post


Link to post
Share on other sites

Sorry, for mine English.

I have found out that at start script from WP Scripted

automatically passed fourth parameter. A type number.

But I can not understand that it is number. Script

gives out 0.For example start script.sqs from

script field WP type:scripted

_group = _this select 0

_pos = _this select 1

_target = _this select 2

_arg = _this select 3

hint format["%1",_this]

What that is parameter?

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×