OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: 456820 on 09 May 2005, 20:06:23

Title: Why does this script not work
Post by: 456820 on 09 May 2005, 20:06:23
Code: [Select]
#repeat
~2
gl1 setpos getpos player
grp4 domove gl1
~30
grp3 domove gl1
goto "repeat"

Thast my simple script its meant to move a game logic called gl1 over the plyer in a 30 second delay loop just one thing it doesnt seem to work is it beacuse of the way i have used the domove command.
obdviously grp4 and grp3 are a group name using grp3 = group this and so forth for grp4.

Anyway anyideas would be nice

Plus i have thought of the best way to make LST a good boat and a usefull one i havent heard anyone say it.
To make it move easily use setveocity and do move commands
and to make it fire just use
Code: [Select]
This addweapon "shell125"; this addmagazine "shell125in the lst init fied to give it a shell125 and ammo
then to make it firs use dotarget and do fire commands
Would that work if so HOORAY ive made the LST good plus you can also add other weapons to it like vulcan cannons and LGB
Title: Re:Why does this script not work
Post by: The-Architect on 09 May 2005, 20:11:06
Try

"_x domove (getpos _gl1)" foreach units _group4

Maybe it will work, maybe not.  ???
Title: Re:Why does this script not work
Post by: 456820 on 09 May 2005, 20:12:33
thanks for the quick reply i shall try because this is a very importans script for a sniper mission im trying to make enemy's hunt for the sniper
Title: Re:Why does this script not work
Post by: dmakatra on 09 May 2005, 20:18:51
#repeat
~2
gl1 setpos getpos player
(leader grp4) move getpos gl1
~30
(leader grp3) move getpos gl1
goto "repeat"

Try that.

:beat: *Gets Shot* :beat:
Title: Re:Why does this script not work
Post by: macguba on 09 May 2005, 21:21:00
You've solved it twice Armsty, which sort of puts us back where we were before. ;D

move for groups
doMove for individuals
Title: Re:Why does this script not work
Post by: dmakatra on 09 May 2005, 21:47:20
I did something good? Horray for me! ;D

:beat: *Gets Shot* :beat:
Title: Re:Why does this script not work
Post by: Chris Death on 10 May 2005, 04:41:34
Just one thingy here;

Why using unnecessary resources?

Think about, if you really need that gamelogic here.

Code: [Select]
#repeat
~2
(leader grp4) move getpos player
~30
(leader grp3) move getpos player
goto "repeat"

~S~ CD
Title: Re:Why does this script not work
Post by: 456820 on 10 May 2005, 07:58:26
clever never thought of that plus it would probaly be less lagy that way but also wouldnt that make them follow the player all the time i want the game logic refreshed on the player every so often so theynver know ecactly where the player is
Title: Re:Why does this script not work
Post by: Chris Death on 10 May 2005, 21:59:42
About the lag - at this stage there won't be any noticeable
difference yet, but as we all know:

ppl tend to use already existing work instead of creating
everything from scratch again, so that in case of more complexity there will be off course at one point some performance difference - one day.

Also as OFP is limited in usage of groups or units, it's always
wise to reduce things to a minimum of resources, as every
gamelogic you can save here - will be one more free gamelogic
to be used there.

About them to follow the player all the time:

Nope - it will do exactly the same as when using the gamelogic,
as you only send them to the actual position of the player (or
in previous case the gamelogic) ... and nothing more.

:note - the loop's interval of 30 seconds has not been changed

~S~ CD