UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

[TUTORIAL] EASY RANDOMIZED CHARACTERS (models + voices)

broken avatar :(
Created 10 years ago
by jei9363
0 Members and 1 Guest are viewing this topic.
4,585 views
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 16 June 2013
Last active: 1 year ago
Posts
1,005
Respect
Forum Rank
Zombie Colossus
Primary Group
Community Mapper
My Groups
More
My Contact & Social Links
More
Signature
Hey if you had tons of fun on playing my maps please DONATE :)

play ESTATE now, and claim your mansion back from the undead!
×
jei9363's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
jei9363's Contact & Social Linksjei9363jei9363jayingardia


go to _loadout.gsc

change

Code Snippet
Plaintext
switch( self.entity_num)
{
case 0:
character\char_zomb_player_0::main();
break;
case 1:
character\char_zomb_player_1::main();
break;
case 2:
character\char_zomb_player_2::main();
break;
case 3:
character\char_zomb_player_3::main();
break;
}

with

Code Snippet
Plaintext
players = get_players();

if(players.size > 1)
{

switch( self.entity_num)
{
case 0:
character\char_zomb_player_0::main();
break;
case 1:
character\char_zomb_player_1::main();
break;
case 2:
character\char_zomb_player_2::main();
break;
case 3:
character\char_zomb_player_3::main();
break;
}
}
else
{
self.body_select = randomint(4);

if(self.body_select == 0)
{
character\char_zomb_player_0::main();
self.entity_num_randomized = 0;
}

if(self.body_select == 1)
{
character\char_zomb_player_1::main();
self.entity_num_randomized = 1;
}

if(self.body_select == 2)
{
character\char_zomb_player_2::main();
self.entity_num_randomized = 2;
}

if(self.body_select == 3)
{
character\char_zomb_player_3::main();
self.entity_num_randomized = 3;
}

}


go to _zombiemode_weapons.gsc

replace

Code Snippet
Plaintext
get_player_index(player)
{
assert( IsPlayer( player ) );
assert( IsDefined( player.entity_num ) );
return player.entity_num;

}

with

Code Snippet
Plaintext
get_player_index(player)
{
assert( IsPlayer( player ) );
assert( IsDefined( player.entity_num ) );

players = get_players();

if(players.size == 1)
return player.entity_num_randomized;
else
return player.entity_num;

}



go into _zombiemode.gsc

go to
Code Snippet
Plaintext
spawn_vo()

change

Code Snippet
Plaintext
players = getplayers();

to

Code Snippet
Plaintext
players = get_players();
Last Edit: February 25, 2014, 07:10:19 am by jei9363
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 10 October 2013
Last active: 3 months ago
Posts
541
Respect
Forum Rank
Zombie Enslaver
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
ProGamerzFTW's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Works great, but there is a bug, after a few seconds of spawning in, the game freezes, detecting an infinite loop in a script, killing the thread.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 16 June 2013
Last active: 1 year ago
Posts
1,005
Respect
Forum Rank
Zombie Colossus
Primary Group
Community Mapper
My Groups
More
My Contact & Social Links
More
×
jei9363's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
jei9363's Contact & Social Linksjei9363jei9363jayingardia
the getplayers() change at the end of the tutorial is what fixed that for me
broken avatar :(
×
broken avatar :(
Constants and Variables
Location: us
Date Registered: 18 August 2013
Last active: 2 years ago
Posts
889
Respect
Forum Rank
The Decider
Primary Group
Box Mappers Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
The Worst Secret Agent Ever
Signature
×
MAK911's Groups
Box Mappers Elite
Box Mappers Elite
Banned Elite
Banned Elite
MAK911's Contact & Social Linksmkramrtmkramrt
You should seriously talk with @daedra descent He's been trying to get a random weapon spawn and cabinet working for ages and he'd probably appreciate your help.
broken avatar :(
×
broken avatar :(
Location: usbuffalo
Date Registered: 16 August 2013
Last active: 11 months ago
Posts
927
Respect
Forum Rank
The Decider
Primary Group
Community Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
Giggity.
Signature
maps:
Undead Town
http://ugx-mods.com/forum/index.php?topic=2294.0 (Release)
Origins 1922
http://ugx-mods.com/forum/index.php?topic=2659.0
[WIP] mapping 39%, weapons 85%, scripts 65%
[/url]
×
RamboBadass's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
RamboBadass's Contact & Social LinksAsk merambobadassRamboDaGreat
looks great will try it out later
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 10 October 2013
Last active: 3 months ago
Posts
541
Respect
Forum Rank
Zombie Enslaver
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
ProGamerzFTW's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
the getplayers() change at the end of the tutorial is what fixed that for me

Hmm not for me for some reason.

Edit: Fixed.

I added a
Code Snippet
Plaintext
wait 0.5;
at the top of the script

Code Snippet
Plaintext
get_player_index(player)
{
    assert( IsPlayer( player ) );
    assert( IsDefined( player.entity_num ) );
   
    players = get_players();
   
    if(players.size == 1)
    return player.entity_num_randomized;
    else
    return player.entity_num;
   
}
Last Edit: February 25, 2014, 07:21:04 pm by ProGamerzFTW
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 16 June 2013
Last active: 1 year ago
Posts
1,005
Respect
Forum Rank
Zombie Colossus
Primary Group
Community Mapper
My Groups
More
My Contact & Social Links
More
×
jei9363's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
jei9363's Contact & Social Linksjei9363jei9363jayingardia
awesome you got it to work.. I get tired of only hearing Dempey's voice, hope people start using this tut
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 10 October 2013
Last active: 3 months ago
Posts
541
Respect
Forum Rank
Zombie Enslaver
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
ProGamerzFTW's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
awesome you got it to work.. I get tired of only hearing Dempey's voice, hope people start using this tut

Yeah... right? :P I also put the players = get_players(); back to players = getplayers(); in spawn_vo() and still didnt freeze, so maybe that wasn't the source of the issue? :P
broken avatar :(
×
broken avatar :(
Location: es
Date Registered: 15 August 2013
Last active: 5 years ago
Posts
161
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Community Mapper
My Groups
More
Signature
Enjoy my work? Feel free to donate here to support me

Wanna become a Patron? Try my Patreon Page
×
sethnorris's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
sethnorris's Contact & Social Links
Exactly, how do you fix the infinite loop? I don't know where to put the: wait: 05
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 8 years ago
Posts
2,790
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
Signature
Let's keep this thread on topic from here on in. -DBZ

+1 to off-topic reply -DBZ

lmao. Too funny.

Goliath Script Placer: http://ugx-mods.com/forum/index.php/topic,11234.msg125257/topicseen.html#new

"...Christ, people. Learn C, instead of just stringing random characters
together until it compiles (with warnings)..."

-Linus Torvalds
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
You should seriously talk with @daedra descent He's been trying to get a random weapon spawn and cabinet working for ages and he'd probably appreciate your help.

I wasn't far off on the random weapon either, i was trying to randomize the array when i needed to randomize the "keys" of the array. The cabinet was a total fail because you can add whatever weapon you want to it without doing any script editing.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 10 October 2013
Last active: 3 months ago
Posts
541
Respect
Forum Rank
Zombie Enslaver
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
ProGamerzFTW's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Exactly, how do you fix the infinite loop? I don't know where to put the: wait: 05


I shortned the wait timer from 0.5 to 0.05 (there was a delay when u bought a perk), tested with no crashes for 30 rounds.

in _zombiemode_weapons.gsc

find

Code Snippet
Plaintext
get_player_index(player)

add

Code Snippet
Plaintext
wait .05;
at the top so it looks like

Code Snippet
Plaintext
get_player_index(player)
{
    wait .05;
    assert( IsPlayer( player ) );
    assert( IsDefined( player.entity_num ) );
   
    players = get_players();
    if(players.size == 1)
    return player.entity_num_randomized;
    else
    return player.entity_num;
}

Last Edit: March 02, 2014, 08:34:06 pm by ProGamerzFTW
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 18 August 2013
Last active: 10 years ago
Posts
2
Respect
Forum Rank
Fresh Corpse
Primary Group
Member
My Contact & Social Links
More
×
JoeyPins's Groups
JoeyPins's Contact & Social LinksJoe Pintagro
i am geting a bad syntax error for return player.entity_num;

any idea what i did wrong?
broken avatar :(
×
broken avatar :(
Location: de
Date Registered: 6 August 2012
Last active: 4 years ago
Posts
277
Respect
Forum Rank
Mr. Elemental
Primary Group
Community Scripter Elite
My Groups
More
×
YaPh1l's Groups
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
YaPh1l's Contact & Social Links
You probably made a mistake when copying it and deleted a bracket or something.

- Phil.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 18 August 2013
Last active: 10 years ago
Posts
2
Respect
Forum Rank
Fresh Corpse
Primary Group
Member
My Contact & Social Links
More
×
JoeyPins's Groups
JoeyPins's Contact & Social LinksJoe Pintagro
You probably made a mistake when copying it and deleted a bracket or something.

- Phil.

That was it.  HAHA no matter what forum Im on you are always there to fix my scripting screw ups lol.  Thanks!!!
broken avatar :(
  • steviewonder87
  • Deleted Member
×
broken avatar :(
steviewonder87
This user is deleted :(
How can you get it to randomize the hand models too?

I'm using Phil's specific handmodel for each character script but I want it so that if you're a certain character you will always have the corresponding handmodel, so not randomized as such, but matching...as it is I always spawn with player 1's hands no matter which character model I am...

Post Merge: March 12, 2014, 06:10:35 pm
No-one has any idea?
Last Edit: March 12, 2014, 06:10:35 pm by steviewonder87

 
Loading ...