Will the randomize script work with Textures.
Moderator: Moderators
- swado95
- Rebel Warrant Officer
- Posts: 304
- Joined: Wed Apr 08, 2009 7:36 am
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Where I whant to be.
Will the randomize script work with Textures.
I thinks its reps randomize script but im not sure. But anyways I was wondering if I could set it up so my guy has a different skin each time he spawns using the script. If this is possible how?
-
- Space Ranger
- Posts: 2512
- Joined: Sat Nov 22, 2008 1:50 pm
- Projects :: Life. Work.
- xbox live or psn: No gamertag set
- Location: Washington, US
Re: Will the randomize script work with Textures.
No, but you could load a different unit with a different skin every time.swado95 wrote:I thinks its reps randomize script but im not sure. But anyways I was wondering if I could set it up so my guy has a different skin each time he spawns using the script. If this is possible how?
- lucasfart
- Sith
- Posts: 1440
- Joined: Tue Feb 24, 2009 5:32 am
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Australia
Re: Will the randomize script work with Textures.
related to this, is it possible to have one unit selectable in the list, say a local of some sort, but upon spawning in, it randomly selects a skin/unit. I would only want it to show up once in the list, as one unit, but to have a random skin for each unit.....is this possible?
- Fiodis
- Master of the Force
- Posts: 4145
- Joined: Wed Nov 12, 2008 9:27 pm
- Projects :: Rannoch + Tientia + Tools Programming
Re: Will the randomize script work with Textures.
You can force spawn the player as a specific class, and you can have the LUA select this class at random. I'm not sure if it has to be a class in the SetupTeams section, or just one previously loaded in the LUA.
-
- Imperial Systems Expert
- Posts: 2381
- Joined: Wed Mar 25, 2009 4:15 pm
- Projects :: A secret project
Re: Will the randomize script work with Textures.
SetClassProperty doesn't affect units already spawned right?
maybe make a loop that cycles through SetClassProperty calls so when someone spawns, they get different skins.
maybe make a loop that cycles through SetClassProperty calls so when someone spawns, they get different skins.
- lucasfart
- Sith
- Posts: 1440
- Joined: Tue Feb 24, 2009 5:32 am
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Australia
Re: Will the randomize script work with Textures.
I get the general gist of what you're saying, kinetos, but i have no idea how to write that into the lua.
I'm guessing it goes something like this.
Checks if the player/ai is a certain unit. if they are, commence the function which randomly selects a skin(using override texture function?).
I'm guessing it goes something like this.
Checks if the player/ai is a certain unit. if they are, commence the function which randomly selects a skin(using override texture function?).
-
- Imperial Systems Expert
- Posts: 2381
- Joined: Wed Mar 25, 2009 4:15 pm
- Projects :: A secret project
Re: Will the randomize script work with Textures.
I'm actually trying to get it to work right now, but a timer that loops overandover is supposed to check a counter variable, set the class property to the apporopriate model, increment the counter. if the counter gets too high, set it to the first one.
except im having trouble getting the counter to change
except im having trouble getting the counter to change
- lucasfart
- Sith
- Posts: 1440
- Joined: Tue Feb 24, 2009 5:32 am
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Australia
Re: Will the randomize script work with Textures.
Good luck getting that to work Kinetos. It would be a great help if you could post it here when you find out...
http://www.gametoast.com/forums/viewtop ... 4&start=20
Maybe have a look at this script? i don't know much about scripting but i thought it looked helpful.kinetosimpetus wrote:I'm actually trying to get it to work right now, but a timer that loops overandover is supposed to check a counter variable, set the class property to the apporopriate model, increment the counter. if the counter gets too high, set it to the first one.
except im having trouble getting the counter to change
http://www.gametoast.com/forums/viewtop ... 4&start=20
-
- Imperial Systems Expert
- Posts: 2381
- Joined: Wed Mar 25, 2009 4:15 pm
- Projects :: A secret project
Re: Will the randomize script work with Textures.
it works now 
ok, here is the chunk of code, goes inside SciptPostLoad
interval is the number of seconds between model changes
maxskin is the number of versions to use

ok, here is the chunk of code, goes inside SciptPostLoad
interval is the number of seconds between model changes
maxskin is the number of versions to use
Hidden/Spoiler:
- Teancum
- Jedi Admin
- Posts: 11080
- Joined: Wed Sep 07, 2005 11:42 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Indiana
Re: Will the randomize script work with Textures.
I'm confused - doesn't SetClassProperty() only work on newly spawned units? Or are you just randomizing at spawn?
-
- Imperial Systems Expert
- Posts: 2381
- Joined: Wed Mar 25, 2009 4:15 pm
- Projects :: A secret project
Re: Will the randomize script work with Textures.
Yes, that is what I'm doing.
New spawning units will take the changes. Currently deployed units will not.
New spawning units will take the changes. Currently deployed units will not.
- Teancum
- Jedi Admin
- Posts: 11080
- Joined: Wed Sep 07, 2005 11:42 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Indiana
Re: Will the randomize script work with Textures.
Ah -- still it's a slick little script. Nice work 

- lucasfart
- Sith
- Posts: 1440
- Joined: Tue Feb 24, 2009 5:32 am
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Australia
Re: Will the randomize script work with Textures.
Awesome Kinetos! this is an extremely handy little script. Do you think this could be put in the FAQ? people should definitely use this...
Just to confirm a few parts of this, the max skin defines how many different skin numbers to choose from. Does interval have to be a full number, or can you make it 0.5 for example......
And to make this cycle skins, would you use something along these lines?
SetProperty("unit_name_here", "OverrideTexture", "skin_name_here")
Will that work? or would i need to reference a new model with the relevant texture every time?
apart from that, it looks pretty simple to understand.
Brilliant work Kinetos!
Just to confirm a few parts of this, the max skin defines how many different skin numbers to choose from. Does interval have to be a full number, or can you make it 0.5 for example......
And to make this cycle skins, would you use something along these lines?
SetProperty("unit_name_here", "OverrideTexture", "skin_name_here")
Will that work? or would i need to reference a new model with the relevant texture every time?
apart from that, it looks pretty simple to understand.
Brilliant work Kinetos!

-
- Imperial Systems Expert
- Posts: 2381
- Joined: Wed Mar 25, 2009 4:15 pm
- Projects :: A secret project
Re: Will the randomize script work with Textures.
maxskin: yes this is the number of configurations to use, inside the if()then...end block goes 1 config, you can change one or many units within one block, with as many blocks as you want configs, the maxskin should equal the number of configs
interval: idk, try it.
override: yes, if the model supports it, the ovveride should work.
Dont change any weapon slots or gameplay properties, they may crash Mp, but geometry and addon mesh at least can be changed this way and work fine in mp.
interval: idk, try it.
override: yes, if the model supports it, the ovveride should work.
Dont change any weapon slots or gameplay properties, they may crash Mp, but geometry and addon mesh at least can be changed this way and work fine in mp.
-
- Command Sergeant Major
- Posts: 293
- Joined: Thu Nov 26, 2009 9:10 pm
- Projects :: No Mod project currently.
- Location: location, location
Re: Will the randomize script work with Textures.
This is an intriguing concept.
-
- Master Bounty Hunter
- Posts: 1519
- Joined: Fri Dec 18, 2009 8:02 am
- Projects :: CTF Arenas
- Location: ¿uoıʇɐɔoן ʎɯ sıɥʇ sı
Re: Will the randomize script work with Textures.
WOW THANKS!
I can think of many uses for this...
Randomized civilians, anyone?
I can think of many uses for this...
Randomized civilians, anyone?
- impspy
- Captain
- Posts: 493
- Joined: Wed Dec 31, 2008 1:54 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Pax Empiricae; check WIP
Re: Will the randomize script work with Textures.
Nice work Kinetos, I am so using this in Pax Empiricae.
However, I was unable to get "OverrideTexture" to work; every ten seconds the skin cycled, but it also affected the already spawned units. Also, units with non-stock skeletons did not work, even if I added:
To both
functions; they always used the default human one.
Also, first person msh's cycled like "OverrideTexture".
I was however, able to successfully integrate the random models
However, I was unable to get "OverrideTexture" to work; every ten seconds the skin cycled, but it also affected the already spawned units. Also, units with non-stock skeletons did not work, even if I added:
Code: Select all
SetProperty("unit_name_here", "SkeltonName", "skeleton_name_here")
Code: Select all
if (skin == x) then
Also, first person msh's cycled like "OverrideTexture".
I was however, able to successfully integrate the random models

-
- Imperial Systems Expert
- Posts: 2381
- Joined: Wed Mar 25, 2009 4:15 pm
- Projects :: A secret project
Re: Will the randomize script work with Textures.
Hm, interesting. Good info impspy.
Re: Will the randomize script work with Textures.
This topic would be in the FAQ .
-
- Imperial Systems Expert
- Posts: 2381
- Joined: Wed Mar 25, 2009 4:15 pm
- Projects :: A secret project
Re: Will the randomize script work with Textures.
Hm, I just played with this in MP, and it worked for the host, but had no effect on the clients.
The setclassproperty lines called in the timer did not get used by the client, so their sides didn't change, I'm not sure why, but I'm guessing the timer didn't work, the other setclassproperty's outside the timer seemed to work.
The setclassproperty lines called in the timer did not get used by the client, so their sides didn't change, I'm not sure why, but I'm guessing the timer didn't work, the other setclassproperty's outside the timer seemed to work.