Home   Help Search Login Register  

Author Topic: Unlock content for next time a mission is played  (Read 1635 times)

0 Members and 1 Guest are viewing this topic.

Offline Trexian

  • Members
  • *
Unlock content for next time a mission is played
« 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.
Sic semper tyrannosauro.

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Unlock content for next time a mission is played
« Reply #1 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 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, 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.
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline Trexian

  • Members
  • *
Re: Unlock content for next time a mission is played
« Reply #2 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.) :)

Sic semper tyrannosauro.

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Unlock content for next time a mission is played
« Reply #3 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.
« Last Edit: 14 Nov 2007, 21:41:35 by Spooner »
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline Trexian

  • Members
  • *
Re: Unlock content for next time a mission is played
« Reply #4 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?
« Last Edit: 14 Nov 2007, 21:57:36 by Trexian »
Sic semper tyrannosauro.

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re: Unlock content for next time a mission is played
« Reply #5 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
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline Trexian

  • Members
  • *
Re: Unlock content for next time a mission is played
« Reply #6 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:
Sic semper tyrannosauro.

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re: Unlock content for next time a mission is played
« Reply #7 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 and da great tuturial 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
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline Trexian

  • Members
  • *
Re: Unlock content for next time a mission is played
« Reply #8 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:
Sic semper tyrannosauro.