UGX-Mods

Call of Duty 5: World at War => Help Desk => Scripting => Topic started by: Dust on January 25, 2016, 11:07:27 pm

Title: How to spawn Grenades
Post by: Dust on January 25, 2016, 11:07:27 pm
I am trying to figure out how to spawn grenades, like the origins dig sites, but cant figure out how to.

I looked through the scripting reference and saw this http://ugx-mods.com/script/#core.Weapons.magicGrenade (http://ugx-mods.com/script/#core.Weapons.magicGrenade)

I am unsure if this is what I need, but I tried messing with it and did not work.

Any help?
Title: Re: How to spawn Grenades
Post by: BluntStuffy on January 25, 2016, 11:28:06 pm
Quote
Summary

Creates a "Magic" grenade from an actor

Only way i got that to work is by calling it on a zombie, dont think you can just call it on any ent.
Title: Re: How to spawn Grenades
Post by: Dust on January 25, 2016, 11:58:39 pm
Only way i got that to work is by calling it on a zombie, dont think you can just call it on any ent.

Is there a substitute for this? That can be called on any ent.
Title: Re: How to spawn Grenades
Post by: MakeCents on January 26, 2016, 12:01:03 am
You could make your own. Spawn model, set to grenade, apply physics slightly, play a sound, do a radius damage... Play fx
Title: Re: How to spawn Grenades
Post by: PROxFTW on January 26, 2016, 12:08:57 am
There is a command not in the scripting reference that exist in waw. I helped harry with this, it was magicgrenadetype of something along those lines. I'll look it up when I get home. I think it is magicgrenadetype, but I'm not at home so not fully sure.
Title: Re: How to spawn Grenades
Post by: Dust on January 26, 2016, 02:16:11 am
Building off of PROxFTW, I found this:

Code Snippet
Plaintext
Summary:
Creates a "Magic" grenade from an actor.


Call this on:
an Actor


Example:
self MagicGrenade( self.origin, target.origin, 2.0 );


Required Args:
1 : <origin> The starting point of the grenade toss
2 : <target position> The target point of the grenade toss


Optional Args
1 : <time to blow> The grenade fuse time in seconds

Ya thats what I originally looked at, but like Bluntstuffy said, you can only call it on an actor. Trying to find a way to spawn a grenade on any entity.
Title: Re: How to spawn Grenades
Post by: PROxFTW on January 26, 2016, 02:24:22 am
Building off of PROxFTW, I found this:

Code Snippet
Plaintext
Summary:
Creates a "Magic" grenade from an actor.


Call this on:
an Actor


Example:
self MagicGrenade( self.origin, target.origin, 2.0 );


Required Args:
1 : <origin> The starting point of the grenade toss
2 : <target position> The target point of the grenade toss


Optional Args
1 : <time to blow> The grenade fuse time in seconds
No that's something different, there is a function in waw not in any of the scripting reference that does what zombiekilla wants

Try MagicGrenadeType, I believe it is what I used to get it to work, I dont have the original file of which I used it so not sure
Code Snippet
Plaintext
Obj MagicGrenadeType( Grenade, OrginToSpawn, Velocity, Time  );
Grenade is the actual weapon file of the grenade you want to spawn
OriginToSpawn is quite obvious
Velocity is a vector as in ( x, y, z )
Time i am not so sure about I believe it is time to explode but not sure

Ex.
Code Snippet
Plaintext
Player MagicGrenadeType( "fraggrenade", Player.origin, ( 0, 0, 100 ), 1 );
This will spawn at player origin, should move 100 units up, and the 1 I dont know as far as what it represents.
Title: Re: How to spawn Grenades
Post by: Dust on January 26, 2016, 03:11:11 am
No that's something different, there is a function in waw not in any of the scripting reference that does what zombiekilla wants

Try MagicGrenadeType, I believe it is what I used to get it to work, I dont have the original file of which I used it so not sure
Code Snippet
Plaintext
Obj MagicGrenadeType( Grenade, OrginToSpawn, Velocity, Time  );
Grenade is the actual weapon file of the grenade you want to spawn
OriginToSpawn is quite obvious
Velocity is a vector as in ( x, y, z )
Time i am not so sure about I believe it is time to explode but not sure

Ex.
Code Snippet
Plaintext
Player MagicGrenadeType( "fraggrenade", Player.origin, ( 0, 0, 100 ), 1 );
This will spawn at player origin, should move 100 units up, and the 1 I dont know as far as what it represents.

If its the same as MagicGrenade then it will be the time it takes for the grenade to explode.

Thanks for this, will try it in a minute, and let you know what happens
Title: Re: How to spawn Grenades
Post by: Dust on January 26, 2016, 03:22:08 am
No that's something different, there is a function in waw not in any of the scripting reference that does what zombiekilla wants

Try MagicGrenadeType, I believe it is what I used to get it to work, I dont have the original file of which I used it so not sure
Code Snippet
Plaintext
Obj MagicGrenadeType( Grenade, OrginToSpawn, Velocity, Time  );
Grenade is the actual weapon file of the grenade you want to spawn
OriginToSpawn is quite obvious
Velocity is a vector as in ( x, y, z )
Time i am not so sure about I believe it is time to explode but not sure

Ex.
Code Snippet
Plaintext
Player MagicGrenadeType( "fraggrenade", Player.origin, ( 0, 0, 100 ), 1 );
This will spawn at player origin, should move 100 units up, and the 1 I dont know as far as what it represents.

It works perfectly. Thanks!

For reference later this is the script reference I use as I find the UGX one to be difficult in comparison: http://www.zeroy.com/script/ (http://www.zeroy.com/script/)

Also thanks for this website. Will take a look at it