Home   Help Search Login Register  

Author Topic: resistance-style campaign woes  (Read 673 times)

0 Members and 1 Guest are viewing this topic.

Offline stridev

  • Members
  • *
resistance-style campaign woes
« on: 25 Apr 2005, 00:31:39 »
I've been trying to make this work for several weeks now, but not much luck.  

I'm working on a resistance-style campaign using weaponpool.  I think I've got the weaponpool working, but my dead squadmates are (sometimes) getting resurrected in the next mission and I"m not sure why.
I'm working off Vektorbosen's tutorial on weaponpool.  

My goal is to make a stripped-down template mission that I can just duplicate for as many missions are in the campaign.  (I"m not a scripter myself, but I can fake it, i.e. cut n paste/ change a value, etc...)

As I understand it, the keys here are the exit.sqs and init.sqs.

The first mission init is basically blank, nothing special.  The exit is where player's status is saved (seems to be working), weaponpool stuff is saved (seems to be working), squadmate injuries (seems to be working I think) but something must be up with the deleteVehicle of my dead squadmates (I'm guessing).

To set the scene: first mission- player grouped with 11 squadmates, none given a name (as in the tute).  One enemy and one truck for testing purposes.

second mission and thereafter: player grouped with 11 squadmates, all named from s_1 through s_11.  One enemy and one truck for testing purposes.

The exit.sqs is the same in all the missions (I'm basically linking up to six of these "template" missions in a campaign for testing- first mission as is, plus five duplicates of the second mission "template"):



; exit.sqs

; Soldaten werden abgespeichert

_grp = group player
_units = units _grp
_count = count _units

_i = 1

#loop
_unit = _units select _i
xx = _unit saveStatus format["Soldat%1", _i]
_i = _i + 1
?(_i < _count): goto "loop"

SOLDIERS_ALIVE = _count
saveVar "SOLDIERS_ALIVE"

xx = player saveStatus "MYPLAYER"

; Waffenpool wird gefüllt
TRUCK_ALIVE = FALSE
?(alive objTruck): pickWeaponPool objTruck; clearWeaponCargo objTruck; clearMagazineCargo objTruck; TRUCK_ALIVE = TRUE; xx = objTruck saveStatus "TRUCK_STATUS"
saveVar "TRUCK_ALIVE"



the init.sqs of the first mission I think is inconsequential (correct me if I"m wrong)

The init.sqs of all the rest are the same:



; init.sqs


; Soldaten wiederherstellen

_count = SOLDIERS_ALIVE

_soldiers = [s_1, s_2, s_3, s_4, s_5, s_6, s_7, s_8, s_9, s_10, s_11]
_yoursoldiers = []
_n = count _soldiers
_i = 0

xx = player loadStatus "MYPLAYER"
fillWeaponsFromPool player

#loop
?(_i >= SOLDIERS_ALIVE - 1): goto "EndSoldiers"
xx = (_soldiers select _i) loadStatus format ["Soldat%1", _i + 1]
fillWeaponsFromPool (_soldiers select _i)
_yoursoldiers = _yoursoldiers + [_soldiers select _i]
_i = _i + 1
goto "loop"
#EndSoldiers
?(_i >= _count): goto "pool"
deletevehicle (_soldiers select _i)
_i = _i + 1
goto "EndSoldiers"

#pool
_yoursoldiers join group player



; Sonstiges
_truckal = TRUCK_ALIVE
?(not _truckal): deleteVehicle objTruck; exit;

xx = objTruck loadStatus "TRUCK_STATUS"



All I've changed from the tute I think was making it a squad of twelve rather than six (or whatever it was).

I must be doing something wrong here, but it's beyond me to figure out what it is.  Can anyone help?  Have I provided enough info?

a million thanks for any tips


ps. how do I post code here?

Offline supershooter

  • Members
  • *
  • 2+2=4
Re:resistance-style campaign woes
« Reply #1 on: 25 Apr 2005, 16:39:03 »
hey,

can't help you apart from how to add code, above where you write your message in the
Quote
Add YABBC tags:
area next to the quote button theres a code one too.


-supershooter