Home   Help Search Login Register  

Author Topic: Information from Mission to Outro  (Read 3087 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

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Information from Mission to Outro
« Reply #15 on: 30 Jul 2004, 21:19:26 »
Quote
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.
You mean you played the mission in the editor and then 'played' only the outro in SP trying to use the variables saved while playing in the editor? And it wouldn't work?
It's probably because the editor mission very likely has a different entry in the object.sav (where the saveVar saves the variables) than the SP mission...

It should work also in SP and not just in the editor...
After all, a campaign is just a series of SP missions tied together with a descriprion.ext...
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:Information from Mission to Outro
« Reply #16 on: 31 Jul 2004, 00:04:56 »
Not quite:  I created a little mission with a mission and an outro.     In the Mission editor the saveVar command worked for the outro providing I had already played the mission.   I suspect this was because the variable had to be initialised in some curious way.

However, when I exported the whole thing to single missions and played the mission followed by the outro, the variable did not work.

The important thing for me is that the savestatus thing did work, and that's what I need.   (The player's squad, or rather what's left of it, has a chopper extraction in the outro and I just wanted the numbers and weapons to be right.)     However, having come across the savevar thing, I'd like to get it sussed.     Use in savestatus to transfer varible-like information from the mission to outro is of course possible, but very inelegant.

The good news is that this of course allows you to have different outros for different numbered endings End#1, End#2, etc..
Plenty of reviewed ArmA missions for you to play

Fishion

  • Guest
Re:Information from Mission to Outro
« Reply #17 on: 31 Jul 2004, 08:36:33 »
Okay I made a mission to test this.
It seems it is possible via the saveVar thing to save Variables from
the Intro to the Mission, but not from the Mission to the Outro, which is strange.
I guess we have to use a GameLogic with a saveStatus to do that
*grummel*  ???

-Fishion

Offline Calamity

  • Former Staff
  • ****
  • Calamity Strikes AGAIN!
    • DataCraft Enterprises
Re:Information from Mission to Outro
« Reply #18 on: 14 Sep 2004, 04:15:07 »
My interest in this thread was the ability of passing info into a loose outro. And cripes I think I've got it!

I have a mission that I wanted to make several loosing outros, depending on what objectives were failed. It's an SP mission, so I've got some limits, as I've discovered here. Thanks to Fishion, Messiah, and most of all Macguba, I got an idea that works for me. Thank you Gentlemen, I stand on the shoulders of Giants!

My solution:
I used the health of a Game Logic to store information from the mission to the outro. Theoretically there are 10 or more bits of information each game logic can store!

It's a Hack I know, but I'll work with it until something better comes along.

I'm including a POC (Proof Of Concept) demo mission. It's not polished or anything. But I got the important stuff; I documented the Exit and TestCamer scripts. I know most of you guys have already answered this to your satisfaction and moved on. So, this is really for the next guy like me, so he won't have to go through my learning curve.

Thanks again guys!

Calamity out

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Information from Mission to Outro
« Reply #19 on: 14 Sep 2004, 10:05:00 »
I've already thought of this.   Well, actually, not of using a gamelogic, but of doing something like that.    

saveStatus does not appear to record whether a unit is alive or dead, only weapons & ammo, rating I think and probably other stuff like that.     I don't think it does setIdentity. ... but I had a LOT of comings and goings to make it work and I can't quite remember what works and what doesn't.   At one stage I even thought it did pass whether the unit was alive or dead, but in the end it wouldn't.     Anyway the point is that I need to pass whether the unit was alive or dead to the Outro.   I also need to pass the value of a couple of booleans from one to the other.

At the end of my mission a script (transfer.sqs) checks if the unit is alive or dead.   If it's dead, it gets a specific (and bizarre) ammo loadout.    The script also checks the booleans:  they check whether the loon in question should be in the outro at all so the process is just the same:  not in mission, he gets the bizarre ammo loadout.

At the start of the Outro another script (outroStart.sqs) checks the ammo loadout and deleteVehicles the loon if appropriate.    One little twist is that some of the other loons appeared dead in the Outro for no reason that I could figure out:  the Outro script had to have a setDammage 0 command to make sure that the ones that were supposed to be alive, really were alive.

I thought about writing a tute but I don't think we're quite there yet:  we need to understand this a bit better so I'm delighted somebody is picking up on it.

To communicate large numbers you could use several GLs with one as the units column, one as tens, one as hundreds, etc..   It is a bit cumbersome - well more so than using saveVar  ;D - but it works and once we figure out the best way of doing everthing and write it up it will be a nice little contribution to the community.      I've always hated getting onto that extraction chopper with the wrong number of loons and the wrong weapons.

I've attached a zip which has 3 files.     exit.sqs which is called automatically at the end of the mission:  transfer.sqs which is called manually at the end of the mission (the stuff in here should probably go in exit.sqs, it's only in a seperate file because that was more convenient at the time):  and outroStart.sqs which does the relevant stuff in the outro.    The whole mission is too big to attach, but you can grab it from here.

I'm off for some breakfast now but I'll look at your demo later.
« Last Edit: 14 Sep 2004, 10:43:55 by macguba »
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 #20 on: 14 Sep 2004, 10:54:48 »
Well I've just tested your demo and it clearly works.    And is more elegant that the method I used.   ;D   (But I'd have needed 10 GLs and in a mission that's already laggy, I don't want another 10 groups.   Well that's my story and I'm sticking to it.)

I forgot to add that I had problems with some magazines - some of them caused stupid problems.    Kozlice was one, there were others, can't remember exactly what went wrong but it stopped things from working.    The point is that this whoe thing is not just an easy fix:  in true "fickle Flashpoint" fashion it's all very temperamental.     Which is just what you expect from this game when you succeed in doing something it was designed not to do.  ::)
Plenty of reviewed ArmA missions for you to play