Page 1 of 1

A couple of scripting questions

Posted: Wed Dec 24, 2008 5:39 pm
by phazon_elite
I've just started to take on scripting, but I've run into a few problems. So I have a couple questions about scripting:

1. Is there a way to increase reinforcement count (on either team) if a player joins a multiplayer game?
2. Is SetProperty the function that can edit a unit?

If anyone can answer these, thanks!

Re: A couple of scripting questions

Posted: Wed Dec 24, 2008 6:10 pm
by fiddler_on_the_roof
phazon_elite wrote: 2. Is SetProperty the function that can edit a unit?
How do you want to change the unit?

Points to unlock goes here, and looks like this,

Code: Select all

function ScriptPostLoad()
SetClassProperty("rep_inf_ep3_rocketeer", "PointsToUnlock", 2)
hope that helps.

Re: A couple of scripting questions

Posted: Wed Dec 24, 2008 6:14 pm
by phazon_elite
Thanks fiddler, and yes that helped. Now I just need my first question solved...

Re: A couple of scripting questions

Posted: Thu Dec 25, 2008 11:21 am
by Master_Ben
1) You could if you could find a script that gets the player joining... Then all would be easy...

There are a few scripts referring to multiplayer/online in the lua functions in the FAQ (thank you Tean for that couple hundred ripped scripts... :mrgreen: ), but I can't figure them out. Anyone?

Re: A couple of scripting questions

Posted: Wed Dec 31, 2008 1:42 pm
by [RDH]Zerted
1) Sort of. Theres no direct way to determine when a player joins the server, so you would have to setup a repeating timer to check sizes of the teams (can be done multiple ways...). When a team's size increases, increase its reinforcement count: AddReinforcementCount(REP, 10)