Home   Help Search Login Register  

Author Topic: Information from Mission to Outro  (Read 3409 times)

0 Members and 1 Guest are viewing this topic.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Information from Mission to Outro
« on: 22 Jul 2004, 12:50:52 »
Is there any way to transfer infomation from a Mission to its Outro?     In particular the value of variable.    (I just want the Outro to have the same number of loons in the player's group as were alive at the end of the mission.)    I suspect not, but in case anybody has figured it out ....

Many thanks.
Plenty of reviewed ArmA missions for you to play

Offline Messiah

  • Honourary OFPEC Patron & Drinking Buddy of Wolfsbane
  • Honoured Contributor
  • ***
  • OFPEC Veteran
    • Project UK Forces
Re:Information from Mission to Outro
« Reply #1 on: 22 Jul 2004, 14:40:18 »
i don't think global variables are kept into the outro win unfortunatly....  :-\

---------------------------------------------------------

wait, i was just thinking - the exit.sqs (oposite to an init.sqs) is executed at the end of the mission (basically records how many people in the players group, weapons pooled etc) and follows it on to the next mission in a campaign - then the init of the next mission uses the info from the exit.sqs to make the next mission follow on...

this info could be used by an outro cutscene as well as far as i can tell - and then that would let the mission outro follow on from the mission correctly
« Last Edit: 22 Jul 2004, 14:42:17 by Messiah »
Proud Member of the Volunteer Commando Battalion

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Information from Mission to Outro
« Reply #2 on: 22 Jul 2004, 15:04:40 »
Maybe saveVar would help ???

It works in SP/MP, not only in campaigns (as does SaveStatus and SaveIdentity... These at least work in MP too)...

The global space ComRef talks about with these functions is actually a savegame folder ::)
In campaigns it's the campaigns own save folder, in SP it seems that the global space means a temp save folder...

Not 100% sure, but I have had succesful use of those above mentioned functions in SP mission scripts...
« Last Edit: 22 Jul 2004, 15:05:38 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 Messiah

  • Honourary OFPEC Patron & Drinking Buddy of Wolfsbane
  • Honoured Contributor
  • ***
  • OFPEC Veteran
    • Project UK Forces
Re:Information from Mission to Outro
« Reply #3 on: 22 Jul 2004, 15:33:34 »
thats what the exit.sqs uses to continue variable to the enxt misison, uses those synthaxes  ;)

(just been looking at mine, and was about to post those - beat me to it again, lol)
Proud Member of the Volunteer Commando Battalion

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Information from Mission to Outro
« Reply #4 on: 22 Jul 2004, 15:41:23 »
;D

And me didn't read your message through thoroughly... ::)

Otherwise I would have kept my 'mouth' shut... :P
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

asmodeus

  • Guest
Re:Information from Mission to Outro
« Reply #5 on: 23 Jul 2004, 06:22:34 »
Good idea there Messy!   ;D

I tried to achieve this a long time ago and after messing around with it for awhile I asked here and was told it was impossible.  

Now you've piqued my interest, I'm gonna test this exit.sqs idea.    ;)

Although if I remember correctly what I was told is that in OFP you can pass info from one mission to the next in a campaign, but there is no way that you can pass info to/from an intro/outro.   :-\

I hope that's wrong though!   I love pushing the limits of OFP.   8)

Asmo

Offline Messiah

  • Honourary OFPEC Patron & Drinking Buddy of Wolfsbane
  • Honoured Contributor
  • ***
  • OFPEC Veteran
    • Project UK Forces
Re:Information from Mission to Outro
« Reply #6 on: 23 Jul 2004, 10:09:43 »
Good idea there Messy!   ;D

I tried to achieve this a long time ago and after messing around with it for awhile I asked here and was told it was impossible.  

Now you've piqued my interest, I'm gonna test this exit.sqs idea.    ;)

Although if I remember correctly what I was told is that in OFP you can pass info from one mission to the next in a campaign, but there is no way that you can pass info to/from an intro/outro.   :-\

I hope that's wrong though!   I love pushing the limits of OFP.   8)

Asmo

well... i think it depends on how ofp saves the information - surely the info is saved at the end of the mission, hence the save variable should be available during the outro - unless it has to be in a campaign pbo to work, i don't know, but its worth a try
Proud Member of the Volunteer Commando Battalion

Offline Messiah

  • Honourary OFPEC Patron & Drinking Buddy of Wolfsbane
  • Honoured Contributor
  • ***
  • OFPEC Veteran
    • Project UK Forces
Re:Information from Mission to Outro
« Reply #7 on: 23 Jul 2004, 10:17:17 »
Code: [Select]
_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"

here's a sample of an exit.sqs - obviously rename stuff to suit  ;)
Proud Member of the Volunteer Commando Battalion

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Information from Mission to Outro
« Reply #8 on: 23 Jul 2004, 12:01:58 »
Thanks chaps, this looks like lots of good stuff.

I'm not familiar with exit.sqs.   Is there a default one that runs automatically?   Or does it just run automatically if you put a script of that name in the mission folder?
Plenty of reviewed ArmA missions for you to play

Offline Messiah

  • Honourary OFPEC Patron & Drinking Buddy of Wolfsbane
  • Honoured Contributor
  • ***
  • OFPEC Veteran
    • Project UK Forces
Re:Information from Mission to Outro
« Reply #9 on: 23 Jul 2004, 13:21:35 »
exit.sqs is fired at the end of the mission, in the same way init.sqs is fired at the start - its automatic.... just place a script named exit.sqs in your mission folder and it will ve fired when the mission ends
Proud Member of the Volunteer Commando Battalion

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Information from Mission to Outro
« Reply #10 on: 29 Jul 2004, 16:03:11 »
Gentlemen,

With your help I have got this far.   Rather than attaching a mission, I will summarise the salient points because it explains things more clearly.

+++++++++++++++++++++++

init.sqs
=====
loonsAlive = 1

mission
=====
a group named sn with 5 members

exit.sqs
======
loonsAlive = count units sn
saveVar "loonsAlive"
exit

outro
====
a loon named loon1
Trigger hint format ["alive %1", loonsAlive]
Trigger:
   condition:  loonsAlive > 3
   on activation:   deleteVehicle loon1

++++++++++++++++++++++++

You must initialise the variable in init.sqs (or possibly elsewhere) otherwise it doesn't work at all.

When you test the Outro in the Mission Editor Loon1 appears and immediately vanishes.   Bingo!   (You can't use loonsAlive > 3 in his condition of presence field, it doesn't work.)

However, when you export the mission and try it from Single Missions, it doesn't work.   The loon appears and stays appeared, and the hint gives you gobbledygook because it thinks the variable doesn't exist.

Any ideas?    Have I missed something stupid?

Many thanks.

Plenty of reviewed ArmA missions for you to play

Fishion

  • Guest
Re:Information from Mission to Outro
« Reply #11 on: 30 Jul 2004, 11:11:50 »
Hiho,
I haven't bothered to look it up, but don't you have to LOAD the saved Variables?
(Can't access the ComRef from Work...Netscape here won't load the Editors Dep page)

However I would use SaveStatus and LoadStatus (not sure on the Sytax) for
that because that gives you also dammage and EQUIPMENT as in the end of
the mission, now and that's alot better than just the number, no? You just have to
manually delete the not living Group-Members

As this seems to be a subject that another question fits into:
Does the Weaponspool work in Singleplayer? Because I wanted dynamically change
the avaiability of weapons in the Into (or init) rather than fixing everything in the
description.ext

-Fishion
« Last Edit: 30 Jul 2004, 11:13:16 by Fishion »

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Information from Mission to Outro
« Reply #12 on: 30 Jul 2004, 11:32:55 »
Dammage and equipment would be ideal.    I haven't started to look into those commands yet, I was trying to get it working with the easy one first.     Will look into it and report back.

It does seem odd that it works in the Mission Editor but not the single mission though.
Plenty of reviewed ArmA missions for you to play

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Information from Mission to Outro
« Reply #13 on: 30 Jul 2004, 12:09:38 »
It does appear to work.    Yippee!    More work still required though.

The variable thing, it turns out, only works in the Mission Editor if you play the mission before the outro - if you go straight to the outro on loadup ofp it doesn't work.    Once the value is established it stays the same until you play the mission again and change it.

Is there an equivalent command to loadStatus, but applicable to a variable?     There is no "loadVariable".
Plenty of reviewed ArmA missions for you to play

Fishion

  • Guest
Re:Information from Mission to Outro
« Reply #14 on: 30 Jul 2004, 12:37:48 »
As I said I use saveVar etc. to Tranfere Data from the Intro to the Mission
(better init.sqs because that let's you also change objectives dynamically).
I'll post the test mission when I get home.

-Fishion