Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Question on how to "Spawn" a flying rocket as a player?
#1
I'm new to scripting in GSC. I'm mostly 'self-taught'

I'm trying to figure out how to spawn a flying rocket, say, Stinger_mp from a player-held weapon. I'm unable to get it to spawn, but I know how to spawn FX (Kinda). Is this even possible?
Reply

#2
setmodel?
Do not take life too seriously. You will never get out of it alive.
[Image: UGPjFJa.jpg]
Reply

#3
(06-02-2013, 17:37)DidUknowiPwn Wrote: setmodel?

Newb, how it can be 'setmodel' ??
It's MagicBullet, i think..
C++/Obj-Cdeveloper. Neko engine wip
Steam: Click
Reply

#4
http://www.itsmods.com/forum/Thread-Tuto...mages.html

The position to spawn it from should be: self getEye() or self getTagOrigin("tag_flash")
Reply

#5
Oh I read it wrong I thought it said putting the stinger in his fov or something lol
Do not take life too seriously. You will never get out of it alive.
[Image: UGPjFJa.jpg]
Reply

#6
Thanks guys, but what would that look like as an actual function? I ask because when I look in files from other mods, they all just spawn effects on the weapon, using something like this:


start = self getTagOrigin( "tag_eye" );
end = self getTagOrigin( "tag_eye" ) + vecscale( anglestoforward( self getPlayerAngles() ), 100000 );
trace = bulletTrace( start, end, true, self );

thread doLaserFX( self getTagOrigin( "tag_eye" ), anglestoforward( self getPlayerAngles() ), trace["position"] );


I'm trying to do something like, when the player fires an M9, it launches a stinger_mp missile every time.

Sorry guys, I just read that link that was posted on MagicBullet's. I put a line of code that looks like

MagicBullet( "rpg_mp", self.origin, self.origin+(0,0,500), self );
RadiusDamage( self.origin , 400, 150, 100, self);
SetPlayerIgnoreRadiusDamage( true );

and it works, but how to I get it to follow my crosshair and fire there? It just fires straight up lol
Reply

#7
geteye() is a function which finds the origin of your eye. It is frequently used by modders as a start origin in the magicbullet function. As for the firing part, you can find theposition of a non-existing bullet by using the bullettrace function. You can read about the bullettrace function here: http://www.itsmods.com/forum/Thread-Tuto...trace.html

Try this:
Code:
MagicBullet( "rpg_mp", self geteye(), Bullettrace(self getEye(),self getEye()+anglestoforward(self getplayerangles())*100000,true,self)["position"], self );
Reply

#8
Thank you sir
Reply

#9
like this ?


http://www.youtube.com/watch?feature=pla...Hmfw#t=42s


Code:
atPlayerShoot()
{
    self endon("disconnect");
    for(;;)
    {
        self waittill( "weapon_fired" );
        if(self getcurrentweapon() != "l96a1_extclip_mp") continue;
        location = aim();
        MagicBullet( "m220_tow_mp", self getTagOrigin("tag_eye"), location, self );
    }    
}

aim()
{
    forward = self getTagOrigin("tag_eye");
    end = self vector_multiply(anglestoforward(self getPlayerAngles()),1000000);
    Crosshair = BulletTrace( forward, end, true, self )[ "position" ];
    return Crosshair;
}
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  Help Sentry Gun kill = Player kill Snake 8 5,451 11-07-2013, 13:41
Last Post: Nekochan
Question Help Mw2 weapon skin question FroxIVx4 1 2,770 10-13-2013, 16:54
Last Post: hmann
Rainbow please help me = question's clacki 1 2,191 09-24-2013, 15:22
Last Post: OzonE
  Player can write Fl0w_.JACKDAN 2 3,118 09-19-2013, 16:36
Last Post: Fl0w_.JACKDAN
  [Request] Might be a silly question... regarding SetPlayerData camxxcore 4 3,625 08-10-2013, 21:50
Last Post: camxxcore
Exclamation [Request] Random Weapon At Spawn Scripts18 3 4,426 07-27-2013, 23:53
Last Post: DidUknowiPwn
  Help Spawn Message Playing on Respawn? Killjoy 7 4,774 07-11-2013, 14:53
Last Post: Killjoy
  A question about the Call of Duty Black Ops king_dom 1 3,429 07-08-2013, 05:26
Last Post: DidUknowiPwn
  Help Mw2 weapon skin question FroxIVx4 1 2,700 07-06-2013, 19:22
Last Post: surtek
  [CoD 4] Trying to set a player -- DidUknowiPwn 7 5,294 07-03-2013, 21:58
Last Post: Pozzuh

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.