OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: Trexian on 14 Nov 2007, 20:53:47

Title: Unlock content for next time a mission is played
Post by: Trexian on 14 Nov 2007, 20:53:47
I almost posted this in the "advanced" forum, because it is probably beyond my abilities. :)

The idea is that after a player plays a mission, something is unlocked so that it will replay differently the next time.  Maybe add a weapon crate, or start the player with different weapons, etc.

My background includes some scripting for NSIS installers, so my initial thought was some kind of text manipulation of the mission files, but it doesn't appear that there are any ArmA commands to accomplish this (not that I would really expect that anyway).

My "fallback" option is to have an small exe that the player would run after at least trying the mission, that can check to see if the mission has been run (or at least saved) and if it has, then change the content.

Any ideas/workarounds for unlocking content with successive runs of a SP mission? :)

TIA.
Title: Re: Unlock content for next time a mission is played
Post by: Spooner on 14 Nov 2007, 21:09:40
Well, there are no text manipulation routines in ArmA at all, though there are some brute-force hacks (http://www.ofpec.com/ed_depot/index.php?action=details&id=409&page=0&game=ArmA&type=fu&cat=xyz) to work around this. The stopper though, is that you can't write anything to files, so you couldn't do anything anyway.

The best thing would be to set up the missions as a campaign, so you can pass information forward via saveStatus (http://www.ofpec.com/COMREF/index.php?action=list&game=All&letter=s#saveStatus), saveVar (http://www.ofpec.com/COMREF/index.php?action=list&game=All&letter=s#saveVar), etc.

If you were wanting to do this with an MP mission, you could use one of the database backends for ArmA such as DSTS (http://forums.livecar.net/).
Title: Re: Unlock content for next time a mission is played
Post by: Trexian on 14 Nov 2007, 21:27:56
Oooh.  Niiiice.

The .sav file - simple txt?  Took a look real quick at the get* commands and nothing jumped out about getting the variable? :)

And, ideally, I was hoping to have the mission be either single or multi-player.  Can I do that with setting it up as a campaign?

Still early in the mission dev process, so I can go either way.  (Not that there's anything wrong with that.) :)

Title: Re: Unlock content for next time a mission is played
Post by: Spooner on 14 Nov 2007, 21:34:42
getVariable is nothing to do with campaigns (it is for attaching variables to objects) and the other get* commands are for reading config entries. You want loadStatus to accompany the saveStatus command.

Campaigns are just SP, as far as I'm aware. You'd need DSTS or similar to get any joy in MP.
Title: Re: Unlock content for next time a mission is played
Post by: Trexian on 14 Nov 2007, 21:44:20
Hmmm... ok.

Any chance of fooling ArmA into allowing the save* to work in a "regular" mission? :D  Here's something else - I don't necessarily care if there is any content.  Just the presence of a file or something I can check to see if the mission has already been run would work.

I'll check the campaign thing, though, too.  Worst case scenario is 2 versions - SP and MP.  NBD.

Thanks!

Edit:
New idea.  If I create a marker in a script, but don't delete it, then save the game, is that marker saved for any subsequent plays of the mission?  For instance, I create a small marker in a remote part of the map with a specific name.  Then, I can also have a check for that marker name and know whether the mission has been run earlier?
Title: Re: Unlock content for next time a mission is played
Post by: LCD on 14 Nov 2007, 22:00:15
another not perfect solution (somin i had in my mind 4 a while...) is 2 give some code @ da end of mission... and give da player oportunity to enter dat code somewere... i know its not exactly wat ur lookin 4 but it somin ive been thinkin bout latly :P

LCD OUT
Title: Re: Unlock content for next time a mission is played
Post by: Trexian on 14 Nov 2007, 22:12:42
Right - I saw an addon for something like the Splinter Cell hacker 'puter or something.

Set it up so that at the beginning there's a login code given in the readme or intro vid, so when the game starts you have to enter it.  Then, at mission init, have the person enter the code, and set the mission up accordingly.  Then, upon successful completion, have the outro or debrief give an additional login, which if entered in the next mission init, then it sets it up differently.

That might indeed be a good way around it. :thumbs:
Title: Re: Unlock content for next time a mission is played
Post by: LCD on 15 Nov 2007, 14:47:29
actualy... i think i released dat dialog hacker (nd deres beter lookin version in my new mision... check da sig-line :P)

yea dat wat i was thinkin... 2 create da login thingy you will have 2 learn how 2 use dialogs tho... best way wud b da commands wiki (http://community.bistudio.com/wiki/User:Manny/Dialogs_%28Work_in_progress%29) and da great tuturial (http://www.ofpec.com/ed_depot/index.php?action=details&id=37&page=0&game=OFP&type=tu&cat=sc) by vektorboson after dat all u need 2 do is open and see how stuff is done in other misions/resources dat use dialogs :D

LCD OUT
Title: Re: Unlock content for next time a mission is played
Post by: Trexian on 15 Nov 2007, 19:10:57
hehehe

I didn't even know that was you that made that. :D

I think that's probably the way I'll go for now.  Set up some sort of dialog for the player to enter.  Thinking ahead, I could even layer it so that different codes increase the bad guys/decrease the time before back up arrives.

Could be a neat way to increase re-playability.

 :good: