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 → Need cog modified....
Need cog modified....
2003-06-16, 7:04 PM #1
This cog need to be changed so that the AI are triggered not by the entrance to a sector, but by the activation of a switch.

Code:
# Jedi Knight Cog Script
#
# 00_AIFrameMove.cog
#
# Like AIFramePatrol but just one way, triggered by entry into a sector
#
# [RD]
#
# (C) 1997 LucasArts Entertainment Co. All Rights Reserved     
# ========================================================================================

symbols
message	entered
message	arrived

sector	trigger

thing		mover

float		patrolspeed=1	// defaults to walk
float		numframes=1		// total frames, not including frame 0

int		curframe=1		local
int		begun=0		local
end

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

code

entered:
	if (begun) return;
	
	begun = 1;
	AISetMoveSpeed(mover, patrolspeed);
	AISetLookFrame(mover, curframe);
	AISetMoveFrame(mover, curframe);
	return;
	
# ........................................................................................

arrived:
	curframe = curframe + 1;
	if (curframe > numframes) return;

	AISetLookFrame(mover, curframe);
	AISetMoveFrame(mover, curframe);
	return;

end


Thanks in advance, and credit will be given.

------------------

Restless 2

Sanctum de la Mort


[This message has been edited by Dash_rendar (edited June 16, 2003).]
2003-06-17, 7:09 AM #2
So easy. Change entered to activated (don't forget in the symbols section, too), remove the sector from the symbols and replace it with a surface, and after "mover" put "nolink" (to prevent the message from being sent if it somehow gets activated). That should do it.

------------------
"The Just shall live by faith." - Galatians 3:11
To edit is human... To COG is divine!!

pegasus_1984: Stop bushing that dang suck button.
guitarofgold: NOOOOOOOOO!!!!
Catloaf, meet mouseloaf.
My music
2003-06-17, 7:47 AM #3
Going to test it now...

Code:
# Jedi Knight Cog Script
#
# 00_AIFrameMove.cog
#
# Like AIFramePatrol but just one way, triggered by entry into a sector
#
# [RD]
#
# (C) 1997 LucasArts Entertainment Co. All Rights Reserved     
# ========================================================================================

symbols
message	activated
message	arrived

surface	trigger

thing		mover           nolink

float		patrolspeed=1	// defaults to walk
float		numframes=1		// total frames, not including frame 0

int		curframe=1		local
int		begun=0		local
end

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

code

activated:
	if (begun) return;
	
	begun = 1;
	AISetMoveSpeed(mover, patrolspeed);
	AISetLookFrame(mover, curframe);
	AISetMoveFrame(mover, curframe);
	return;
	
# ........................................................................................

arrived:
	curframe = curframe + 1;
	if (curframe > numframes) return;

	AISetLookFrame(mover, curframe);
	AISetMoveFrame(mover, curframe);
	return;

end


------------------

Restless 2

Sanctum de la Mort

↑ Up to the top!