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 → is there a cog that makes .......
is there a cog that makes .......
2004-08-02, 8:25 AM #1
is there a cog that makes that enemys cannot see me in rooms with xxx light mode or that enemys cannot see me when I'M in room xxx.

If Yes let me know...

------------------
SpriteMod (JO 2003)
SpriteMod (JO 2003) Roger Wilco Skin

Snail racing: (500 posts per line) ---@%
2004-08-02, 8:41 AM #2
I'm afraid not... YET!

You can either have an array of sectors and test if the player is in that sector (I'm in room xxx).

sector room0-100
for(i=0; i<=100; i=i+1)
{
If(GetThingSector(player)==room0) then...
}

Or, you can use GetSectorLight(sector) (can't see me in rooms with light xxx). Will save on symbol space.

pulse:
sector=GetThingSector(player);
if(GetSectorLight(sector)=xxx) then...

Now, for the enemies not to see you, well... You could use the 'Disable AI' cheat (whiteflag 1). It is the SetDebugModeFlags(0x1); flag.

Hope this helps.

/Edward
Edward's Cognative Hazards
2004-08-03, 8:03 AM #3
the other option is you can change the Ai to a non agressive AI. (making it much better for situation where 2 enemies can see you but others are left in the dark.) using AiSetClass

------------------
:) ;) :) ;) :) ;) :) ;) :) ;) :) ;) Im Happy
:) ;) :) ;) :) ;) :) ;) :) ;) :) ;) Im Happy
2004-08-03, 10:32 AM #4
Code:
#
# Keeps an enemy asleep until triggered awake
#
# [RD]
#
# (C) 1997 LucasArts Entertainment Co. All Rights Reserved     
# ========================================================================================

symbols

message	startup
message	pulse

thing		enemy0
thing		enemy1
thing		enemy2
thing		enemy3
thing		enemy4
thing		enemy5

sector	sect local
int i local
int pulserate=1
int countsectors
end

# ========================================================================================

code

startup:
setPulse(pulserate);
return;

# ========================================================================================

pulse:
for(sect=0; sect<countsectors; sect++)
{
If(GetThingSector(player)==sect)
{
	if (enemy0 >= 0) AISetMode(enemy0, 0x2000);
	if (enemy1 >= 0) AISetMode(enemy1, 0x2000);
	if (enemy2 >= 0) AISetMode(enemy2, 0x2000);
	if (enemy3 >= 0) AISetMode(enemy3, 0x2000);
	if (enemy4 >= 0) AISetMode(enemy4, 0x2000);
	if (enemy5 >= 0) AISetMode(enemy5, 0x2000);
}
else
{
	if (enemy0 >= 0) AIClearMode(enemy0, 0x2000);
	if (enemy1 >= 0) AIClearMode(enemy1, 0x2000);
	if (enemy2 >= 0) AIClearMode(enemy2, 0x2000);
	if (enemy3 >= 0) AIClearMode(enemy3, 0x2000);
	if (enemy4 >= 0) AIClearMode(enemy4, 0x2000);
	if (enemy5 >= 0) AIClearMode(enemy5, 0x2000);
	if (enemy0 >= 0) AISetMode(enemy0, 0x200);
	if (enemy1 >= 0) AISetMode(enemy1, 0x200);
	if (enemy2 >= 0) AISetMode(enemy2, 0x200);
	if (enemy3 >= 0) AISetMode(enemy3, 0x200);
	if (enemy4 >= 0) AISetMode(enemy4, 0x200);
	if (enemy5 >= 0) AISetMode(enemy5, 0x200);
}
}
return;

end


note "countsectors" need to be number of sectors in level. i have no idea how to detect this.
pulserate is rate in second to make cog check for player position. Should be 1 i think.
I hope it works ok
2004-08-03, 10:35 AM #5
uh i alredy know i done error. however i can change my post ;(. I dont see it. In for you need to add (after for() ):

if(getsectorlight(sect)==0)

↑ Up to the top!