Jump to content

HELP coding Rakghoul disease from Kotor.


Recommended Posts

Hey guys, I'm not really on the forums all that much, but I was wondering if anyone a little more code savvy, as I'm just learning and have only coded a weapon and some follow functions, could help me with something.  I'm trying to mimic the Rakghoul disease from kotor 1.  

 

I want to make it so that if an npc named "rakghoul" kills an npc, the game spawns npc "rakghoul" at the last known enemy location.  

 

So, essentially, if a rakghoul kills someone, it spawns another, as if they were infected and turned in to a rakghoul.  I've been playing around but can't seem to figure out how to make it work quite right.  Like a zombie effect.

Link to comment

mmm, i think should be a force power of a custom rakghoul NPCs.

check the code of the droid that disappering their model when they are destroyed (probe droid, mouse droid)

This code spawn an effect on a point of a model.

 


you need to make the code part inside an if brank like

 

if (health => 0 && ((self->client->NPC_class != PUT THE CLASS YOU CHOICE FOR THE RAKGHOUL, SHOULD BE FINE RANCOR OR WAMPA CLASS IF YOU GOT AN ANPC WITH CUSTOM GLA ANIMATION.    NPC &&Q_stricmp("Rakghoul",self->NPC_type))

for make it

G_PlayEffect( G_EffectIndex( "rakghoul/mutation" ), self->client->renderInfo.torsoPoint );

 

PUT REMOVAL BODY CODE

PUT SPAWN RAKGHOUL NPC CODE.

Link to comment

I don't know how NPCs are spawned offhand (try looking at what happens in g_cmds.cpp), but your code should definitely be in player_die, in g_combat.cpp. It handles both NPCs and players. You'll want to check if the killer is a Rakghoul and the deceased is not a Rakghoul. I disagree entirely that it needs a new force power.

Link to comment
  • 3 weeks later...

So, I've done some new code adding and created my own spawn function now.  It works.  Problem is... it always spawns the new Rakghoul at the center point of the current level.  I've been trying to set up a radius spawn, but I can't get it right.  How do you get the code to record the last known position and spawn the new Rakghoul there?

Asgarath83 likes this
Link to comment
  • 5 months later...
if (self->client->NPC_class == CLASS_WAMPA)
{//spawns a rakghoul
if (self->health >= 0 && (Q_stricmpn("rakghoul", self->NPC_type, 13) == 0))
{
SP_NPC_RAKGHOUL(G_Spawn(), 16);
}
}
 
I have this set inside the G_combat file as a perimeter for future spawning.  I'm having a lot of trouble figuring out how to set a spawn area, though.  Right not it seems to be spawning him in origin of the level, half way in the ground.  I don't know how to make it spawn where the victim it killed is.  I've made various new functions because I couldn't figure out how to make the normal ones even spawn him.  I think I'm making it way harder than it needs to be.

Also, this is making another spawn when I kill the already spawned rakghoul, but I want it to spawn when the rakghoul kills someone else.
 
I was trying to make it work like the force crystals that the shadowtroopers drop, so it just spawns out of their dead body.
Link to comment

 

if (self->client->NPC_class == CLASS_WAMPA)
{//spawns a rakghoul
if (self->health >= 0 && (Q_stricmpn("rakghoul", self->NPC_type, 13) == 0))
{
SP_NPC_RAKGHOUL(G_Spawn(), 16);
}
}
 
I have this set inside the G_combat file as a perimeter for future spawning.  I'm having a lot of trouble figuring out how to set a spawn area, though.  Right not it seems to be spawning him in origin of the level, half way in the ground.  I don't know how to make it spawn where the victim it killed is.  I've made various new functions because I couldn't figure out how to make the normal ones even spawn him.  I think I'm making it way harder than it needs to be.

 

Also, this is making another spawn when I kill the already spawned rakghoul, but I want it to spawn when the rakghoul kills someone else.

 
I was trying to make it work like the force crystals that the shadowtroopers drop, so it just spawns out of their dead body.

 

 well, in that case you need to check the force crystal code for see how it works. also maybe can be useful the code related about the NPC that spawns the pickables weapons when they are killed.

But also you need to make something different because you not want to spawn a MD3 or a GLM model, you wanna to spawn an NPC. you need to do a perfect functionally NPC rakghoult model and to make a code that spawn this particular NPC like the shadowtroopers force crystal. spawning a model in this case is not useful, because the model is not setted with AI. you need to call an NPC by the death of another NPC.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...