Call of Duty 5: World at War => Help Desk => Scripting => Topic started by: Sounder1995 on September 10, 2016, 01:52:43 am
Title: Infinite Damage Weapon
Post by: Sounder1995 on September 10, 2016, 01:52:43 am
Hello. I'm trying to create my own infinite damage weapon that fires hitscans, but I can't quite figure out how to script it in. Here's what I've been trying:
Inside nazi_zombie_my_mapname.gsc, inside main() at the very bottom, I have
I then go on to define infinite_damage() at the bottom of the .gsc file as follows:
Anyone know how to properly script this?
Title: Re: Infinite Damage Weapon
Post by: BluntStuffy on September 10, 2016, 02:49:52 am
self is 'level' here not a player or a zombie so that where things start to go wrong
Title: Re: Infinite Damage Weapon
Post by: BuIlDaLiBlE on September 10, 2016, 10:22:23 am
"level" is a global function here, yea? I know with vars they are global if you use level on them, but what about functions?
Not sure what you mean, but he threaded his function from main() in his mapname.gsc. The main() function is called by 'level' so if you refer to self in there you refer to the level var. If you mean that by using 'level.' you make a var global, and 'level' itself is also global but you cant use a function global if you thread/call it with 'level'
To the OP, for the wepaon you could do something like this ( or just set the damage really high in the weapon file ? ) You could also add your code in _spawner in the gib_on_damage function, that's allready watching each zomb for damage so it's easy to add in there as well.
From your mapname.gsc main() thread this:
And then add these functions:
Title: Re: Infinite Damage Weapon
Post by: Sounder1995 on September 10, 2016, 12:49:23 pm
Not sure what you mean, but he threaded his function from main() in his mapname.gsc. The main() function is called by 'level' so if you refer to self in there you refer to the level var. If you mean that by using 'level.' you make a var global, and 'level' itself is also global but you cant use a function global if you thread/call it with 'level'
To the OP, for the wepaon you could do something like this ( or just set the damage really high in the weapon file ? ) You could also add your code in _spawner in the gib_on_damage function, that's allready watching each zomb for damage so it's easy to add in there as well.
From your mapname.gsc main() thread this:
And then add these functions:
Hooray! It worked! Thanks for the help, BluntStuffy! :) Haven't seen you in SpiderBite's stream in a long time. Hope everything's going alright.
Title: Re: Infinite Damage Weapon
Post by: BuIlDaLiBlE on September 10, 2016, 12:55:57 pm