UGX-Mods

Call of Duty 5: World at War => Help Desk => Scripting => Topic started by: KDXDARK on September 09, 2012, 11:08:45 pm

Title: [User Tutorial] Custom powerup(Speed, Unlimited ammo and God)
Post by: KDXDARK on September 09, 2012, 11:08:45 pm
Hi people i am DARKLEGION and this is a tutorial to add custom powerups, Thank's to Treminaor and Codmapper for the help.

1)_Go to raw/maps and copy the  _zombiemode_powerups.gsc to mods/mapname/maps .

2)_open in the line 48 you see this " // Random Drops " and down of that:
Code Snippet
Plaintext
	add_zombie_powerup( "nuke", 		"zombie_bomb",		&"ZOMBIE_POWERUP_NUKE", 			"misc/fx_zombie_mini_nuke" );
// add_zombie_powerup( "nuke", "zombie_bomb", &"ZOMBIE_POWERUP_NUKE", "misc/fx_zombie_mini_nuke_hotness" );
add_zombie_powerup( "insta_kill", "zombie_skull", &"ZOMBIE_POWERUP_INSTA_KILL" );
add_zombie_powerup( "double_points","zombie_x2_icon", &"ZOMBIE_POWERUP_DOUBLE_POINTS" );
add_zombie_powerup( "full_ammo",  "zombie_ammocan", &"ZOMBIE_POWERUP_MAX_AMMO");
add_zombie_powerup( "carpenter",  "zombie_carpenter", &"ZOMBIE_POWERUP_MAX_AMMO");
under the carpenter add this
Code Snippet
Plaintext
add_zombie_powerup( "unlimited_ammo", 	"aircraft_bomb", &"UNLIMITED_AMMO" );
add_zombie_powerup( "player_godmode", "zombie_brain", &"GODMODE" );
add_zombie_powerup( "speed", "char_jap_impinfwet_body4_g_lowclean", &"SPEED" );
3)_ go to the fuction " powerup_grab() "
under
Code Snippet
Plaintext
					case "carpenter":
level thread start_carpenter( self.origin );
players[i] thread powerup_vo("carpenter");
break;
add this
Code Snippet
Plaintext
		case "unlimited_ammo":
players[i] thread unlimited_ammo_powerup( self );
        break;
case "player_godmode":
                        players[i] thread player_godmode_powerup( self );
                        break;
case "speed":
                        players[i] thread speed( self );
                        break;

4)_now find this fuction  " nuke_flash() "
Code Snippet
Plaintext
nuke_flash()
{
players = getplayers();
for(i=0; i<players.size; i ++)
{
players[i] play_sound_2d("nuke_flash");
}
level thread devil_dialog_delay();


fadetowhite = newhudelem();

fadetowhite.x = 0;
fadetowhite.y = 0;
fadetowhite.alpha = 0;

fadetowhite.horzAlign = "fullscreen";
fadetowhite.vertAlign = "fullscreen";
fadetowhite.foreground = true;
fadetowhite SetShader( "white", 640, 480 );

// Fade into white
fadetowhite FadeOverTime( 0.2 );
fadetowhite.alpha = 0.8;

wait 0.5;
fadetowhite FadeOverTime( 1.0 );
fadetowhite.alpha = 0;

wait 1.1;
fadetowhite destroy();
}
and under that add this
Code Snippet
Plaintext
unlimited_ammo_powerup( drop_item, player_won )
{
level notify ("powerup unlimited ammo");
level endon ("powerup unlimited ammo");
self iPrintLnBold("^7Unlimited Ammo");
setsaveddvar ( "player_sustainammo",  1 );

wait ( 30 );

self iPrintLnBold("^7No More Unlimited Ammo");
setsaveddvar ( "player_sustainammo", 0 );
}
player_godmode_powerup( drop_item, player_won )
{
    level notify ("powerup player_godmode");
    level endon ("powerup player_godmode");
    self iPrintLnBold("^7GOD!");
    self EnableInvulnerability();
    wait  5;
self iPrintLnBold("^7NO MORE GOD!");
    self DisableInvulnerability();
}
speed( drop_item, player_won )
{
    level notify ("powerup speed");
    level endon ("powerup speed");
    self iPrintLnBold("^7Speed!!!");
    self setmovespeedscale(2.0);
    wait  15;
self iPrintLnBold("^7NO MORE SPEED!");
    self setmovespeedscale(1.0);
}
5)_ Go to raw/maps and open your mapname.gsc and add this in your main fuction

Code Snippet
Plaintext
    include_powerup( "unlimited_ammo" );
    include_powerup( "player_godmode" );
    include_powerup( "speed" );

Example

Code Snippet
Plaintext
    include_powerup( "unlimited_ammo" );
    include_powerup( "player_godmode" );
    include_powerup( "speed" );

maps\_zombiemode::main();

6)_ Go to Zone_source and open your mapname.csv and add this in the end of it
Code Snippet
Plaintext
xmodel,zombie_brain
xmodel,aircraft_bomb
xmodel,char_jap_impinfwet_body4_g_lowclean

7)_compile all your map and test it!

ENJOY  :troll:

(if you got a error post here and wait for my response)
possible error in the GOD POWERUP fuction
Title: Re: [User Tutorial] Custom powerup(Speed, Unlimited ammo and God)
Post by: Chunkdogg9 on September 10, 2012, 01:51:11 am
testing it out now hope it works :D

::EDIT::

It didnt work just says script compile error

i did everything you said to do an didnt work
Title: Re: [User Tutorial] Custom powerup(Speed, Unlimited ammo and God)
Post by: SajeOne on September 10, 2012, 02:18:30 am
epic, death machine is being made into power up now ;)
Title: Re: [User Tutorial] Custom powerup(Speed, Unlimited ammo and God)
Post by: Chunkdogg9 on September 10, 2012, 03:14:17 am
i can't even load my map now  >:(
Title: Re: [User Tutorial] Custom powerup(Speed, Unlimited ammo and God)
Post by: treminaor on September 10, 2012, 05:15:16 am
Once someone reports this as working, I will sticky it. Until then, help Chunkdogg9 out .
Title: Re: [User Tutorial] Custom powerup(Speed, Unlimited ammo and God)
Post by: Chunkdogg9 on September 10, 2012, 05:37:51 am
i replaced my DLC3_Code thing with the download you provided im guessing i wasn't suppose to do that?
Title: Re: [User Tutorial] Custom powerup(Speed, Unlimited ammo and God)
Post by: treminaor on September 10, 2012, 05:48:16 am
i replaced my DLC3_Code thing with the download you provided im guessing i wasn't suppose to do that?
You're supposed to put it in your mods folder, not replace the one in /raw/.

Here's the original, restore the one in raw with this one: https://dl.dropbox.com/u/7345145/dlc3_code.rar

Title: Re: [User Tutorial] Custom powerup(Speed, Unlimited ammo and God)
Post by: Chunkdogg9 on September 10, 2012, 05:57:19 am
so just drop it in the where the one in raw is? and replace it?
Title: Re: [User Tutorial] Custom powerup(Speed, Unlimited ammo and God)
Post by: treminaor on September 10, 2012, 05:58:21 am
so just drop it in the where the one in raw is? and replace it?
Yes the one I just gave you is the original file. Overwrite your /raw/maps/dlc3_code with that one. Put the DARKLEGION dlc3_code in /mods/YOURMODNAME/maps
Title: Re: [User Tutorial] Custom powerup(Speed, Unlimited ammo and God)
Post by: SajeOne on September 10, 2012, 06:05:15 am
darklegion it would help if i knew what you edited in dlc3_code
Title: Re: [User Tutorial] Custom powerup(Speed, Unlimited ammo and God)
Post by: treminaor on September 10, 2012, 07:02:48 am
darklegion it would help if i knew what you edited in dlc3_code
Yes you should never have to download script files unless they are new files. Modifications should all be documented.
Title: Re: [User Tutorial] Custom powerup(Speed, Unlimited ammo and God)
Post by: Chunkdogg9 on September 10, 2012, 09:12:46 am
yea this doesnt work i tried doing it after fixing it up and nothing game just freeze's on the load screen :lol: 
Title: Re: [User Tutorial] Custom powerup(Speed, Unlimited ammo and God)
Post by: YaPh1l on September 10, 2012, 11:38:34 am
Only thing changed in dlc3_code is the include_powerups(9 function:
Code Snippet
Plaintext
include_powerups()
{
include_powerup( "nuke" );
include_powerup( "insta_kill" );
include_powerup( "double_points" );
include_powerup( "full_ammo" );
include_powerup( "carpenter" );
speed( "carpenter" );
unlimited_ammo( "carpenter" );
player_godmode( "carpenter" );
}
Which should more look like this:
Code Snippet
Plaintext
include_powerups()
{
include_powerup( "nuke" );
include_powerup( "insta_kill" );
include_powerup( "double_points" );
include_powerup( "full_ammo" );
include_powerup( "carpenter" );
include_powerup( "unlimited_ammo" );
include_powerup( "player_godmode" );
include_powerup( "speed" );
}
You do not even need the modified dlc3_code.gsc, you could use the stock one and add the three new include_powerup() calls in your mapname.gsc.
EDIT: @SajeOne, I already scripted the death machine powerup :troll: .

- Phil.
Title: Re: [User Tutorial] Custom powerup(Speed, Unlimited ammo and God)
Post by: KDXDARK on September 10, 2012, 01:28:04 pm
edited the post, i can give too much support beacause i am not in my computer, this night possible update and fix
Title: Re: [User Tutorial] Custom powerup(Speed, Unlimited ammo and God)
Post by: Chunkdogg9 on September 11, 2012, 03:18:49 am
So what do the power ups look like?
Title: Re: [User Tutorial] Custom powerup(Speed, Unlimited ammo and God)
Post by: KDXDARK on September 11, 2012, 01:44:46 pm
So what do the power ups look like?
The model of the powerup?

Bottle= Speed
Bomb= Unlimited ammo
Brain= God
Title: Re: [User Tutorial] Custom powerup(Speed, Unlimited ammo and God)
Post by: Chunkdogg9 on October 03, 2012, 04:14:35 am
So does this work now?
Title: Re: [User Tutorial] Custom powerup(Speed, Unlimited ammo and God)
Post by: SajeOne on October 03, 2012, 04:22:58 am
So does this work now?
its always worked, you can use this tutorial to make your own powerups. its a template you can use.
Title: Re: [User Tutorial] Custom powerup(Speed, Unlimited ammo and God)
Post by: Chunkdogg9 on October 03, 2012, 04:25:35 am
If I knew how to make my own custom perks would be great but don't know how to
Title: Re: [User Tutorial] Custom powerup(Speed, Unlimited ammo and God)
Post by: treminaor on October 03, 2012, 05:29:54 am
If I knew how to make my own custom perks would be great but don't know how to
That's a conceptual skill, not a tutorial skill :)
Title: Re: [User Tutorial] Custom powerup(Speed, Unlimited ammo and God)
Post by: SajeOne on October 03, 2012, 06:09:08 am
If I knew how to make my own custom perks would be great but don't know how to
lol theres a tutorial here, open it up and figure out how it works :P
Title: Re: [User Tutorial] Custom powerup(Speed, Unlimited ammo and God)
Post by: Chunkdogg9 on October 03, 2012, 10:21:51 pm
Do I just change the xmodel of each power up to make a different model show when the power up is there?

Is there a way to make my own custom power up model?

How would I goin about adding the little picture in middle at the bottom like x2?
Title: Re: [User Tutorial] Custom powerup(Speed, Unlimited ammo and God)
Post by: SajeOne on October 03, 2012, 11:33:53 pm
Do I just change the xmodel of each power up to make a different model show when the power up is there?

Is there a way to make my own custom power up model?

How would I goin about adding the little picture in middle at the bottom like x2?
if you look here:
Code Snippet
Plaintext
	// Random Drops
add_zombie_powerup( "nuke", "zombie_bomb", &"ZOMBIE_POWERUP_NUKE", "misc/fx_zombie_mini_nuke" );
// add_zombie_powerup( "nuke", "zombie_bomb", &"ZOMBIE_POWERUP_NUKE", "misc/fx_zombie_mini_nuke_hotness" );
add_zombie_powerup( "insta_kill", "zombie_skull", &"ZOMBIE_POWERUP_INSTA_KILL" );
add_zombie_powerup( "double_points","zombie_x2_icon", &"ZOMBIE_POWERUP_DOUBLE_POINTS" );
add_zombie_powerup( "full_ammo",  "zombie_ammocan", &"ZOMBIE_POWERUP_MAX_AMMO");
add_zombie_powerup( "carpenter",  "zombie_carpenter", &"ZOMBIE_POWERUP_MAX_AMMO");
in _zombiemode_powerups you can see all the powerups, all you need to do is copy the line and redo it to fit your powerup, heres an example
Code Snippet
Plaintext
	// Random Drops
add_zombie_powerup( "nuke", "zombie_bomb", &"ZOMBIE_POWERUP_NUKE", "misc/fx_zombie_mini_nuke" );
// add_zombie_powerup( "nuke", "zombie_bomb", &"ZOMBIE_POWERUP_NUKE", "misc/fx_zombie_mini_nuke_hotness" );
add_zombie_powerup( "insta_kill", "zombie_skull", &"ZOMBIE_POWERUP_INSTA_KILL" );
add_zombie_powerup( "double_points","zombie_x2_icon", &"ZOMBIE_POWERUP_DOUBLE_POINTS" );
add_zombie_powerup( "full_ammo",  "zombie_ammocan", &"ZOMBIE_POWERUP_MAX_AMMO");
add_zombie_powerup( "carpenter",  "zombie_carpenter", &"ZOMBIE_POWERUP_MAX_AMMO");
        add_zombie_powerup( "infinite_ammo",  "zombie_teddybear", "Infinite Ammo");
the model for the powerup is "zombie_teddybear" and the name of the powerup is "infinite_ammo"
to add the shader look for "shader_2x" and use the two lines there as reference on how to make yours, that is not all you need to do though. Look through the code and see what does what, Darklegion's tutorial GSC might have the shader code in it that you can look at to see what he added, hope this helps a little.
Title: Re: [User Tutorial] Custom powerup(Speed, Unlimited ammo and God)
Post by: w4d3 on October 22, 2012, 08:25:26 pm
This tutorial does work

worked first start but couldnt see the models just the shinney glow

for some reason i had to add the xmodels in my fast file  mod csv to get them to show up in game but i think thats a issue on my end

Title: Re: [User Tutorial] Custom powerup(Speed, Unlimited ammo and God)
Post by: haxman123 on October 25, 2012, 11:49:47 pm
Very usefull good job :D