Home   Help Search Login Register  

Author Topic: Scripted waypoints and savegame  (Read 1146 times)

0 Members and 1 Guest are viewing this topic.

Offline Blanco

  • Former Staff
  • ****
Scripted waypoints and savegame
« 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.  :'(

Code: [Select]
_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






 



« Last Edit: 11 Apr 2005, 10:01:09 by Blanco »
Search or search or search before you ask.

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Scripted waypoints and savegame
« Reply #1 on: 11 Apr 2005, 13:00:02 »
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...
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Blanco

  • Former Staff
  • ****
Re:Scripted waypoints and savegame
« Reply #2 on: 11 Apr 2005, 13:11:42 »
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  :'(
« Last Edit: 11 Apr 2005, 13:44:05 by Blanco »
Search or search or search before you ask.

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Scripted waypoints and savegame
« Reply #3 on: 11 Apr 2005, 14:51:43 »
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... ::)
« Last Edit: 11 Apr 2005, 14:52:11 by HateR_Kint »
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Blanco

  • Former Staff
  • ****
Re:Scripted waypoints and savegame
« Reply #4 on: 11 Apr 2005, 19:55:54 »
Quote
Actually, the last hint does not show...
Ah, ok. I thought you were talking... before the reload

Quote
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.  >:(


« Last Edit: 11 Apr 2005, 23:05:22 by Blanco »
Search or search or search before you ask.

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Scripted waypoints and savegame
« Reply #5 on: 11 Apr 2005, 21:52:01 »
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...
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Fragorl

  • Coding Team
  • Former Staff
  • ****
Re:Scripted waypoints and savegame
« Reply #6 on: 12 Apr 2005, 00:34:17 »
Well, that is annoying.

Never tried using a scripted waypoint, and never will now. Thanks for the heads up :)

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:Scripted waypoints and savegame
« Reply #7 on: 12 Apr 2005, 21:55:38 »
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...
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Scripted waypoints and savegame
« Reply #8 on: 12 Apr 2005, 22:49:16 »
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.
Plenty of reviewed ArmA missions for you to play

Offline Blanco

  • Former Staff
  • ****
Re:Scripted waypoints and savegame
« Reply #9 on: 13 Apr 2005, 03:03:55 »
Quote
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  :'(

Quote
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?


« Last Edit: 13 Apr 2005, 09:45:59 by Blanco »
Search or search or search before you ask.

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Scripted waypoints and savegame
« Reply #10 on: 13 Apr 2005, 09:23:18 »
Quote
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...

Quote
I heard the "setface" command resets after loading as well...
The setFlagTexture is then the only texture related function that is actually saved.... ::)
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Scripted waypoints and savegame
« Reply #11 on: 13 Apr 2005, 11:12:27 »
Quote
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.
Plenty of reviewed ArmA missions for you to play

Offline Blanco

  • Former Staff
  • ****
Re:Scripted waypoints and savegame
« Reply #12 on: 23 Apr 2005, 11:07:09 »
Not sure, but can't you solve the setface thingy when you define a face via setidentity?

Search or search or search before you ask.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Scripted waypoints and savegame
« Reply #13 on: 23 Apr 2005, 11:24:33 »
Yes I believe so.    Check it though.
Plenty of reviewed ArmA missions for you to play

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:Scripted waypoints and savegame
« Reply #14 on: 26 Apr 2005, 21:49:09 »
Quote
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
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted