ItsMods

Full Version: Making a harrier crash into the map?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How would I make a harrier spawn and crash into the map? Assuming I already set (location) as the spot i want it to via the kill streak map selector.

How like I make multiples spawn and randomly hit near that area?
You can find random spots for the harrier around the area like this:

Code:
HeavyArtillery = BulletTrace( location, ( location + ( 0, 0, -100000 ) + (RandomIntRange(-1000,1000),RandomIntRange(-1000,1000),0) ), 0, self )[ "position" ];

I am following the example of this code that is what you might have:

http://www.itsmods.com/forum/Thread-Harrier.html
Very nice. I tried out your code you posted in the other thread. Works well. I'm still trying to wrap my mind around how I would get these to spawn in say, an artillery barrage (From custom killstreaks mod). Here's the code from the barrage itself :

Code:
HeavyArtillery = BulletTrace( location, ( location + ( 0, 0, -100000 ) ), 0, self )[ "position" ];
        self.selectingLocation = undefined;
        wait 0.01;

    HeavyArtillery2 = HeavyArtillery+(0, 0, 8000);
        MagicBullet( "ac130_105mm_mp", HeavyArtillery2, HeavyArtillery2-(0, 0, 8000), self );
        wait 0.75;
      
        HeavyArtillery2 = HeavyArtillery+(-2000, 1500, 8000);
        MagicBullet( "ac130_105mm_mp", HeavyArtillery2, HeavyArtillery2-(0, 0, 8000), self );
        wait 0.75;

Obviously the there's many more magic bullets that spawn, but this is what it looks like.

Where / how would I change one of these lines so that it spawns a jet flying down at the map from a random angle and random location?

The code above is also assuming I already set "location" with the map selector. (Enabling all this ^ to happen)
Using this from the other post:

http://pastebin.com/eua5CZqQ

You would only need to use this to spawn more harriers:

Code:
self thread DeathHarrier(HeavyArtillery2);
self thread DeathHarrier(HeavyArtillery3);

And to make the harriers spawn in random spots just change this line to this (the line its inside DeathHarrier() function:

Code:
Kamikaze = spawn("script_model", self.origin+(RandomIntRange(-24000,24000),RandomIntRange(-15000,15000),25000) );
(06-08-2013, 11:22)Yamato Wrote: [ -> ]Using this from the other post:

http://pastebin.com/eua5CZqQ

You would only need to use this to spawn more harriers:

Code:
self thread DeathHarrier(HeavyArtillery2);
self thread DeathHarrier(HeavyArtillery3);

And to make the harriers spawn in random spots just change this line to this (the line its inside DeathHarrier() function:

Code:
Kamikaze = spawn("script_model", self.origin+(RandomIntRange(-24000,24000),RandomIntRange(-15000,15000),25000) );


That works great! The only problem is that the 'angle' of the harrier doesn't match the direction, so it's pointing one direction but flying another. Is there any way to make the random spawn point match the new angle?
(06-08-2013, 12:26)akillj Wrote: [ -> ]
(06-08-2013, 11:22)Yamato Wrote: [ -> ]Using this from the other post:

http://pastebin.com/eua5CZqQ

You would only need to use this to spawn more harriers:

Code:
self thread DeathHarrier(HeavyArtillery2);
self thread DeathHarrier(HeavyArtillery3);

And to make the harriers spawn in random spots just change this line to this (the line its inside DeathHarrier() function:

Code:
Kamikaze = spawn("script_model", self.origin+(RandomIntRange(-24000,24000),RandomIntRange(-15000,15000),25000) );


That works great! The only problem is that the 'angle' of the harrier doesn't match the direction, so it's pointing one direction but flying another. Is there any way to make the random spawn point match the new angle?

mmmm try this (I only changed the Angles line):

Code:
Kamikaze = spawn("script_model", self.origin+(24000,15000,25000) );
        Kamikaze setModel( "vehicle_mig29_desert" );
        //////////////////////////////////////////////////////////
        Angles = vectorToAngles( Location - Kamikaze.origin );
        Kamikaze.angles = Angles;
Perfect man, thanks.