Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → Trooper through Doors in SP?
Trooper through Doors in SP?
2001-01-26, 6:29 PM #1
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!
2001-01-27, 4:05 AM #2
I think ai opens doors with its AI file setting.

------------------
http://millennium.massassi.net/ - Millennium
2001-01-27, 7:03 AM #3
Code:
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).]
2001-01-27, 1:00 PM #4
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).]

↑ Up to the top!