Home   Help Search Login Register  

Author Topic: loadStatus  (Read 1028 times)

0 Members and 1 Guest are viewing this topic.

Offline nominesine

  • Former Staff
  • ****
  • I'm NOT back!
    • The IKB Forum
loadStatus
« on: 02 Aug 2005, 14:30:43 »
I have experienced some trouble with the loadStatus/saveStatus commands in a campaign I'm building.

The situation:

I have three characters named conrad (= the player), hudson and joker. At the end of the first mission I scan their status (weapon loadout, health and ammo levels) in the exit.sqs and save it for future reference using this syntax:

conrad saveStatus "conradStatus"
hudson saveStatus "hudsonStatus"
joker saveStatus "jokerStatus"


When the second mission begins I load the following parameters via the init.sqs:

conrad loadStatus "conradStatus"
hudson loadStatus "hudsonStatus"
joker loadStatus "jokerStatus"


The idea was that they should start with the same loadout, damage, et cetera as they had when the previous mission ended.

Weapon load out and magazine count seem to be working okey. Also, the damage level of the player is carried over to the second mission. The problem is the two AI units.

The are at full health but switchMoved into a dead animation (lying face down on the ground with weapons beside them). They respond to radio calls and give their position if told to report status.  This happens even if they were NOT injured in the previous mission at all.

Now, this is not supposed to happen.
 :-X
What am I doing wrong?

Is the saveStaus command saved permanently when itÂ's used the first time?!? Then I suppose I could get them out of the switchMoved position with a deleteStatus command before saving their status in mission one. But it sounds unlikely. Also it would look messy in the script and I like to keep my coding to a bare minimum... nice and tidy.

P.S Before anyone bother to point it out... Yes, I am running Resistance, v 1.96.

Both missions are set on the larger of the two Tonal islands, using BAS_Rangers and JAM2 weapons, but I donÂ't think that should make any difference.

OFPEC | Intel Depot
RETARDED Ooops... Retired!

DBR_ONIX

  • Guest
Re:loadStatus
« Reply #1 on: 02 Aug 2005, 15:06:26 »
Have you looked at the sinews of war stuff?
It uses exactly this idea, and works
One thing, I was under the impression saveStatus was for MP only, dunno why :P
- Ben

Offline nominesine

  • Former Staff
  • ****
  • I'm NOT back!
    • The IKB Forum
Re:loadStatus
« Reply #2 on: 02 Aug 2005, 15:28:34 »
ItÂ's a SP Campaign and saveStatus/loadStatus was introduced in the Resistance campaign together with weaponPools, as far as I remember.
OFPEC | Intel Depot
RETARDED Ooops... Retired!

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:loadStatus
« Reply #3 on: 02 Aug 2005, 17:10:57 »
Quote
Is the saveStaus command saved permanently when itÂ's used the first time?!?
At least BIS seem to clear the status before saving a new one...

Maybe you could try to save the unit's damage with saveVar?
Something like
Code: [Select]
jdama = damage joker
saveVar "jdama"

And then in the next mission's init.sqs
Code: [Select]
joker setDamage jdama???
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline nominesine

  • Former Staff
  • ****
  • I'm NOT back!
    • The IKB Forum
Re:loadStatus
« Reply #4 on: 02 Aug 2005, 17:44:58 »
deleteStatus was the solution. Now it looks like this:

deleteStatus "conradStatus"; conrad saveStatus "conradStatus"

...and it's working like a dream.
 ;D
Thank's HateR_Kint, I forgot about the deleteStatus part completely   :-[
« Last Edit: 02 Aug 2005, 17:47:18 by nominesine »
OFPEC | Intel Depot
RETARDED Ooops... Retired!