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!
A couple of scripting questions
Moderator: Moderators
- phazon_elite
- Rebel Colonel

- Posts: 597
- Joined: Tue Jan 16, 2007 9:10 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: I'm sorry Link, I can't give the location. Come back when you're a little...mmmh...RICHER!
- Contact:
-
fiddler_on_the_roof
- 1st Lieutenant

- Posts: 460
- Joined: Wed Nov 12, 2008 5:28 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
Re: A couple of scripting questions
How do you want to change the unit?phazon_elite wrote: 2. Is SetProperty the function that can edit a unit?
Points to unlock goes here, and looks like this,
Code: Select all
function ScriptPostLoad()
SetClassProperty("rep_inf_ep3_rocketeer", "PointsToUnlock", 2)- phazon_elite
- Rebel Colonel

- Posts: 597
- Joined: Tue Jan 16, 2007 9:10 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: I'm sorry Link, I can't give the location. Come back when you're a little...mmmh...RICHER!
- Contact:
Re: A couple of scripting questions
Thanks fiddler, and yes that helped. Now I just need my first question solved...
-
Master_Ben
- Lieutenant General

- Posts: 675
- Joined: Wed Nov 12, 2008 9:50 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Watching your PC over your shoulder. No, the other sholder....
Re: A couple of scripting questions
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...
), but I can't figure them out. Anyone?
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...
- [RDH]Zerted
- Gametoast Staff

- Posts: 2982
- Joined: Sun Feb 26, 2006 7:36 am
- Projects :: Bos Wars AI - a RTS game
- xbox live or psn: No gamertag set
- Location: USA
- Contact:
Re: A couple of scripting questions
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)
