Following light AI... PLEASE HELP
Following light AI... PLEASE HELP
Well for my latest project I want for this alien/spirit/soul to follow the player it will basically be a floating light that pretty much assists the player, but since this is a short term project that i intend to finish before I have done learning scripting, I was wondering if there is a script somewhere that allows for a pawn to follow the player? then i could just edit this pawn to carry a fog light and a regular light around and make its animation float and drift around... and then If some one could then tell me how to make the light to special tricks like just basic stuff like darting away from danger and moving towards trapped miners.
Thanks again for the help
Thanks again for the help
My Deviant Art - http://black-crusader.deviantart.com
- QuestOfDreams
- Site Admin
- Posts: 1520
- Joined: Sun Jul 03, 2005 11:12 pm
- Location: Austria
- Contact:
This is from an older RF release:
follow.s
follow.s
Code: Select all
{
SCALE [1]
BOXWIDTH [10]
WALK [Walk] // walking animation
WALKSPEED [70] // average walking speed
FORCEUP [30] // obstacle avoidance jump speed
FORCEFORWARD [30] // obstacle avoidance forward speed
FORCESIDE [30] // obstacle avoidance sideways speed
FOV [180] // field of view in degrees
YAWSPEED [120] // speed of rotation in deg/sec
Start[ ()
{
Console(true);
AvoidOrder("Avoidance");
PlayAnimation("Idle", false, "");
HostilePlayer(true);
if(BOXWIDTH > 0)
{
BoxWidth(BOXWIDTH*SCALE); // set bounding box width/depth
}
SetFOV(FOV);
FindTargetOrder(100, "Follow", "health");
NewOrder("DoNothing");
} ]
Avoidance[ ()
{
if(random(1,10)<3) // backup and move sideways sometimes
{
MoveBackward(WALK, WALKSPEED*SCALE, (WALKSPEED/2)*SCALE, "");
MoveRight(WALK, WALKSPEED*SCALE, (WALKSPEED/2)*SCALE, "");
}
else
{
Jump(WALK, FORCEUP*SCALE, true, "");
if(random(1,10)<6)
{
Move("", FORCEFORWARD*SCALE, (FORCEFORWARD/2)*SCALE, 0, 90, 0, "");
}
else
{
Move("", FORCEFORWARD*SCALE, (FORCEFORWARD/2)*SCALE, 0, -90, 0, "");
}
}
Return();
} ]
DoNothing[ ()
{
RestartOrder();
} ]
Follow[ ()
{
AddDistanceOrder(1, 60, "Wait");
RotateMoveToTarget("Walk", YAWSPEED, WALKSPEED*SCALE, false, "");
MoveToTarget("Walk", WALKSPEED*SCALE, "");
NewOrder("Wait");
} ]
Wait[ ()
{
RotateToTarget("Idle", YAWSPEED, false, "");
AddDistanceOrder(1, -80, "Follow");
PlayAnimation("Idle", false, "");
NewOrder("DoNothing");
} ]
}
W W! This is perfect! Thanks QoD!
Now Im just stuck on getting a light and foglight attached to the pawn any body know how?
Now Im just stuck on getting a light and foglight attached to the pawn any body know how?
My Deviant Art - http://black-crusader.deviantart.com
It seems that you can't attach a foglight to any entity. The normal light entity doesn't have this feature either. So you'll need to use DynamicLight.
Name the pawn something like 'LighterPawn' and enter that name in the DynamicLight's field 'EntityName'. In the 'BoneName' field enter the name of the bone you want the light to attach to.
That should do it...
Name the pawn something like 'LighterPawn' and enter that name in the DynamicLight's field 'EntityName'. In the 'BoneName' field enter the name of the bone you want the light to attach to.
That should do it...
Pain is only psychological.
- QuestOfDreams
- Site Admin
- Posts: 1520
- Joined: Sun Jul 03, 2005 11:12 pm
- Location: Austria
- Contact:
Wow thanks alot guys! This sounds very promising! Ill give it a try and post back tommorow!
My Deviant Art - http://black-crusader.deviantart.com
i have made my pawn and given it its basic 'idle' animation (witch it should use for everything since its just a floating ball of light) and well the problem is that it seems to 'spawn' when the level starts but it then doesnt play an animation and it also doesent 'follow' the player!
here is the script (i made a few changes did i mess it up????)
and here is the entry for it in the pawn INI:
What am i doing wrong??
Thans for all the help!
here is the script (i made a few changes did i mess it up????)
Code: Select all
{
SCALE [1]
BOXWIDTH [10]
WALK [idle] // walking animation
WALKSPEED [70] // average walking speed
FORCEUP [30] // obstacle avoidance jump speed
FORCEFORWARD [30] // obstacle avoidance forward speed
FORCESIDE [30] // obstacle avoidance sideways speed
FOV [180] // field of view in degrees
YAWSPEED [120] // speed of rotation in deg/sec
Start[ ()
{
Console(true);
AvoidOrder("Avoidance");
PlayAnimation("Idle", false, "");
HostilePlayer(true);
if(BOXWIDTH > 0)
{
BoxWidth(BOXWIDTH*SCALE); // set bounding box width/depth
}
SetFOV(FOV);
FindTargetOrder(100, "Follow", "health");
NewOrder("DoNothing");
} ]
Avoidance[ ()
{
if(random(1,10)<3) // backup and move sideways sometimes
{
MoveBackward(WALK, WALKSPEED*SCALE, (WALKSPEED/2)*SCALE, "");
MoveRight(WALK, WALKSPEED*SCALE, (WALKSPEED/2)*SCALE, "");
}
else
{
Jump(WALK, FORCEUP*SCALE, true, "");
if(random(1,10)<6)
{
Move("", FORCEFORWARD*SCALE, (FORCEFORWARD/2)*SCALE, 0, 90, 0, "");
}
else
{
Move("", FORCEFORWARD*SCALE, (FORCEFORWARD/2)*SCALE, 0, -90, 0, "");
}
}
Return();
} ]
DoNothing[ ()
{
RestartOrder();
} ]
Follow[ ()
{
AddDistanceOrder(1, 60, "Wait");
RotateMoveToTarget("Walk", YAWSPEED, WALKSPEED*SCALE, false, "");
MoveToTarget("Walk", WALKSPEED*SCALE, "");
NewOrder("Wait");
} ]
Wait[ ()
{
RotateToTarget("Idle", YAWSPEED, false, "");
AddDistanceOrder(1, -80, "Follow");
PlayAnimation("Idle", false, "");
NewOrder("DoNothing");
} ]
}
Code: Select all
[lightball]
actorname = lightball.act
actorrotation = 0 180 0
actorscale = 1
fillcolor = 255 255 255
ambientcolor = 255 255 255
subjecttogravity = false
boundingboxanimation = Idle
shadowsize = 30
What am i doing wrong??
Thans for all the help!
My Deviant Art - http://black-crusader.deviantart.com
Okay that was just me being stupid! Thanks for the help!
Okay now it follows the player but it still doesnt play its 'idle' animation! i named the one animation idle and in the field for the walk animation (as you seen in my last post) I put idle... why wont it work?
Oh and also how do I make the lightball 'no clip' so that it can go through walls and also so the player doesnt get 'stuck' on it...
Thanks again!
Okay now it follows the player but it still doesnt play its 'idle' animation! i named the one animation idle and in the field for the walk animation (as you seen in my last post) I put idle... why wont it work?
Oh and also how do I make the lightball 'no clip' so that it can go through walls and also so the player doesnt get 'stuck' on it...
Thanks again!
My Deviant Art - http://black-crusader.deviantart.com
Sorry for all the questions but I have another problem, In milk shape I made the balls texture plain white and i made the specular adn diffuse maps white aswell so basically the ball was COMPLETELY white, but now in the engien the ball looks quite grey how can i correct this?
Please dont let this post distract from the questions in the last post cause i still havent worked that out either.
Oh and as you can see I have attached the dynamic light and fog light...
Please dont let this post distract from the questions in the last post cause i still havent worked that out either.
Oh and as you can see I have attached the dynamic light and fog light...
My Deviant Art - http://black-crusader.deviantart.com
this what i found hard, if you put a 16x16 wite texture on it, that will osrt your problem out, its because things like specular mpas and stuff are artificaly added to that group, it doest have a source of light to get a 'shine' from or what ever effect you are after. at least thats what i think but putting a white textyure will work.
*GD*
WOW scott thanks that really worked (i cant seem to figure out why but making the textue 16x16 worked?) Thanks man!
The animation is still not playing tho can anyone see why??
Thanks again I really am greatfull! Ounce I work out this ai then i can start perfecting the destructable terrain and then ill be able to start the game!
The animation is still not playing tho can anyone see why??
Thanks again I really am greatfull! Ounce I work out this ai then i can start perfecting the destructable terrain and then ill be able to start the game!
My Deviant Art - http://black-crusader.deviantart.com
I really want this thing to look like a rip in time and space at the moment it just looks like a ball, witch is not so great...
Here is how it looks now (a big improvement thanks to scott) but still not really like it looks in milkshape... any suggestions??
:EDIT: The animation is still not playing tho can anyone see why??
Thanks again I really am greatfull! Ounce I work out this ai then i can start perfecting the destructable terrain and then ill be able to start the game! :EDIT:
Here is how it looks now (a big improvement thanks to scott) but still not really like it looks in milkshape... any suggestions??
:EDIT: The animation is still not playing tho can anyone see why??
Thanks again I really am greatfull! Ounce I work out this ai then i can start perfecting the destructable terrain and then ill be able to start the game! :EDIT:
My Deviant Art - http://black-crusader.deviantart.com
please explain your problem with animation a little more. Is it the virgil model?
Jonas
Focused, hard work is the real key to success. Keep your eyes on the goal, and just keep taking the next step towards completing it. If you aren't sure which way to do something, do it both ways and see which works better. - John Carmack
Focused, hard work is the real key to success. Keep your eyes on the goal, and just keep taking the next step towards completing it. If you aren't sure which way to do something, do it both ways and see which works better. - John Carmack
the specular effects in milkshape do not translate to RF. the only thing MS3D does material wise is add in the diffuse texture you specify. But, you can get this look in RF using EMBM (the BMS_ map is a lightmap/specular map that can be used for glow effects). Or you could use a smaller actor like Proj.act and attach a corona or flipbook entity to it.