Ok, a long time ago I created bob, which was a remote that hovered over the players head, and when it saw an enemy, either another player or actor, it faced it and shot at it rapidly. Now I'm attempting to recreate bob, but I'm a bit rusty, so I need help! Here's what I have:
When I use force grip, bob activates, and the ghost template is created above my head and assigned the remote model, but:
a.) the bob thing doesn't attatch to the player
b.) the bob thing doesn't face enemies and shoot them (I don't know if it's even searching)
I can activate and deactivate it all I want, but I'm afraid bob is useless for now
Any insight as to what the problem is will be greatly appreciated. Thanks!
------------------
Those who stare in the eyes of death and laugh will be the first to go.
Code:
# Jedi Knight Cog Script
#
# bob.COG
#
# bob the cog does his best to bring justice to those deserving a terrible terrible death that involves many pointy objects!
#
#
# This Cog is Not supported by LucasArts Entertainment Co
symbols
model bobmod=remo.3do local
thing bob local
thing player local
thing victim local
sector playersector local
sound bobshoot=ricochet03.wav local
template bobtemp=ghost local
template projectile1=+bryarbolt local
flex bobon=0 local
vector playerpos local
vector bobpos local
vector bobnewpos local
vector victimnewpos local
vector victimpos local
message startup
message activated
message pulse
end
# ========================================================================================
code
startup:
player = GetLocalPlayerThing();
return;
activated:
if(bobon == 0)
{
playersector = GetThingSector(player);
playerpos = GetThingPos(player);
bobpos = VectorAdd(playerpos,'0 0 0.1');
bobon = 1;
bob = CreateThingatPos(bobtemp,playersector,bobpos,'0 0 0');
SetThingModel(bob,bobmod);
AttatchThingToThing(bob,player);
SetPulse(.05);
}
else
{
DestroyThing(bob);
SetPulse(0);
bobon = 0;
}
return;
pulse:
victim = FirstThinginView(bob,360,6,0x404);
while(victim != -1)
{
if(victim != player)
{
bobnewpos = GetThingPos(bob);
victimnewpos = GetThingPos(victim);
victimpos = VectorSub(bobnewpos,victimnewpos);
SetThingLook(bob,victimpos);
FireProjectile(bob,projectile1,bobshoot,8,'0 0 0','0 0 0',1.0,0,0,0);
}
}
return;
# ........................................................................................
endWhen I use force grip, bob activates, and the ghost template is created above my head and assigned the remote model, but:
a.) the bob thing doesn't attatch to the player
b.) the bob thing doesn't face enemies and shoot them (I don't know if it's even searching)
I can activate and deactivate it all I want, but I'm afraid bob is useless for now
Any insight as to what the problem is will be greatly appreciated. Thanks!------------------
Those who stare in the eyes of death and laugh will be the first to go.
Those who stare in the eyes of death and laugh will be the first to go.
but I'm confused as to how I can determine the sector of the bob object before it's created.![http://forums.massassi.net/html/tongue.gif [http://forums.massassi.net/html/tongue.gif]](http://forums.massassi.net/html/tongue.gif)
thanks for the help!![http://forums.massassi.net/html/biggrin.gif [http://forums.massassi.net/html/biggrin.gif]](http://forums.massassi.net/html/biggrin.gif)