Change models through script?

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
CdtFox
2nd Lieutenant
2nd Lieutenant
Posts: 379
Joined: Wed Feb 17, 2016 8:51 am
Projects :: BUC and Designated Days
Games I'm Playing :: SWBF2+EAW+Subnautica
xbox live or psn: No gamertag set
Location: France
Contact:

Change models through script?

Post by CdtFox »

I was wondering if with some codes such as "SetClassProperty" or "SetProperty" i can change the model of the unit. As far as i remember this code go directly after "ScriptInit()" right?

If so, how i can i tell the readme to read the corresponding .lvl where the model is?
ARCTroopaNate
Jedi
Jedi
Posts: 1161
Joined: Mon Mar 21, 2011 8:12 pm
Projects :: Star Wars Battlefront - Tides of War
Games I'm Playing :: SWBF2 RC EAW
xbox live or psn: I have ps4
Location: STALKER!
Contact:

Re: Change models through script?

Post by ARCTroopaNate »

Your model needs to be loaded into a .req file called by the lua to be used, and yes, setclassproperty is what you want here. if you wanted to change the model of the clone rocketeer to that of the clone trooper you'd have to make sure the clone trooper is called for under readdatafile:rep.lvl and then use setclassproperty.
CdtFox
2nd Lieutenant
2nd Lieutenant
Posts: 379
Joined: Wed Feb 17, 2016 8:51 am
Projects :: BUC and Designated Days
Games I'm Playing :: SWBF2+EAW+Subnautica
xbox live or psn: No gamertag set
Location: France
Contact:

Re: Change models through script?

Post by CdtFox »

ARCTroopaNate wrote:Your model needs to be loaded into a .req file called by the lua to be used, and yes, setclassproperty is what you want here. if you wanted to change the model of the clone rocketeer to that of the clone trooper you'd have to make sure the clone trooper is called for under readdatafile:rep.lvl and then use setclassproperty.
So the model should be loaded loaded directly in the req file, like 1st person models?

Also how can i use this code to change the weapons used by the unit? I tried different ways, but well i'm a bit lost. :?
ARCTroopaNate
Jedi
Jedi
Posts: 1161
Joined: Mon Mar 21, 2011 8:12 pm
Projects :: Star Wars Battlefront - Tides of War
Games I'm Playing :: SWBF2 RC EAW
xbox live or psn: I have ps4
Location: STALKER!
Contact:

Re: Change models through script?

Post by ARCTroopaNate »

I don't have access to my modding computer but it's setclassproperty, weaponname1, "rep_weap_inf_rifle" or something like that to change to republic rifle. The model can either be loaded directly into the req or you can load a unit in that uses that model.
CdtFox
2nd Lieutenant
2nd Lieutenant
Posts: 379
Joined: Wed Feb 17, 2016 8:51 am
Projects :: BUC and Designated Days
Games I'm Playing :: SWBF2+EAW+Subnautica
xbox live or psn: No gamertag set
Location: France
Contact:

Re: Change models through script?

Post by CdtFox »

ARCTroopaNate wrote:I don't have access to my modding computer but it's setclassproperty, weaponname1, "rep_weap_inf_rifle" or something like that to change to republic rifle. The model can either be loaded directly into the req or you can load a unit in that uses that model.
Perfect thank you nate :D
ARCTroopaNate
Jedi
Jedi
Posts: 1161
Joined: Mon Mar 21, 2011 8:12 pm
Projects :: Star Wars Battlefront - Tides of War
Games I'm Playing :: SWBF2 RC EAW
xbox live or psn: I have ps4
Location: STALKER!
Contact:

Re: Change models through script?

Post by ARCTroopaNate »

no problem :D
Post Reply