Jump to content
Sign in to follow this  
Jedo

Money rewards - economy (warfare?)

Recommended Posts

Seeing how Arma2 provides such good tools for a mercenary simulator, that is what I am working on right now. What I'm trying to implement now (and I heard other players ask about it here and there so I thought a separate thread is in order) is the money reward system.

I have a clue that earning money belongs to the Warfare module but I don't want the whole Warfare to be working, I just want my Secops - and if that's not possible or too complicated then just my kills - to be rewarded with cash to "myMoney" account. That cash can then be spent back at the base (for which I will require warfare working yet again, but that's a whole different thing for later). I unpboed warfare missions and it's a tad too big to find something like this.

Can someone point me to a script or something similar (if possible in the English language :P)?

Share this post


Link to post
Share on other sites

You won't need to have all of warfare running.

Base management can be done with just the construction interface. Money can be handled using killed event handlers for enemies and a money variable which is publically updated every time a bad guy dies.

A "killed" type event handler passes two arguments by default, the dead object and the killer, this contains enough info to determine what gets killed and who should get rewarded (the basis of a simple points sytem).

As for money, that's simple enough, create a public variable called something like, I dunno, blingbling and alter it's value every time the event handler gets fired or you spend something at base.

Share this post


Link to post
Share on other sites
You won't need to have all of warfare running.

Base management can be done with just the construction interface. Money can be handled using killed event handlers for enemies and a money variable which is publically updated every time a bad guy dies.

A "killed" type event handler passes two arguments by default, the dead object and the killer, this contains enough info to determine what gets killed and who should get rewarded (the basis of a simple points sytem).

As for money, that's simple enough, create a public variable called something like, I dunno, blingbling and alter it's value every time the event handler gets fired or you spend something at base.

OK first of all thank for pointing me in the direction of the "killed" even handler, a quick search through the biki and I understood that I don't understand a thing...The forums here however gave me this:

{_x addeventhandler ["killed", {(_this select 1)}]

But now what? to put into a large trigger activated by Anybody. I need ONLY the player to receive cash for ONLY killing the enemy (which gets spawned by the secop module). And how to connect this to the addition of cash to the myMoney account?

Any way to bind the complition of a secop mission and the firing of the eventhandler?

Can I get an example code plz?

Edited by Jedo

Share this post


Link to post
Share on other sites
But now what? to put into a large trigger activated by Anybody. I need ONLY the player to receive cash for ONLY killing the enemy (which gets spawned by the secop module). And how to connect this to the addition of cash to the myMoney account?

Any way to bind the complition of a secop mission and the firing of the eventhandler?

What you have asked for requires some rather complex scripting. Anyone responding would literally have to write the entire thing themselves to answer your questions with sample code.

The biki contains all the information you need on addEventHandler, as a place to start. Experiment with that.

Can I get an example code plz?

Are you possibly a small cat that has finished eating cheese burgers and moved onto sample code? :P

lolcat1.jpg

Edited by Rocket

Share this post


Link to post
Share on other sites

OK EDIT: Back to talk about my achievement so far for those trying the same thing:

1. Make sure you have the Secops module set up with the money account variable created (see a thread somewhere on this forum relating to secops code).

2. Create large trigger covering the whole map and activated by Opfor (or whatever group you want to get a reward for killing); make sure you chose "Repeatedly" and in the on activation field put this extreeeemely complex (lol at Rocket) code:

 {_x addeventhandler ["killed", {_this exec "nameofyourscript.sqs"}]} foreach thislist 

3. Simply create the script in the mission folder to which the above code relates and in the script put a single line

myMoney = myMoney + 100

or whatever amount you want to get every time you kill. For some reason putting this line into the code of the trigger doesn't work.

OK now I just need to enable the buying of units back at base and that definately involves the warfare module. For this I will definately need professional help.

Also, wonder how I can add different reward amounts based on whom I take down. Sounds like complex coding.

Edited by Jedo

Share this post


Link to post
Share on other sites

OK I looked at the Warfare scripts and Doolittle's Arma 1 scripts on buying units from buildings. I really can't apply what I'm seeing to the mission. I realize that it will cost me months to figure out what will cost an experienced coder a few hours.

So this is pretty much my request for someone with understanding to extract the part which enables the ability to buy units at the constructed base buildings. I will keep digging myself in the meantime of course.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×