It is currently 07 Sep 2010, 21:55

All times are UTC




Post new topic Reply to topic  [ 14 posts ] 
Author Message
 Post subject: Need help.
New postPosted: 23 Dec 2009, 05:32 
Offline

Joined: 23 Dec 2009, 05:28
Posts: 4
Hey, new guy here. I need help with my mod.

I watched your homing RPG video and I would like to know how you did it and I would also like to know if I can put it into my mod.

Xfire = MuhhammedJihad


Top
 Profile Send private message  
 
 Post subject: Re: Need help.
New postPosted: 23 Dec 2009, 08:37 
Offline
Section moderator
User avatar

Joined: 29 Dec 2008, 10:28
Posts: 1209
Location: Iowa, U.S.
I take it you are talking about KiLL3R's K3 mod?


Top
 Profile Send private message  
 
 Post subject: Re: Need help.
New postPosted: 23 Dec 2009, 10:12 
Offline

Joined: 23 Dec 2009, 05:28
Posts: 4
Not exactly.

http://www.youtube.com/watch?v=JWDQnghRK1g

I know K3 has laser-guided rockets, and I have already asked them but to no avail. I want to do something similar to those and the ones in that video.


Top
 Profile Send private message  
 
 Post subject: Re: Need help.
New postPosted: 23 Dec 2009, 12:02 
Offline
Modder/Administrator
User avatar

Joined: 28 Jul 2008, 20:30
Posts: 1206
Location: United Kingdom
I haven't got any of the files with me but I think I did it by editing the destabilisation values on the rockets, then changing their angles through scripts.

I know something in those values had to be changed, either to enable destabilising rockets as soon as they're fired or disable it for as long as they are in the air. Then I just ran script loops to check every projectile in the map (think that was getentarray("rocket", "classname"), and changed their angles to where I was pointing. This is all a bit vague but I can't check the files :lol:


Top
 Profile Send private message  
 
 Post subject: Re: Need help.
New postPosted: 23 Dec 2009, 16:11 
Offline
Section moderator
User avatar

Joined: 29 Dec 2008, 10:28
Posts: 1209
Location: Iowa, U.S.
Except that would probably grab anyone elses rocket too. I think if you found a way to give the rocket an owner in script... that would work. (I dont believe its defined, is it?)

Code:
guideRockets()
{
self endon("disconnect");
self endon("killed_player");
self endon("death");

   while(1)
   {
      wait .05;
      rockets = getEntArray("rocket", "classname");
      for(x = 0; x < rockets.size; x++)
      {
         if(isDefined(rockets[x].owner) && rockets[x].owner == self && isAlive(self))
            rockets[x] thread guideMe(self);
      }
   }
}

guideMe(owner)
{
   pos = bulletTrace(owner getEye(), owner getEye() + maps\mp\_utility::vector_scale(anglesToForward(owner getPlayerAngles()), 999999), true, self)["position"];
   self rotateTo(vectorToAngles(pos - self.origin), .15, .05, .05);
}


Something like that. Haven't tested it.


Top
 Profile Send private message  
 
 Post subject: Re: Need help.
New postPosted: 23 Dec 2009, 16:44 
Offline
Modder/Administrator
User avatar

Joined: 28 Jul 2008, 20:30
Posts: 1206
Location: United Kingdom
I did it back then by finding the closest player to the rocket as soon as it was spawned, or possibly by using a player waittill("fireweapon", rocket) or something.


Top
 Profile Send private message  
 
 Post subject: Re: Need help.
New postPosted: 23 Dec 2009, 16:47 
Offline
Section moderator
User avatar

Joined: 29 Dec 2008, 10:28
Posts: 1209
Location: Iowa, U.S.
Yeah, that's what i was thinking... just like grenades or claymores or whatever.

self waittill("grenade_fire", grenade, weapname);

I'm not sure if rpgs would be included in that....


Top
 Profile Send private message  
 
 Post subject: Re: Need help.
New postPosted: 23 Dec 2009, 18:41 
Offline
Section moderator
User avatar

Joined: 29 Dec 2008, 10:28
Posts: 1209
Location: Iowa, U.S.
You didn't set it up as guided or anything and guide it with some built-in function did you dobby?

I tried rotating the rocket and rotateTo() doesn't work because it's not a script_model. Rocket.angles doesn't seem to work either.


Top
 Profile Send private message  
 
 Post subject: Re: Need help.
New postPosted: 23 Dec 2009, 18:48 
Offline
Modder/Administrator
User avatar

Joined: 28 Jul 2008, 20:30
Posts: 1206
Location: United Kingdom
I did something, think it was rocket.angles, but I remember it went weird unless you did something with destabilisation (loses all momentum). I first tested stuff like this in codwaw zom_db, trying to teleport projectiles that hit bubbles to the other side of them, and I remember they would always fall straight to earth after being moved.


Top
 Profile Send private message  
 
 Post subject: Re: Need help.
New postPosted: 23 Dec 2009, 19:09 
Offline
Section moderator
User avatar

Joined: 29 Dec 2008, 10:28
Posts: 1209
Location: Iowa, U.S.
k, got it. The rocket must hit the destabilization point to be able to angle it. At least thats what it seemed. Also, instead of messing with the rate i just set the max destabilization angle to 0. Works great.


Top
 Profile Send private message  
 
 Post subject: Re: Need help.
New postPosted: 23 Dec 2009, 20:27 
Offline
Section moderator
User avatar

Joined: 29 Dec 2008, 10:28
Posts: 1209
Location: Iowa, U.S.
Code:
self thread ownRockets();
self thread guideRockets();

ownRockets()
{
self endon("disconnect");
self endon("killed_player");
self endon("death");

   while(1)
   {
      wait .05;
      rockets = getEntArray("rocket", "classname");
      for(x = 0; x < rockets.size; x++)
      {
         dist = distance(self.origin, rockets[x].origin);
         if(self getCurrentWeapon() == "rpg_mp" && !isDefined(rockets[x].owner) && dist < 250)
            rockets[x].owner = self;
      }
   }
}

guideRockets()
{
self endon("disconnect");
self endon("killed_player");
self endon("death");

   while(1)
   {
      wait .05;
      rockets = getEntArray("rocket", "classname");
      for(x = 0; x < rockets.size; x++)
      {
         if(isDefined(rockets[x].owner) && rockets[x].owner == self && isAlive(self))
            rockets[x] thread guideMe(self);
      }
   }
}

guideMe(owner)
{
   pos = bulletTrace(owner getEye(), owner getEye() + maps\mp\_utility::vector_scale(anglesToForward(owner getPlayerAngles()), 999999), true, owner)["position"];
   self.angles = vectorToAngles(pos - self.origin);
}



Watch on Xfire.com


Top
 Profile Send private message  
 
 Post subject: Re: Need help.
New postPosted: 24 Dec 2009, 02:01 
Offline

Joined: 23 Dec 2009, 05:28
Posts: 4
Its works, thanks guys. Much appreciated.


Top
 Profile Send private message  
 
 Post subject: Re: Need help.
New postPosted: 24 Dec 2009, 17:19 
Offline
Section moderator
User avatar

Joined: 29 Dec 2008, 10:28
Posts: 1209
Location: Iowa, U.S.
Sure thing. Just credit dobby and i ;-)


Top
 Profile Send private message  
 
 Post subject: Re: Need help.
New postPosted: 25 Dec 2009, 10:36 
Offline

Joined: 23 Dec 2009, 05:28
Posts: 4
Sure, no problem.


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Theme by Shadow_One from SE-Tuning