Jump to content
Sign in to follow this  
franze

Advanced question

Recommended Posts

Ok, I was recently inspired by a certain mission to do a little something here; lets say you wanted to create a rating system for your players in a multiplayer game. Like if they destroy 5 enemy tanks, then they go from "combat priority C9 to C8". How would I go about doing this? Also, how would I check to make sure the player is at C8 before he can get his own tank?

Lastly, how are those special graphical tabs done in certain missions? For example, the BIS credits.

Share this post


Link to post
Share on other sites

I can outline for you what would have to be done

1. There is no advanced multiplayer scripting required that I can see.

2. Find means to track the performance of a player in a script, through score or other means like event handlers.

3. Allow the getting of the tank only when conditions in #2 are met.

Share this post


Link to post
Share on other sites

So how would I go about doing that? If I want the game to track value A, and I want the game to add to value A as well as check value A to make sure the player has a certain value before he/she can get a tank - how would I do that?

Would it be like:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_valueA = this select 0

if (_valueA >500) then {hint "You can't afford a tank yet!" and goto "exit"}

if (_valueA <500) then {hint "New tank has been built!" and _tank = "M1Abrams" createvehicle getmarkerpos "tankdepot"}

exit

So there we can use valueA, right? BUT, how do I define what valueA is? Do I make a script that will assign valueA a actual value?

Also, another thing... How do I remove actions in a dynamic fashion? I've tried <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_crew removeaction _actionID but that doesn't seem to work.

Share this post


Link to post
Share on other sites

Well I woudl say you can set valueA to 0 in the init.sqs

then whenever something happens where you think the value should increase, you can simply do valueA=valueA + 100; or whatever. this can be done in a seperate script, a trigger, an event handler etc.

I'm not personally sure about the removing action question. I can't see anything really wrong with the syntax, it works for me that way. Just make sure you are removing the same action from the same object/unit. smile_o.gif

Share this post


Link to post
Share on other sites

Thats what I was looking for! Many thanks. So, another question... ("AHHHG!!!")

How would you make a menu that activates when a action is activated? Example would be MF's Capture The Island, since you can use a action to activate a menu.

And what would the code be in the init.sqs to define the value of valueA? Would I write <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">set valueA to "0" or would it be more like <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">valueA = "0"?

Having a lot of problems with a lot of this coding stuff!

EDIT: Just figured out the "valueA" thing. You write <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">valueA = 0 to define the value.

EDIT2: about the removeaction thing... it returns "Error Removeaction: Expected object, number". What am I doing wrong with removeaction?

Share this post


Link to post
Share on other sites

Next question: How do I take valueA and present it to the player? If valueA changes, what code would I use to present the current value of valueA to the player?

Share this post


Link to post
Share on other sites

Just dropped in to say I'm beat, so I'm going to sleep, anyone else don't hesitate to help out. smile_o.gif

Share this post


Link to post
Share on other sites

Probably going to end up finding it out on my own...

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  

×