Call of Duty 5: World at War => Tutorial Desk => Scripting => Topic started by: isaacscott935 on June 11, 2018, 08:34:51 pm
Title: Shootable teddy bears [ORDERED] (for EE)
Post by: isaacscott935 on June 11, 2018, 08:34:51 pm
Hey guys
I created this script earlier today. This allows you to be able to shoot teddy bears in the map. NOTE:You must shoot the teddies in the order it is in the script. Make sure to remember where you put Bear1,bear2 etc in radiant so you can test 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
Go into mapname\maps\mapname.gsc.
I have created a function called shootable_bears(), so you need to write:
underneath
Next, at the bottom of your .GSC file, add your function:
NOTE: Make sure all of your targetnames in your script match the ones in your radiant file KVPs.
This code
is to add music once your teddies have been shot. I have not added music, hence the "insert_sound_here", but you can add a song to your map and play it using this code.
Enjoy If there are any mistakes please let me know
Title: Re: Shootable teddy bears (for EE)
Post by: gympie6 on June 12, 2018, 05:48:37 am
I created this script earlier today. I am just learning scripting, so it might not be the most exciting/complex tutorial but here we are. This basically allows you to be able to shoot teddy bears in the map.
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
Go into mapname\maps\mapname.gsc.
I have created a function called shootable_bears(), so you need to write:
underneath
Next, at the bottom of your .GSC file, add your function:
NOTE: Make sure all of your targetnames in your script match the ones in your radiant file KVPs.
This code
is to add music once your teddies have been shot. I have not added music, hence the "insert_sound_here", but you can add a song to your map and play it using this code.
Enjoy If there are any mistakes please let me know
I think this tutorial is working fine but I see a problem there, you really need to shoot the first teddybear before you can shoot the second. It can't be done otherwise.
Title: Re: Shootable teddy bears (for EE)
Post by: isaacscott935 on June 12, 2018, 06:14:37 am
Yes, I forgot to mention that. I’ll edit the original post. You have to remember which order you put them in the script and where you put them in radiant to test them.