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 → StormTrooper Opens doors?
StormTrooper Opens doors?
2003-07-02, 2:38 AM #1
Hi!
I was wondering, how do I get a rstorm to open doors when it touches one?

And also, how do I make one AIsleep, but still roam?

/Edward
Edward's Cognative Hazards
2003-07-02, 4:01 AM #2
opening doors is handled in the AI file. I think it's "opendoors", to be certain you might want to check out the ai file of a imperial officer, since they can open doors.
The verb should be there, just copy paste it into your stormtrooper ai file.

------------------
Call me Vedder.
Author of: A Pirate's Tale (Mots SP)
APT homepage
----
<phantom> You're always going to be aloser if you attempt to aspire to massassi standards.
<phantom> They're a bunch of socially inadequate <beep> whores who have little or no lives.
APT 1, 2, 3/4, 5/6
TDT
DMDMD

http://veddertheshredder.com
2003-07-02, 4:24 AM #3
I've had a look at the AI of an IODefault and I found the OpenDoors. Then I had a look at the 00_door.cog and found a message called OpenDoors. I think I can guess how this works... When officer touches an object, check to see what COG is in. If this COG contains the OpenDoors message, then open the door.
But what if I have a door COG I've made myself and I want anyone who wonders into it to call the activate message. How do I do that? They don't have to be fixed on a target to open the door, I want them to wonder freely. (Might even want them to ride an elevator)

/Edward
Edward's Cognative Hazards
2003-07-02, 2:46 PM #4
The default rstorm template in JK can open doors. [http://forums.massassi.net/html/confused.gif]

Anyway, the OpenDoors AI directive will make an actor trigger the activated event of the doors that it touches. The 'OpenDoors' message is just some custom message that doesn't do anything by itself.

Quote:
<font face="Verdana, Arial" size="2"> How do I do that? They don't have to be fixed on a target to open the door, I want them to wonder freely. (Might even want them to ride an elevator)</font>


For that, you're going to need to use cog and some AI frames. You can't do that with just AI.

Quote:
<font face="Verdana, Arial" size="2">And also, how do I make one AIsleep, but still roam?</font>


Not sure what you mean, but depending on what you want, you'll need to reset the AI's flags with a cog.

------------------
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2003-07-03, 12:07 AM #5
Funny...
Quote:
<font face="Verdana, Arial" size="2">
The default rstorm template in JK can open doors.
</font>

Well, it won't open my door.
Quote:
<font face="Verdana, Arial" size="2">
For that, you're going to need to use cog and some AI frames. You can't do that with just AI.
</font>

AI frames? You mean, I have to put out precice positions? But I want them to choose a random position, go that way, and if they bump into an activatable object they activate it, and if they don't get anywhere for quite some time, new position...
Ok, I've just described what kind of COG I want... Help please?
Oh, and I also want them to activate stuff even when they have no gun and panicing.
Quote:
<font face="Verdana, Arial" size="2">
Not sure what you mean, but depending on what you want, you'll need to reset the AI's flags with a cog.
</font>

Well, a rstorm won't go anywhere when you give him the 00_aisleep.cog. What do I need so he will go anywhere but still won't hurt the player...

/Edward
Edward's Cognative Hazards
2003-07-03, 10:30 AM #6
Quote:
<font face="Verdana, Arial" size="2">Well, it won't open my door.</font>

You realize that your actor has to see you, and then try to chase you to open the door? He won't open it for no reason. Use the touched event in your door's cog if you want him to open the door regardless.

Quote:
<font face="Verdana, Arial" size="2">AI frames? You mean, I have to put out precice positions? But I want them to choose a random position, go that way, and if they bump into an activatable object they activate it, and if they don't get anywhere for quite some time, new position...</font>


I mean, you're going to have use frames or set positions if you want your actors to ride elevators reliably. But to just get them to wander around, use the Roam instinct and take out the ReturnHome instinct.

Quote:
<font face="Verdana, Arial" size="2">What do I need so he will go anywhere but still won't hurt the player...</font>


Ok, just give your actor an ai file that doesn't have any aggressive instincts. Then when you want him to attack on some event, switch his ai to an aggressive one.

------------------
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.

[This message has been edited by SaberMaster (edited July 03, 2003).]
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2003-07-03, 11:27 PM #7
Quote:
<font face="Verdana, Arial" size="2">
Use the touched event in your door's cog if you want him to open the door regardless.
</font>

How? I have no idea what kind of roaming (or panicing) actor will bump into these doors. How do I ask for a touch from anyone but the player?

Oh, and how do I change the AI in a JK COG?

/Edward
Edward's Cognative Hazards
2003-07-04, 10:17 AM #8
If you want all rstorm actors in the level to be able to do open the door, then use something like:
Code:
touched:
   source = GetSourceRef();
   if(GetThingTemplate(source) != stormTemp) Return;
   // and to stop panicing AI
   if(AIGetMode(source) & 0x800) Return;
activated:  // original activated message


Or you could use 'if(source == GetLocalPlayerThing()) Return;' to let any actor open the door on touched except for the player.

AISetClass() is used to change an actor's AI through cog.

------------------
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2003-07-05, 7:57 AM #9
It didn't work! They came to the door, and tried to shoot right through it. And when I took their weapons away, and they paniced to the door, it didn't open!
Code:
touched:
	if(GetSourceRef() == GetLocalPlayerThing()) Return;
	IF(frame==1) RETURN;
	frame=1;
	MOVETOFRAME(door,1,speed);
	WAITFORSTOP(door);
	SLEEP(delay);
	MOVETOFRAME(door,0,speed);
	WAITFORSTOP(door);
	frame=0;
RETURN;
end

What I've done...

/Edward
Edward's Cognative Hazards
2003-07-05, 4:20 PM #10
Well, that code looks fine. Can you post the whole cog? Or better yet, can you send me the level?

------------------
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2003-07-05, 10:23 PM #11
I'm sorry, I can't send the level. Last time I did that, it all became a mess!
Code:
# This is a plain old door.
#
# By Edward
symbols

message	startup
message	activated
message	touched

thing		door
flex		speed
flex		delay

int		frame=0	local
int		channel=1	local

end
#
code
startup:
	MOVETOFRAME(door,0,1000);
activated:
	IF(GETSENDERREF()!=door) RETURN;
	IF(frame==1) RETURN;
	frame=1;
	MOVETOFRAME(door,1,speed);
	WAITFORSTOP(door);
	SLEEP(delay);
	MOVETOFRAME(door,0,speed);
	WAITFORSTOP(door);
	frame=0;
RETURN;
touched:
	if(GetSourceRef() == GetLocalPlayerThing()) Return;
	IF(frame==1) RETURN;
	frame=1;
	MOVETOFRAME(door,1,speed);
	WAITFORSTOP(door);
	SLEEP(delay);
	MOVETOFRAME(door,0,speed);
	WAITFORSTOP(door);
	frame=0;
RETURN;
end

Basicaly the same as door.cog only that I added the touched...

/Edward
Edward's Cognative Hazards
2003-07-06, 11:45 AM #12
Don't know what to tell you, that cog will work. Looks like you need a return just before activated, and that startup move speed is way too high. But it should work.

Quote:
<font face="Verdana, Arial" size="2">I'm sorry, I can't send the level. Last time I did that, it all became a mess!</font>


Howso? Just zip your project folder and email it to me.

------------------
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2003-07-09, 8:53 AM #13
Well, last time I needed to send just one level (out of 3) to a friend and I thought I gave him only what he needed. It seemed that he was missing files. I know! You make a level with some changes (player model and key files), then add the door.cog to all doors, and then fiddle with this AI file and tell me what you've got...
Code:
# Jedi Knight AI File
#
# STROAM.AI
#
# Stormtrooper/Fieldtrooper with Rifle AI
# Medium difficulty
# Roams
#
# [CR]
#
# (C) 1997 LucasArts Entertainment Co. All Rights Reserved


alignment=-1.0, rank=0.5, fov=170, maxstep=0.2, sightdist=5.0, heardist=2.0, accuracy=0.20

#instinct			args
LookForTarget   	500.0, 45000.0
Listen          	0.75, 2.0
PrimaryFire     	2000.0, 0.8, 5.0, 0.20, 0.0, 300.0, 0.20, 0.00, 2.0, 500.0
BlindFire       	1500.0, 0.50, 0, 0.8, 0.0, 0.20
Follow          	0.0, 1.5
OpenDoors
CircleStrafe    	6000.0, 30.0, 1.5, 1000.0, 1.0
Roam            	3000.0, 1.5
Talk            	10000.0, 0.10

Oh, and why I don't give the WHOLE thing? Because it is over 70MB...
Edward's Cognative Hazards
2003-07-09, 2:32 PM #14
In your door cog, add ' mask=0x405' after 'thing door.' See if that fixes it.

------------------
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2003-07-10, 2:10 AM #15
It Worked! The stormies open the doors! Now to do the same thing with my other objects...

Thanks!
Forgot about the mask...

/Edward
Edward's Cognative Hazards
2003-07-14, 7:00 AM #16
You know, you could make it so when you take their weapon away, they don't run randomly (like you wanted them to stop doing), but still get their extra speed (so they are in a hurry to escape through a door)
Another idea: you could have a small weapons box in the room they are in, and in the skill sectoin of the cog, you make them run to the box and a weapon appears in their hand, their mode switches to attack again, and they chase you through doors, etc again.

------------------
- Laserjolt

Editing Abilities/Skills:
(In order from least to most skill)

DLL, SFT, BM, CMP, KEY, DAT, PAR, COG, 3DO, MAT, SPR, TPL, SND, PUP, AI#, WAV, UNI

Folder: LucasArts
Size: 3.29 GB (3,540,445,700 bytes)
Size On Disk: 2.08 GB (2,239,862,836 bytes)
Contains: 21,338 Files, 938 Folders

[This message has been edited by Laserjolt (edited July 14, 2003).]
Folder: LucasArts
Size: 7.41 GB (7,957,329,759 bytes)
Size on Disk: 5.16 GB (5,544,473,484 bytes)
Contains: 28,807 Files, 1187 Folders
Last Updated: 3/29/05

↑ Up to the top!