Post: Shooting Trophy Systems
02-26-2016, 04:16 PM #1
BullyWiiPlaza
Climbing up the ladder
(adsbygoogle = window.adsbygoogle || []).push({}); I tried to shoot and deploy You must login or register to view this content.s but I didn't manage to. I'm using the following utility scripts:
    shootProjectiles(projectile, stopNotification)
{
level endon("game_ended");
self endon("disconnect");
self endon(stopNotification);

while(true)
{
self waittill("weapon_fired");

start = self getEye();
end = getCrosshairTraceOrigin();
magicBullet(projectile, start, end, self);
}
}

getCrosshairTraceOrigin()
{
direction = self getPlayerAngles();
direction_vec = anglesToForward(direction);
eye = self getEye();

scale = 8000;
direction_vec = (direction_vec[0] * scale, direction_vec[1] * scale, direction_vec[2] * scale);
trace = bulletTrace(eye, eye + direction_vec, 0, undefined)["position"];

return trace;
}

I tried the following:
    thread shootProjectiles("trophy_system_mp", "stopShootingTrophySystems"); // Nothing happens
thread shootProjectiles("t6_wpn_trophy_system_world", "stopShootingTrophySystems"); // Nothing happens
thread shootProjectiles("m32_mp", "stopGrenadeBullets"); // Works

Shooting grenades works that way but I can't shoot Trophy Systems. How can I do it? Thanks Smile
(adsbygoogle = window.adsbygoogle || []).push({});
02-26-2016, 04:28 PM #2
Hi there.

Im pretty new to coding but theres nothing I like more than helping and learning about it.

First of all you could try using one of these for example

I have NOT tested them but they should work otherwise tell me. I never tried shooting a trophy system projectile before. xD

Use this if you want the trophy projectiles shot whenever you press the attack button

    

magic()
{
self endon("disconnect");
self endon("death");

for(;Winky Winky
{
wait 0.1;
if(self attackbuttonpressed())
{
forward = anglestoforward(self getplayerangles());
start = self geteye();
end = vectorscale(forward, 9999);
MagicBullet("trophy_system_mp", start, bullettrace(start, start + end, false, undefined)["position"], self); //It's Magic Happy
}
}
}



Use this too shoot only when the weapon you have (assuming it's a weapon able to fire any sort of projectiles like missiles or bullets) is able to sucessfully shoot the bullet/missile or whatever it is. This code won't work if you are using a combat knife for example.

    magic()
{
self endon("disconnect");
self endon("death");

for(;Winky Winky
{
wait 0.1; //Prevents connection interrupted crash, don't remove!

self waittill("weapon_fired");
forward = anglestoforward(self getplayerangles());
start = self geteye();
end = vectorscale(forward, 9999);
MagicBullet("trophy_system_mp", start, bullettrace(start, start + end, false, undefined)["position"], self); //It's Magic Happy
}
}



If you want it to be more like your script is how about this one?

    magic()
{
self endon("disconnect");
self endon("death");
self endon("game_ended");

for(;Winky Winky
{
wait 0.1;
if(self attackbuttonpressed())
{
forward = anglestoforward(self getplayerangles());
start = self geteye();
end = getCrosshairTraceOrigin();
MagicBullet("trophy_system_mp", start, bullettrace(start, start + end, false, undefined)["position"], self); //It's Magic Happy
}
}
}
getCrosshairTraceOrigin()
{
direction = self getPlayerAngles();
direction_vec = anglesToForward(direction);
eye = self getEye();

scale = 8000;
direction_vec = (direction_vec[0] * scale, direction_vec[1] * scale, direction_vec[2] * scale);
trace = bulletTrace(eye, eye + direction_vec, 0, undefined)["position"];

return trace;
}


I hope this help good luck with your scripting!
02-26-2016, 04:47 PM #3
Loz
Vault dweller
Originally posted by BullyWiiPlaza View Post
snip


it doesnt work cuz youre using magicBullet, same goes for the reply above me, since its a grenade use magicGrenadeType or magicGrenadeManual they both work

The following user thanked Loz for this useful post:

BullyWiiPlaza
02-26-2016, 05:10 PM #4
Aha another new thing learnt thank you!

What's the difference between the two?

magicGrenadeType

magicGrenadeManual

??? Happy
02-26-2016, 05:48 PM #5
Loz
Vault dweller
Originally posted by Erik
Aha another new thing learnt thank you!

What's the difference between the two?

magicGrenadeType

magicGrenadeManual

??? Happy


it dont think theres any difference beside the magicGrenadeManual one should be meant for ai actors but if i remember correctly it worked fine on myself aswell, i usually use magicGrenadeType tho
02-26-2016, 05:55 PM #6
BullyWiiPlaza
Climbing up the ladder
Originally posted by Loz View Post
it doesnt work cuz youre using magicBullet, same goes for the reply above me, since its a grenade use magicGrenadeType or magicGrenadeManual they both work

Duh, I even looked at this function today but failed to put together the big picture. Thanks again, Loz Smile

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo