UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

Can You Spawn A Grenade And Blow It Up With Spare Weapon Files And MagicBullet?

broken avatar :(
Created 8 years ago
by alaurenc9
0 Members and 1 Guest are viewing this topic.
2,679 views
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 30 December 2012
Last active: 9 months ago
Posts
577
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Signature
My preferred name is "xSanchez78".
Check me out here: www.steamcommunity.com/id/xSanchez78
×
alaurenc9's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
alaurenc9's Contact & Social LinksxSanchez78xSanchez78xSanchez78xSanchez78xSanchez78xSanchez78
So I am making the crossbow and scavenger, and so far all I have come up with on the explosion part is some scripted crap that might not be accurate. Then I thought, can I do this?

Code Snippet
Plaintext
	explosive_grenade = MagicBullet( explosion_weapon, model.origin, model.origin, self );
explosive_grenade Detonate( self );

model is the entity that is the crossbow dart, so model.origin is the explosion origin.
explosion_weapon would be a weapon file that is mostly blank and would only spawn a grenade when fired that blows up with all the right stats, etc. and would only be used for this.
self is the player.
If set up correctly, can I use this to simply trigger and explosion at that point?
Last Edit: December 17, 2015, 12:03:26 am by alaurenc9
broken avatar :(
×
broken avatar :(
Location: usUnion, Kentucky
Date Registered: 9 September 2013
Last active: 1 year ago
Posts
310
Respect
Forum Rank
Perk Hacker
Primary Group
Box Mappers Elite
My Groups
More
My Contact & Social Links
More
×
lilrifa's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Box Mappers Elite
Box Mappers Elite
lilrifa's Contact & Social Linksskypeuser724lilrifalilrifa
MagicGrenade() or MagicGrenadeManual()?
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 30 December 2012
Last active: 9 months ago
Posts
577
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
alaurenc9's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
alaurenc9's Contact & Social LinksxSanchez78xSanchez78xSanchez78xSanchez78xSanchez78xSanchez78
Both of those functions require being called on AI and are basically for making an AI throw a grenade and the grenade is somehow determined with the AI or something.... so those cannot help here. MagicBullet seems best here. The only thing is.... can you define the grenade or projectile like I do in this little chunk of code if the weapon file is set to shoot projectiles or grenades? I found this method used in Black Ops 2 but does it work in World at War? And if so, can you call Detonate(); on it? That's all I really want to know.
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 4 years ago
Posts
6,877
Respect
1,004Add +1
Forum Rank
Immortal
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Signature
If you want scripts / features made for you, then contact me by PM or email / skype etc
it will cost you tho so if you have no intention of reciprocating don't even waste my time ;)
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social Links[email protected]HarryBo21HarryBo000
Both of those functions require being called on AI and are basically for making an AI throw a grenade and the grenade is somehow determined with the AI or something.... so those cannot help here. MagicBullet seems best here. The only thing is.... can you define the grenade or projectile like I do in this little chunk of code if the weapon file is set to shoot projectiles or grenades? I found this method used in Black Ops 2 but does it work in World at War? And if so, can you call Detonate(); on it? That's all I really want to know.
actually they require a "entity"

player or ai, or anything infact. This is how i did the grenades for my dig sites

and firing projectiles "does" reference "the object it fired"

self waittill( "weapon_fired", grenade );

grenade = the grenade

and detonate works on that... Its down to how you set up the weaponfile its using

something along those lines
Last Edit: December 17, 2015, 02:44:31 am by Harry Bo21
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 30 December 2012
Last active: 9 months ago
Posts
577
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
alaurenc9's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
alaurenc9's Contact & Social LinksxSanchez78xSanchez78xSanchez78xSanchez78xSanchez78xSanchez78
actually they require a "entity"

player or ai, or anything infact. This is how i did the grenades for my dig sites

and firing projectiles "does" reference "the object it fired"

self waittill( "weapon_fired", grenade );

grenade = the grenade

and detonate works on that... Its down to how you set up the weaponfile its using

something along those lines

o wow rly u can define that stuff in "weapon_fired" waittill? I thought thats wut "grenade_fired" and "missile_fired" was for.

Anyways does this mean i can do

grenade = MagicBullet( whatever );

and if so, i can call Detonate(); on this?
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 4 years ago
Posts
6,877
Respect
1,004Add +1
Forum Rank
Immortal
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social Links[email protected]HarryBo21HarryBo000
no its "already" being passed, your just deciding what you wanna call it to refer to it, could call that anything, doesnt need to be grenade

look at the WW scripts from BO1 and 2

the staffs even use magic bullet, although i still havent got that working and lost interest

Code Snippet
Plaintext
self waittill( "grenade_fired", grenade );
wait .1;
grenade detonate();

cant remember which notify it is, but depends on the weapon file. So grenade_fired wont work on a bullet weapon or whatever. Make it a grenade type and this should work, and it should still be treated as primary and work otherwise as normal

Cant remember it exactly, but if you look through some of treyarchs weapons youll find it, used this for my TG and shield scripts

betties do something similar too, as they use a "fake" model, rather than the one in the weaponfile

i used this to have them place straight on to the floor instead of watching it drop to the floor, which seemed silly to me
Last Edit: December 17, 2015, 02:53:20 am by Harry Bo21
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 30 December 2012
Last active: 9 months ago
Posts
577
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
alaurenc9's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
alaurenc9's Contact & Social LinksxSanchez78xSanchez78xSanchez78xSanchez78xSanchez78xSanchez78
no its "already" being passed, your just deciding what you wanna call it to refer to it, could call that anything, doesnt need to be grenade

look at the WW scripts from BO1 and 2

the staffs even use magic bullet, although i still havent got that working and lost interest

Code Snippet
Plaintext
self waittill( "grenade_fired", grenade );
wait .1;
grenade detonate();

cant remember which notify it is, but depends on the weapon file. So grenade_fired wont work on a bullet weapon or whatever. Make it a grenade type and this should work, and it should still be treated as primary and work otherwise as normal

Cant remember it exactly, but if you look through some of treyarchs weapons youll find it, used this for my TG and shield scripts

betties do something similar too, as they use a "fake" model, rather than the one in the weaponfile

i used this to have them place straight on to the floor instead of watching it drop to the floor, which seemed silly to me

i think your missing the point of wut i'm trying to do. here to make it easier, ill paste my script in. whoever steals it, good for u i dont care:

Code Snippet
Plaintext
wait_for_crossbow_fired()
{
self endon( "disconnect" );
while( true )
{
self waittill( "missile_fire", missile, weapon );
switch( weapon )
{
case "zombie_crossbow":
self thread crossbow_fired( missile, false );
break;

case "zombie_crossbow_upgraded":
self thread crossbow_fired( missile, true );
break;
}
}
}

crossbow_fired( missile, is_upgraded )
{
if( is_upgraded )
{
beep_sound = "crossbow_beep_upgraded";
blink_fx = level._effect[ "crossbow_explosive_blink_upgraded" ];
trail_fx = level._effect[ "crossbow_explosive_trail_upgraded" ];
timer = 2.1;
radius = 100;
explosion_weapon = "zombie_crossbow_explode_upgraded";
}
else
{
beep_sound = "crossbow_beep_normal";
blink_fx = level._effect[ "crossbow_explosive_blink_normal" ];
trail_fx = level._effect[ "crossbow_explosive_trail_normal" ];
timer = 4.2;
radius = 100;
explosion_weapon = "zombie_crossbow_explode";
}
missile Hide();
model = Spawn( "script_model", missile.origin );
model SetModel( "t5_weapon_crossbow_bolt" );
model.angles = missile.angles;
model.owner = self;
trail_model = Spawn( "script_model", model GetTagOrigin( "tag_fx" ) );
trail_model SetModel( "tag_origin" );
trail_model.angles = model GetTagAngles( "tag_fx" );
trail_model LinkTo( model, "tag_fx", ( 0, 0, 0 ), ( 0, 0, 0 ) );
PlayFXOnTag( trail_fx, trail_model, "tag_origin" );
while( IsDefined( missile ) )
{
model.last_origin = model.origin;
model.origin = missile.origin;
model.last_angles = model.angles;
model.angles = missile.angles;
wait 0.05;
}
trail_model Delete();
impact_direction = VectorNormalize( model.origin - model.last_origin );
infront = model.origin + ( impact_direction * 10000 );
trace = BulletTrace( model.origin, infront, true, model );
if( IsDefined( trace[ "entity" ] ) )
{
model_list = [];
model_list[ model_list.size ] = trace[ "entity" ].model;
size = trace[ "entity" ] GetAttachSize();
for( i = 0; i < size; i ++ )
{
model_name = trace[ "entity" ] GetAttachModelName( i );
model_list[ model_list.size ] = model_name;
}
tag_list = [];
for( i = 0; i < model_list.size; i ++ )
{
num = GetNumParts( model_list[i] );
for( m = 0; m < num; m ++ )
{
tag_name = GetPartName( model_list[i], m );
tag_list[ tag_list.size ] = tag_name;
}
}
closest = tag_list[0];
dist = DistanceSquared( model.origin, trace[ "entity" ] GetTagOrigin( closest ) );
for( i = 1; i < tag_list.size; i ++ )
{
new_dist = DistanceSquared( model.origin, trace[ "entity" ] GetTagOrigin( tag_list[i] ) );
if( new_dist < dist )
{
closest = tag_list[i];
dist = new_dist;
}
}
model EnableLinkTo();
model LinkTo( trace[ "entity" ], closest );
model thread unlink_event( trace[ "entity" ], closest );
}
if( is_upgraded )
{
if( IsDefined( trace[ "entity" ] ) )
{
if( IsPlayer( trace[ "entity" ] ) )
{
model create_zombie_point_of_interest( 1536, 96, 10000, true );
}
else if( IsAI( trace[ "entity" ] ) )
{
if( IsAlive( trace[ "entity" ] ) )
{
trace[ "entity" ] thread monkey_bolt_taunts( model );
}
model create_zombie_point_of_interest( 1536, 96, 10000, true );
valid_poi = check_point_in_active_zone( model.origin );
if( !valid_poi )
{
valid_poi = check_point_in_playable_area( model.origin );
}
if( valid_poi )
{
model thread create_zombie_point_of_interest_attractor_positions( 4, 45 );
}
}
}
else
{
valid_poi = check_point_in_active_zone( model.origin );
if( !valid_poi )
{
valid_poi = check_point_in_playable_area( model.origin );
}
if( valid_poi )
{
model create_zombie_point_of_interest( 1536, 96, 10000, true );
model thread create_zombie_point_of_interest_attractor_positions( 4, 45 );
}
}
}
model PlaySound( beep_sound );
PlayFXOnTag( blink_fx, model, "tag_fx" );
bolt_indicator = NewClientHudElem( self );
bolt_indicator SetTargetEnt( model );
bolt_indicator SetShader( "hud_indicator_crossbow_explosive", 64, 64 );
bolt_indicator SetWayPoint( true, "hud_indicator_crossbow_explosive" );
if( Distance( self GetEye(), model.origin ) < radius )
{
bolt_indicator.alpha = 0.8;
is_hidden = false;
}
else
{
bolt_indicator.alpha = 0;
is_hidden = true;
}
start_time = GetTime();
while( GetTime() - start_time < timer * 1000 )
{
wait 0.05;
if( Distance( self GetEye(), model.origin ) < radius )
{
if( is_hidden )
{
bolt_indicator FadeOverTime( 0.25 );
bolt_indicator.alpha = 0.8;
is_hidden = false;
}
}
else
{
if( !is_hidden )
{
bolt_indicator FadeOverTime( 0.25 );
bolt_indicator.alpha = 0;
is_hidden = true;
}
}
}
bolt_indicator Destroy();
explosive_grenade = MagicBullet( explosion_weapon, model.origin, model.origin, self );
explosive_grenade Detonate( self );
model Delete();
}

so i want to use this magicbullet thing for the explosion when the crossbow bolt hits the end of the timer. I'm not trying to make a weapon or something that explodes on detonation or anything.
Last Edit: December 17, 2015, 02:59:05 am by alaurenc9
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 4 years ago
Posts
6,877
Respect
1,004Add +1
Forum Rank
Immortal
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social Links[email protected]HarryBo21HarryBo000
i thnk its you not getting me, as what you just posted is practically the same...

i was under the impression "missile_fired" didnt work on COD 5, if it does, sounds like thats what you need, but it wont use the same functions as grenades, so detonate proba bly doesnt apply

i dunno anyway, havent touched cod 5 in months, and dont intend to. have fun
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 30 December 2012
Last active: 9 months ago
Posts
577
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
alaurenc9's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
alaurenc9's Contact & Social LinksxSanchez78xSanchez78xSanchez78xSanchez78xSanchez78xSanchez78
i thnk its you not getting me, as what you just posted is practically the same...

i was under the impression "missile_fired" didnt work on COD 5, if it does, sounds like thats what you need, but it wont use the same functions as grenades, so detonate proba bly doesnt apply

i dunno anyway, havent touched cod 5 in months, and dont intend to. have fun

Hmm well idk. I don't think I have a clear enough answer, but asking around on the forums won't really help. I'll just wait until this weekend when I get my pc again and figure this out myself. thanks anyways. And how come everyone is done with World at War now it seems? A couple friends told me they were done and now you.... whats the deal? Are we even sure bo3 will have mod tools? and if so is this what you are waiting for?
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 4 years ago
Posts
6,877
Respect
1,004Add +1
Forum Rank
Immortal
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social Links[email protected]HarryBo21HarryBo000
i think the fact treyarch outright stated "you will get mod tools, including mapping and gametypes, closed alpha starts in march"

is pretty definitive lol

and that is why, not wasting time on cod 5 just so i have to do it all over again to move it to bo3. Seems pointless - plus like you said everyone else has been giving up, including people i was part way through helping so, taking a hiatus
Last Edit: December 17, 2015, 03:19:22 am by Harry Bo21
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 30 December 2012
Last active: 9 months ago
Posts
577
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
alaurenc9's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
alaurenc9's Contact & Social LinksxSanchez78xSanchez78xSanchez78xSanchez78xSanchez78xSanchez78
i think the fact treyarch outright stated "you will get mod tools, including mapping and gametypes, closed alpha starts in march"

is pretty definitive lol

and that is why, not wasting time on cod 5 just so i have to do it all over again to move it to bo3. Seems pointless - plus like you said everyone else has been giving up, including people i was part way through helping so, taking a hiatus

o they said that exactly? o ok well then yeah lol they are coming out. sorry i havent really been keeping up with that stuff. so yea makes sense why your quitting. I still got some mods to finish tho so im gonna stay here in good old WaW for a bit.
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 4 years ago
Posts
6,877
Respect
1,004Add +1
Forum Rank
Immortal
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social Links[email protected]HarryBo21HarryBo000
o they said that exactly? o ok well then yeah lol they are coming out. sorry i havent really been keeping up with that stuff. so yea makes sense why your quitting. I still got some mods to finish tho so im gonna stay here in good old WaW for a bit.
ages ago, theres a webpage for it. People were talking about it right away,

give it a while and im sure someone will find and link it

I havent "quit", just waiting until i know what is or isnt worth it, still cleaning up a few bugs with things people keep sending me messages about

* EDIT * might be this but i cant view it on this pc

http://ugx-mods.com/forum/index.php/topic,9055.0.html
Last Edit: December 17, 2015, 03:30:39 am by Harry Bo21

 
Loading ...