OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Blanco on 11 Apr 2005, 09:58:20
-
Hello,
I've been experimenting with the scripted waypoint type and I think I've found a bug when you use it with a savegame.
Scripted waypoints are fun to use and quite handy stuff.
When you run a script in the scriptbox of a scripted waypoint the group will stop until the script exit. Then the group will move to it's next waypoint.
Usefull for those damn choppers who don't want to wait before everybody got in. ;)
But it seems that a savegame exit the script too. :'(
_veh = _this select 0
_grp = mygrp
_units = units _grp
"Unassignvehicle _x" foreach _units
@"vehicle _x == _x" count _units == 0
hint "DEBUG : Group is out"
@!alive AT2 OR "alive _x" count _units <= 4 OR objective2
hint "M113 moves in for objective2"
exit
The script exit when...
when AT2, (an enemy ATsoldier) dies
OR
when the town is completely cleared : objective2 is true
OR
when I have only 4 or less men left.
When I save and load while the script is waiting on that second @ condition line, the M113 moves immediatelly to his next waypoint.
How can I solve this?
I read on the forum that I have to use the reserved variable time or _time... but I have no idea what I have to change in the script to solve this.
It would be nice if somebody could give me an example... :-\
PS : Mission is SP
-
Does the last hint show up, or does the script just exit??
Because if the hint doesn't show, then there's not much you can add into the script...
-
The hint shows up.
*edit*
Here's a smal mission to show you what I mean.
http://users.telenet.be/blanco/Scripts/another%20savegamebug.eden.zip
I can do the same thing with triggers & syncronising, but imo it a lot easier with scripted waypoints.
I have a lot of these insertion - extraction events in my mission and then I run into this sh*t :'(
-
Actually, the last hint does not show... ::)
It's just on the screen because it was shown earlier before the savegame was loaded...
So, it seems that OFP savegame completely fails to save the script that is executed by scripted wp...
It's a wonder it saves anything at all...
This means that you need some other method to control the M113...
Try executing an other script from the scripted wp script (but this won't probably work), or just simply use a trigger to control the M113...
I really don't see why it has to be scripted in the first place... ::)
-
Actually, the last hint does not show...
Ah, ok. I thought you were talking... before the reload
I really don't see why it has to be scripted in the first place...
True in this situation, but in the full mission the conditions and situations are more complex and different then this.
It worked perfect with the scripted waypoints... until you save.
The same can be done with a lot of triggers, but I don't feel stimulated anymore to restart the mission that way.
Anyway, the lesson for today :
SCRIPTED WAYPOINTS ARE USELESS
Btw, the same thing happens with the animate command.
Use animate to close a door, save and reload and the door will be open again. So when that closed door is crucial for your mission , forget about it. Save the game and everything is fucked up.
Pffff, time for a OFP break. >:(
-
Yup, and same goes for setObjectTexture...
Maybe you could make a global monitor script, and all vehicles would be controlled via global variables so in that monitor script you could make time against _time comparisons and maybe so gain a bit control over the vehicles... or sumtin...
However, exploiting the savegame time bug you can keep the opened door open and setObjectTextured texture where they are supposed to be...
-
Well, that is annoying.
Never tried using a scripted waypoint, and never will now. Thanks for the heads up :)
-
I heard the "setface" command resets after loading as well...
Thanks for the headsup on those other bugged commands too. I'll steer clear of those from now on...
-
So are we saying that a script called from a scripted waypoint cannot cope with a save/load, but a script called by any other means can cope? That is very strange.
The animate bug is true, I've experienced that. Never noticed the setFace one though.
-
So are we saying that a script called from a scripted waypoint cannot cope with a save/load...
Yes and had to find it the hard way, my mission was 90% finished :'(
but a script called by any other means can cope?
I hope so.
:gunman: SCRIPTED WAYP:noo:INTS
Maybe we can start a sticky thread about bugged commands?
-
So are we saying that a script called from a scripted waypoint cannot cope with a save/load, but a script called by any other means can cope? That is very strange.
Like said, seems to be so...
It may be because the scripted waypoint calls the script differently than the [] exec "script.sqs"..
Dunno how OFP is actually written, but the scripted waypoint uses some eventhandler or something to call the script and maybe they just failed to implement few lines in the savegame handler that would also remember to check and save possible scripted waypoint...
I heard the "setface" command resets after loading as well...
The setFlagTexture is then the only texture related function that is actually saved.... ::)
-
Maybe we can start a sticky thread about bugged commands?
I would suggest starting a thread to help gather the information. Ask the mods to make a temporary sticky and let it run for a couple of weeks. After that collate the information, turn it into a tutorial and let the thread float.
Remember that one of the principles of ofpec's structure is that information is stored in the Ed Depot, not the forums.
-
Not sure, but can't you solve the setface thingy when you define a face via setidentity?
-
Yes I believe so. Check it though.
-
Anyway, the lesson for today :
SCRIPTED WAYPOINTS ARE USELESS
....if it belongs to singleplayer missions
For multiplayer missions where usually save-game
ain't got used it's still very very useful. ;)
As i've always been working on maps for multiplayer usage,
i'm sorry that i never encountered the save-game bug
for scripted waypoints, at that time when i wrote my
tutorial thread about scripted WP here on OFPEC :(
anywayz good find Blanco ;)
~S~ CD