Call of Duty 5: World at War => Help Desk => Scripting => Topic started by: HitmanVere on June 12, 2015, 10:18:46 pm
Title: MOTD grenade disposal
Post by: HitmanVere on June 12, 2015, 10:18:46 pm
I was thinking of doing MOTD grenade disposal system, but more "futuristic". I know how to give players points with But how would I go with trigger noticing grenades and then deleting them?
Title: Re: MOTD grenade disposal
Post by: Andy Whelan on June 12, 2015, 10:31:44 pm
I was thinking of doing MOTD grenade disposal system, but more "futuristic". I know how to give players points with But how would I go with trigger noticing grenades and then deleting them?
This was the script I wanted as well but I forgot about it, lol
Title: Re: MOTD grenade disposal
Post by: Harry Bo21 on June 12, 2015, 10:43:01 pm
i did this with cherry
player.score += 20; then some function about the hud from zombiemode_score ();
Title: Re: MOTD grenade disposal
Post by: HitmanVere on June 12, 2015, 10:56:01 pm
i cant remember exactly, but if you take a look at the better script, in there it shows you how to reference the betty itself
Otherwise i will look into it when i get back home, prob wont be too hard to get what you want
were talking about the pit under the first dogs head in motd right?
Yes, that thing. Dunno, if betty script would work, since in same script it sets it, but in this the model is set in weaponfile
Title: Re: MOTD grenade disposal
Post by: Harry Bo21 on June 12, 2015, 11:39:34 pm
The betty model in the file isnt used, but it still exists. They just set a "fake model" in the same place as the original placed model is, not sure why
but i remember you could access teh grenade that you fired
like :
grenade detonate()
would make it explode, grenade delete(), would just remove it, but you have to do the waittill before it correctly ( I would show you what i mean but im on my work pc, not at home ;) ), thats the only part youll need from the betty script
Title: Re: MOTD grenade disposal
Post by: lilrifa on June 13, 2015, 12:04:55 am
If you thread that function in your mapname.gsc, it should wait until you've thrown a grenade, and then it should check for a grenade hitting the trigger. After the grenade hits, it will both delete the grenade so that it does not explode, and give the player 20 points.
Edit: Make sure to thread it on a player
Title: Re: MOTD grenade disposal
Post by: HitmanVere on June 13, 2015, 12:10:19 am
If you thread that function in your mapname.gsc, it should wait until you've thrown a grenade, and then it should check for a grenade hitting the trigger. After the grenade hits, it will both delete the grenade so that it does not explode, and give the player 20 points.
Will test this tomorrow, thanks. Although I dont get this part: Do I change that and also in function name?
Title: Re: MOTD grenade disposal
Post by: lilrifa on June 13, 2015, 12:12:26 am
I used trigger_targetname as a variable, so you can pass different triggers through the function. Just change it from trigger_targetname to the targetname of your trigger in the watch_for_grenade() function, and you should be all set.
Title: Re: MOTD grenade disposal
Post by: HitmanVere on June 13, 2015, 12:15:29 am
I used trigger_targetname as a variable, so you can pass different triggers through the function. Just change it from trigger_targetname to the targetname of your trigger in the watch_for_grenade() function, and you should be all set.
Alright, thanks, will test tomorrow
Title: Re: MOTD grenade disposal
Post by: Harry Bo21 on June 13, 2015, 01:33:05 am
^ and thats the part i was searching for :)
"grenade" will then reference that object for the rest of that function :)
Title: Re: MOTD grenade disposal
Post by: lilrifa on June 13, 2015, 01:40:04 am
Sorry, that script was more adjusted for Black Ops. Here's one that's more World at War oriented.
Title: Re: MOTD grenade disposal
Post by: MZslayer11 on June 13, 2015, 01:58:11 am
*bookmarks for later use*
Title: Re: MOTD grenade disposal
Post by: lilrifa on June 13, 2015, 03:09:49 am
If you do use it, make sure to credit me please. Also, if you need any script requests, I may be able to help.
I may just be using the part that disables the grenade if it touches the trigger, for the lava on town. If I use any part of the script I will definitely give you credit. ;)
Title: Re: MOTD grenade disposal
Post by: lilrifa on June 13, 2015, 03:47:32 am
I may just be using the part that disables the grenade if it touches the trigger, for the lava on town. If I use any part of the script I will definitely give you credit. ;)
Thanks, man!
Title: Re: MOTD grenade disposal
Post by: DidUknowiPwn on June 13, 2015, 07:31:22 am
What's this grenade disposal you speak of
Title: Re: MOTD grenade disposal
Post by: Harry Bo21 on June 13, 2015, 08:01:48 am
the pit thing in MOTD, you throw grenades in it, they burn up and give you 20 points for each one thrown
same pit you throw the axe in to upgrade it
Title: Re: MOTD grenade disposal
Post by: HitmanVere on June 13, 2015, 09:01:00 am
I tested it, and it worked for me. Double Post Merge: June 13, 2015, 09:21:39 amI threaded it after _zombiemode::main() by doing
And the two functions are at the bottom of my mapname.gsc
Alright, iPrints do show now, but grenade does not get removed nor does it give points Edit: Doesnt print Deleting grenade either Another edit: It works on certain angle 0_0
Title: Re: MOTD grenade disposal
Post by: lilrifa on June 13, 2015, 09:37:58 am
I noticed that as well, however I could not resolve the issue.
Title: Re: MOTD grenade disposal
Post by: HitmanVere on June 13, 2015, 09:38:54 am