Call of Duty 5: World at War => Tutorial Desk => Scripting => Topic started by: isaacscott935 on June 12, 2018, 05:27:10 pm
Title: Shootable teddy bears [UNORDERED] (for EE)
Post by: isaacscott935 on June 12, 2018, 05:27:10 pm
Hey guys
Yesterday I put up a tutorial on how to add a shootable model easter egg, so you can activate a door or play a song. That script only worked if you did the bears in order, which means you have to memorise where you placed the first, second and so on bears when testing it. Today, I bring you my own unordered shootable bears/any other model tutorial, which makes it a lot better. I was thinking about how to do this and I realised you must have different functions for each of the bears (this is the only way I could work out how to do it).
The first part of this tutorial (the radiant part) will just be copy&pasted from the tutorial I put up yesterday because there's no need for me to rewrite it.
PART 1: RADIANT
First, let's start off in radiant. Right click on your 2D window, and click script -> model. Find the zombie teddybear model. You can actually have this as any model, but I'll just use it (the model name for the bear is "zombie_teddybear"). You can place this anywhere in your map, as long as your player can see it.
Give this bear the KVP:
You can then duplicate the script_model to have as many as you like, but make sure you change the KVP each time:
So, my second one would look like:
etc.
Right click on your 2D window again and select trigger -> damage. Cover the bear with this trigger and hit N on your keyboard to give it KVPs. First, tick the box MELEE_NO (because we don't want to knife our bear). Then, add:
So my second trigger's KVP would look like:
etc.
Make sure you cover all of your bears with the trigger_damage and make sure all the KVPs are different.
PART 2: SCRIPTING
As I said, this scripting part is different.
Go to your mapname\maps\mapname.gsc file and open it.
About line 130, you'll find:
Underneath that, put in:
This calls all of the functions that we are going to create.
Now, at the bottom of your file, paste:
and underneath that, paste:
You may notice that each function contains an IF statement, which contains . We have not defined that function yet, so that's what we're going to do. So, paste this underneath your other functions:
This code is finished. Check that your targetnames are the same in the script as they are in the radiant triggers/models.
Again, this code:
allows a song to be played once all bears have been shot. You can add your own music; there are plenty of tutorials on that.
Enjoy. If there are any mistakes please mention it :D
Title: Re: Shootable teddy bears [UNORDERED] (for EE)
Post by: cpt_johnson1 on October 22, 2018, 06:57:13 pm
So I did everything and I made it give me a gun instead of a song, but right when I load up my map, it says that I shot the teddy bears and it gives me the gun. Do you know how to fix this? Never mind, I got it working, I messed up the targetnames. I'll make sure to give you credit when my map releases
Title: Re: Shootable teddy bears [UNORDERED] (for EE)
Post by: killadumb on July 08, 2019, 02:24:58 pm
The finished bears_complete() thread triggers when I start the game. Not after I do what I setup. Any help?
Title: Re: Shootable teddy bears [UNORDERED] (for EE)
Post by: cpt_johnson1 on July 12, 2019, 06:42:46 pm
The finished bears_complete() thread triggers when I start the game. Not after I do what I setup. Any help?
This happened to me, and it was because I messed up the targetnames on the bears. Make sure you check all of the kvp's carefully
Title: Re: Shootable teddy bears [UNORDERED] (for EE)
Post by: Stiffy on March 27, 2020, 04:34:11 am
How do i use this to open a door?
Title: Re: Shootable teddy bears [UNORDERED] (for EE)
Post by: bonse2000 on May 31, 2020, 07:10:20 am
i need help when i run build a take error MODSound -pc -ignore_orphans error2057
please i need help i have make your teddy bear shootable script it is work thank you but i want put music haow can i do it have see tutorials but nothing please help
Title: Re: Shootable teddy bears [UNORDERED] (for EE)
Post by: klevi on June 18, 2020, 12:07:27 pm
i need help when i run build a take error MODSound -pc -ignore_orphans error2057
please i need help i have make your teddy bear shootable script it is work thank you but i want put music haow can i do it have see tutorials but nothing please help
since the script is works then only the sound remains to be correctly added, literally convert your sound properly in audacity at unsigned 8bit PC or signed 16bit PC. Then put your sound in sound_assets/raw/sound/ there or make a folder there, and make sure that you properly call that sound it its soundalias, then just open launccher, click build mod ff and build sounds, and after building these go and grab your converted sound in raw/sound folder(if i remember correctly) and put it in your mod folder. Build your mod normally as you would do after that, FF and IWD and make sure you tick the new files in launcher on the right side, Done! krimp
Title: Re: Shootable teddy bears [UNORDERED] (for EE)
Post by: GimmCity on July 23, 2020, 10:25:50 pm
So I did everything and I made it give me a gun instead of a song, but right when I load up my map, it says that I shot the teddy bears and it gives me the gun. Do you know how to fix this? Never mind, I got it working, I messed up the targetnames. I'll make sure to give you credit when my map releases
can u tell me how ? or how i can make a door opens when i shoot the teddys... ?
Title: Re: Shootable teddy bears [UNORDERED] (for EE)
Post by: cpt_johnson1 on July 24, 2020, 02:00:21 pm
Its the trigger for the door, which I used for a hintstring and to activate the zone. It may be kinda sloppy as I am not a scripter, but it works lol
nice :Dcan u add me on discord ? maybe we can write there :D do u maybe know how i can import an animatet model in radiant that works, maybe an hanging cloth thats animated..... like in the map clinic of evil..
Title: Re: Shootable teddy bears [UNORDERED] (for EE)
Post by: cpt_johnson1 on July 25, 2020, 05:45:00 am
nice :Dcan u add me on discord ? maybe we can write there :D do u maybe know how i can import an animatet model in radiant that works, maybe an hanging cloth thats animated..... like in the map clinic of evil..
Sorry but I can't help you there. I dont really know much about porting and animating stuff haha
Title: Re: Shootable teddy bears [UNORDERED] (for EE)
Post by: GimmCity on July 25, 2020, 06:04:29 am