Posts: 30
Threads: 13
Joined: May 2013
Reputation:
1
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?
Posts: 3,535
Threads: 420
Joined: Dec 2010
Reputation:
106
06-07-2013, 09:43
(This post was last modified: 06-07-2013, 09:43 by Yamato.)
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
Posts: 30
Threads: 13
Joined: May 2013
Reputation:
1
06-07-2013, 13:14
(This post was last modified: 06-07-2013, 13:15 by akillj.)
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)
Posts: 3,535
Threads: 420
Joined: Dec 2010
Reputation:
106
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) );
Posts: 30
Threads: 13
Joined: May 2013
Reputation:
1
06-08-2013, 12:26
(This post was last modified: 06-08-2013, 12:28 by akillj.)
(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?
Posts: 3,535
Threads: 420
Joined: Dec 2010
Reputation:
106
(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;
Posts: 30
Threads: 13
Joined: May 2013
Reputation:
1
|