Jump to content
Sign in to follow this  
crashdome

Savestatus and saveidentity

Recommended Posts

I've used them in a test mission and opened the object.sav file in notepad, but I'm not clear on all the info.

sad.gif

Anybody toy around with these? I notice it works in MP and saves the files to a tmp directory. I was hoping it would save # of kills and score, but it doesn't appear to. It would have been nice for a tournament type situation or if a group of guys wanted to track their kills over a group of missions. Anyways, just looking to see if anyone went deeper into it than I did.

Share this post


Link to post
Share on other sites

Ok after pulling some stuff apart I got this:

saveidentity saves:

Info

Name

Experience

Rank

Face

Glasses

Speaker

Pitch

Savestatus saves:

Type (e.g. SoldierWB)

3d shape

Health

Weapons

Ammo

# of Magazine Slots (because snipers and such get less I assume also vehicles carry cargo)

And if a server(no clients) saves the file (object.sav) it will be placed in the User\Name\Saved\Tmp directory. Because of this, every MP mission hosted on that server can use that file to reference information. Imagine saving a status of a player with lots of heavy weaponry and calling it "Lotsoguns" then a trigger is tripped and that player loads that status and has instantly acquired all that weaponry. OR saving the identity of a BlackOp as "Ninja" and another trigger is tripped and Joe Blows soldier's 3d shape is transformed into a BlackOp....

very interesting....

I see potential cheating in this also, unfortunately. (on the server's end anyway)

Has NO ONE else touched these commands? I can't find ANYTHING in the search engine.

EDIT: I must mention I haven't tested the shape-changing ability yet and, if someone dies (AI or a Player) loadstatus will not bring them back from the dead but it can heal a wounded soldier (it appears).

Share this post


Link to post
Share on other sites

OK.... more testing done...

Sadly, 3d Model did not change when loaded... but identity, face, and weapons did load. Oddly, in MP I loaded an identity different than I started with and it added the name into the kill list.

Crashdome = 1 kill

loaded new identity of Bobby Brunning

Crashdome = 1 kill

Bobby Brunning = 2 kills (after killing 2 more guys)

Not that this is useful, but shows there are potential problems when using these in MP.

Share this post


Link to post
Share on other sites

Hi,

I try the command savestatus in the editor but not work for me. Could you explain step by step?

I want use this for store values of variables and arrays, do you think possible?

Bye

Share this post


Link to post
Share on other sites

Savestatus only saves unit information (see above)

When you save the status (or identity) of a unit you give it a name (e.g. "Myguy" in: Player savestatus "Myguy") you can then call that saved information into a unit again at anytime.

For example:

Let's say I have an enemy officer named "Bob". Then lets say I save his status (Name,Weapons,Ammo, etc..) into "EnemyOfficer" (e.g Bob savestatus "EnemyOfficer"). Now let's say that half way through the mission he dies and I want to spawn a CLONE of him. I could use the createunit command to create another officer named NewUnit and then use the line: NewUnit loadstatus "EnemyOfficer" and then NewUnit will be changed to Bob with all of Bob's original weapons and ammo etc...

You cannot use this for variables and arrays. For that use SaveVar (for Single Player Campaign only) You cannot save variables from mission to mission in MP (that I am aware of)

Share this post


Link to post
Share on other sites

You figured out how to get OFP to remember salvaged vehicles from one mission to the next?

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Shadow @ July 31 2002,21:34)</td></tr><tr><td id="QUOTE">You figured out how to get OFP to remember salvaged vehicles from one mission to the next?<span id='postcolor'>

Not tested, but try something like this in exit.sqs

say a vehicle, a m60 tank, able to be salvaged from a misison is named tank1, and player is named aP then in exit.sqs:

? tank1 distance aP < 50 and damage tank1 > .5: tank1 savestatus "tank1status"; keeptank1=1; saveVar "keeptank1"

? tank1 distance aP > 50 or damage tank1 < .5: tank1 savestatus "tank1status"; keeptank1=0; saveVar "keeptank1"

(that would mean if tank1 is within 50 meters of the player and over 50% armour at the end of the mission, it is considered salvaged)

then in init.sqs of following mission (would need a marker called "insertion") :

? keeptank1==1 : tank1 = "m60" createVehicle getmarkerpos "insertion"; tank1 loadstatus "tank1status"; tank1 setpos [(getpos aP select 0) + 5, (getpos this select 1) +5, .5]

Share this post


Link to post
Share on other sites

Another way:

Create a trigger around the target zone and name it Salvage. Set it to ANYBODY and put nothing in any of the other fields.

In the exit.sqs put something like this for each vehicle type:

NumTanks="Tank" counttype list salvage

SaveVar "NumTanks"

then in the init.sqs of the next mission:

_loop=0

#putM1A1s

_loop=_loop+1

"M1A1" createvehicle getmarkerpos "insertion"

?(_loop=numoftanks):goto "continue"

goto "putM1A1s"

#continue

\\\rest of script

This will make them full health of course, but you get the idea.

Naqual's script is good by all means, especially if you want to keep them damaged, but you have to write a line for every vehicle in the mission instead of every type of vehicle.

Also, if you incorporate savestatus into my script idea, you can salvage ammocrates with their correct amount of weapons and everything. On top of that, you can save the script and use it with every mission without changing anything.

I won't go into how to incorporate savestatus into that here (too long), but if I ever write that script out before someone else does, I will upload to OFPEditingCenter.

EDIT: (Works for Single Player Campaigns only)

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE">Create a trigger around the target zone and name it Salvage. Set it to ANYBODY and put nothing in any of the other fields.

In the exit.sqs put something like this for each vehicle type:

NumTanks="Tank" counttype list salvage

SaveVar "NumTanks"

<span id='postcolor'>

I understand the rest of the part dealing with init.sqs but this with the empty trigger I dont get and the part "put something like this for each vehicle type". How many types of vehicles are they and what are their names?

I've never "counted" anything in OFP. That line you wrote about "counttype list salvage", does that mean that any object inside the salvage-trigger is counted?

Share this post


Link to post
Share on other sites

Well...

The trigger will contain a list of all units (tanks, ammo, people, etc...) within it's radius. What the counttype will do is count how many tanks (or whatever you want) is in that list.

For example, I might put a trigger around the extraction zone and everything I drive or carry to the extraction zone I can count. Once I know how many "Tanks" or other things there are, I can save variables to the next mission that know how many I drove to the extraction zone.

If you download the comref, I believe the list of vehicle types is at the end of the reference file.

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE">If you download the comref, I believe the list of vehicle types is at the end of the reference file.<span id='postcolor'>

If you are talking about the official comref, I can't see any vehicle-list confused.gif

But I'll try what you've told me when I get home from work.

Thanks , bud smile.gif

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  

×