Jump to content

Replacing models using scripts


Recommended Posts

So I want to be able to change NPC models in SP using scripts, since I want these changes to apply to certain missions and not remain permanent. Let's say I want to replace Kyle in the Byss mission with Luke. That sort of thing.

 

I was able to change the skins of the selected models using the SET_SKIN command in BehavEd, but I haven't found any commands to change the actual models. SET_PLAYERMODEL crashes the game as (I suppose) it's only supposed to apply to the model the player is using. 

 

Does anyone know of a way to do this? Also, does anyone know about any good scripting tutorials? It'd be nice to stop bugging you guys about this trivial stuff if there's a manual out there somewhere.

Link to comment
  • 4 years later...
Guest Redemption

Very old thread but, tis exactly what I'm after for the mod. Idea is like how each level in TFU, you unlocked and wore different attire. Main inspiration is for it to tie in with Primal Clarity's Jedi Outcast movie. Anyone interested?

Link to comment

Very old thread but, tis exactly what I'm after for the mod. Idea is like how each level in TFU, you unlocked and wore different attire. Main inspiration is for it to tie in with Primal Clarity's Jedi Outcast movie. Anyone interested?

 

Best way would be to not create different models, but one model with different skins, like Jaden in singleplayer. Any other way I've tried crashes the game. 

Link to comment

@@Noodle Have you by any chance got that script handy?

 

You have to set the script with a  SET_SKIN value, like this:


	set ( "SET_SKIN", "models/players/jedi_kdm/model_default.skin" );

Of course, in that example it would only work with the jedi_kdm model, otherwise it will end up looking odd.

Link to comment
Guest Redemption

Yeah, thats how @@Langerd had it. I'm trying to keep motivated, last night I finally added in the slow-mo force power I previously had called for in a cfg file - thanks to khandalaine for his camera & timescale mod; that taught me a lot. So I'll have a go later on creating these scripts; hopefully won't be too much of a headache.

 

Edit: oops :)

Link to comment

Yeah, thats how @@Langerd had it. I'm trying to keep motivated, last night I finally added in the slow-mo force power I previously had called for in a cfg file - thanks to khandalaine for his camera & timescale mod; that taught me a lot. So I'll have a go later on creating these scripts; hopefully won't be too much of a headache.

 

Edit: oops :)

 

Trial and error. It can be very satisfying when you actually get the things as you wanted them to be.

Link to comment
Guest Redemption

You can do both, it depends on what you want to do. At the start of a level, you could link the info_player_start entity with a target_scriptrunner entity that uses the specific script that changes the player skin, it should work. 

 

@@Noodle How are you getting on? It seems after exhausting everything else that I need to use what you said above, but I don't know how to go about setting that up. I open up JK2Radiant then what?  I'm stumped. Could you help me please? 

 

I downloaded GtkRadiant 1.4 and updated the q3map2 thingwejig, loaded up kejim_post, right-clicked on where kyle starts and select info_player_start and then nothing happens... How am I meant to link infoplayerstart to the script???? 

 

I'm getting nowhere... Could I load a cfg file through the script instead?

 

 

for playermodel and skin is easy:

1 make the info_player_start when you start a level

2 make a trigger_once around info_player_start with playeronly spawnflag

3: make a script runned by trigger_once with usescript command into trigger_once or with a target_scriptrunner fired by trigger_once.

into Icarus script make a script file called "Intro "

that run at the start of level you can set this:

SET_PLAYERMODEL "ahsoka"

SET_SKIN "models/players/ahsoka/model_blue.skin"

and buld the script in IBI file. put into scripts folder in a subfolder with name of map.

for run the script use the command on trigger_once or target_scriptrunner

key Usescript

value "mapname/intro"

no code hacking required. :) the unique issue is if you make too much custom playermodel and skin changes into the level the savegames should crash. :\

 

 

This is what @@Asgarath83 states which is all good, but still at a loss on how to implement!!!!!

Link to comment

@@Noodle How are you getting on? It seems after exhausting everything else that I need to use what you said above, but I don't know how to go about setting that up. I open up JK2Radiant then what?  I'm stumped. Could you help me please? 

 

I downloaded GtkRadiant 1.4 and updated the q3map2 thingwejig, loaded up kejim_post, right-clicked on where kyle starts and select info_player_start and then nothing happens... How am I meant to link infoplayerstart to the script???? 

 

I'm getting nowhere... Could I load a cfg file through the script instead?

 

I have never used a .cfg for that so I wouldn't recommend it since I lack the knowledge. In the info_player_start entity you must add a target command that has a value equal to the targetname of the target_scriptrunner entity. 

 

This is a working exmaple from my maps and it should help you understand how everything is set. The info_player_start entity is linked to the target_scriptrunner. The "usescript" command in target_scriptrunner has a value equal to the location of my own script. The full directory would be "Gamedata/Base/Scripts/Hideout/npccheckercantina.ibi" file.

 

Good luck, if it doesn't work, send me a screenshot of what you're doing and maybe I can point the error.

 

sLApHIH.png

Link to comment
Guest Redemption

Thats whack!?! I didnt get screens like that with clicking on info player start and target script runner... I think its because of my script path, maybe. Thanks again for your kindness pal, I gave up earlier on and got rid of all those tools which were clogging up my gamedata folder, will reinstall radient later on.

Link to comment

Thats whack!?! I didnt get screens like that with clicking on info player start and target script runner... I think its because of my script path, maybe. Thanks again for your kindness pal, I gave up earlier on and got rid of all those tools which were clogging up my gamedata folder, will reinstall radient later on.

for set specific parameters into  entites on gtk radiant, select the enctity and press N key. :)

on key you make the command and on value you put the value of command. for example...

key spawnscript

value : empire/start1  (path of the script, the script will be placed on scripts folder and into a folder called "empire" that you need to custom create for work, and need to be compiled with icarus on IBI format. .

Noodle likes this
Link to comment
Guest Redemption

@@Asgarath83 Hi, how are you man? Hope your getting better from the last time I heard from you.

 

See, at the moment I'm wondering if this can even work for Jedi Outcast; playermodel command isn't in this game. Is there no way at all of execing a cfg file through a script...

Link to comment

@@Asgarath83 Hi, how are you man? Hope your getting better from the last time I heard from you.

 

See, at the moment I'm wondering if this can even work for Jedi Outcast; playermodel command isn't in this game. Is there no way at all of execing a cfg file through a script...

i am little better, but pretty far again by the past.

mmm on JO is problematic because is not prevented that player can be changed... you play only as kyle for all game lol, so playermodel is not implemented.

but you can change the playermodel also in another way: by loading cvars models by menu before starting at level. is a lot complex and you need a custom creation of a menu screen. but should works also on JO i guess.

Link to comment
Guest Redemption

the Playermodel cheat work on JO on the consolle command for play like other NPCs?

I'm afraid not... But, I have made another way of changing playet model ingame. Check out my mods video clips on YouTube to see for yourself :Jedi Redemption v2 attire update into YouTube search.

Asgarath83 likes this
Link to comment
Guest Redemption

You have to set the script with a  SET_SKIN value, like this:


	set ( "SET_SKIN", "models/players/jedi_kdm/model_default.skin" );

Of course, in that example it would only work with the jedi_kdm model, otherwise it will end up looking odd.

 

@@Noodle @@Asgarath83

YYYYAAAAAASSSSSSSS!!!!!!!!!!!!!!! :D

 

I got it! What you posted above didn't work for me because... THERE wasn't a SET_SKIN command in Jedi Outcast. So, I just added it in ;)

I loaded up Kejim Post and walla, skin effect worked! I may add in the SET_PLAYERMODEL command to.

 

Thank you both very much, you both gave a lot of your time and I am grateful for you kindness.

 

Kind Regards 

Asgarath83 likes this
Link to comment

@@Noodle @@Asgarath83

YYYYAAAAAASSSSSSSS!!!!!!!!!!!!!!! :D

 

I got it! What you posted above didn't work for me because... THERE wasn't a SET_SKIN command in Jedi Outcast. So, I just added it in ;)

I loaded up Kejim Post and walla, skin effect worked! I may add in the SET_PLAYERMODEL command to.

 

Thank you both very much, you both gave a lot of your time and I am grateful for you kindness.

 

Kind Regards 

 

Good to know that you solved the problem!

Link to comment

@@Noodle @@Asgarath83

YYYYAAAAAASSSSSSSS!!!!!!!!!!!!!!! :D

 

I got it! What you posted above didn't work for me because... THERE wasn't a SET_SKIN command in Jedi Outcast. So, I just added it in ;)

I loaded up Kejim Post and walla, skin effect worked! I may add in the SET_PLAYERMODEL command to.

 

Thank you both very much, you both gave a lot of your time and I am grateful for you kindness.

 

Kind Regards 

lol, so was simply icarus up to date, these cheats and commands are already working on JO code? good to know.

bye :)

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...