PDA

View Full Version : Trooper through Doors in SP?



DevoSolo
01-26-2001, 09:29 PM
I have yet to figure out how to get my trooper ai to open a door, and then walk through it...
_noOneatall wrote up this script...
Could sumone check it and tell me why it is or isnt working?


symbols
float dist
thing door
thing trooper
message startup
message pulse
message timer
end

code
startup:
MoveToFrame( door, 0 );
SetPulse( 1.0 );
return;
pulse:
if( VectorDist( trooper, door ) < dist )
{
MoveToFrame( door, 1 );
SetTimer( 5.0 );
}
return;
timer:
MoveToFrame( door, 0 );
return;
end

Maybe the lines are in the wrong order or sumthing... Ive tried everything in my knowledge to get it to work, but thats very limited. I know sumone has the right script.
If anyone knows of a single player level with this sort of script, let me know.




------------------
I always drink coffee while I watch radar!

Hideki
01-27-2001, 07:05 AM
I think ai opens doors with its AI file setting.

------------------
http://millennium.massassi.net/ - Millennium

Jipe
01-27-2001, 10:03 AM
symbols

thing door
thing trooper

message startup
message arrived

end

code

startup:
MovetoFrame(door, 0);
MovetoFrame(stormtrooper, 1);
return;

arrived:
if(GetSenderRef() != stormtrooper) return;
else
{
if(GetCurFrame(stormtrooper) != 1) return;
else
{
MoveToFrame(door, 1);
MoveToFrame(stormtrooper, 2);
}
}
return;

end


Sorry it took so long, DevoSolo. I've been swamped in real life. This is a roundabout way of doing it - description:

door, frame 0: closed door position
door, frame 1: open door position

stormtrooper, frame 0: start position
stormtrooper, frame 1: position slightly before the door
stormtrooper, frame 2: position on other side of door, wherever you want him to stop

-Jipe

[Edit: Changed GetThingFrame to GetCurFrame, after realizing the former doesn't exist! http://216.105.160.32/html/smile.gif]

[This message has been edited by Jipe (edited January 27, 2001).]

DevoSolo
01-27-2001, 04:00 PM
So do I set the numframes for the door to 2, and the numframes for the trooper to 3? Which frame is frame 0? the first frame?
Maybe you could implement it into my level for me, cuz I cant seem to figure this out.
Isnt the trooper thing supposed to be stormtrooper?
Thanx for fitting me into your bizzy schedule!

Also Hideki, all my trooper ais have Opendoors in them, but I havent figured out why the doors still dont open.


[This message has been edited by DevoSolo (edited January 27, 2001).]