A couple of scripting questions

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
User avatar
phazon_elite
Rebel Colonel
Rebel Colonel
Posts: 597
Joined: Tue Jan 16, 2007 9:10 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
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:

A couple of scripting questions

Post 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!
fiddler_on_the_roof
1st Lieutenant
1st Lieutenant
Posts: 460
Joined: Wed Nov 12, 2008 5:28 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Re: A couple of scripting questions

Post 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.
User avatar
phazon_elite
Rebel Colonel
Rebel Colonel
Posts: 597
Joined: Tue Jan 16, 2007 9:10 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
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

Post by phazon_elite »

Thanks fiddler, and yes that helped. Now I just need my first question solved...
Master_Ben
Lieutenant General
Lieutenant General
Posts: 675
Joined: Wed Nov 12, 2008 9:50 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Watching your PC over your shoulder. No, the other sholder....

Re: A couple of scripting questions

Post 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?
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

Re: A couple of scripting questions

Post 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)
Post Reply