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 → mots guys
mots guys
2005-06-24, 1:52 PM #1
hi there!

You know the ai good guys on MOTS? (the ones u kill and your mana goes down) Is there a cog that does that on a certain template... For JK?
2005-06-24, 2:14 PM #2
Code:
# Jedi Knight Cog Script
#
# Filename.COG
#
# Description
# 
# [darthslaw]
# 
# This Cog is Not supported by LucasArts Entertainment Co

symbols

message		startup
message		killed

thing		i		local
thing		source		local

template	tpl

sound		snd

end

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

code

startup:
	for(i = 0; i < GetThingCount(); i = i + 1)
	{
		if(GetThingTemplate(i) == tpl)
			CaptureThing(i);
	}

Return;
# ........................................................................................
killed:
	source = GetSourceRef();
	if(GetThingType(source) == 10)		//player
	{
		SetInv(source, 14, 0);		//set force to 0
		PlaySoundLocal(snd, 1, 0, 0);	//play a sound
	}

return;
end

I think that ought to work...

If you're using an AI generator of some sort (i.e. creates additional actors after the mission begins) use the variation below

Code:
# Jedi Knight Cog Script
#
# Filename.COG
#
# Description
# 
# [darthslaw]
# 
# This Cog is Not supported by LucasArts Entertainment Co

symbols

message		startup
message		pulse
message		killed

thing		i		local
thing		source		local

template	tpl

sound		snd		# played when the good guy is killed

flex		pulserate=5

end

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

code

startup:
	SetPulse(pulserate);

Return;

pulse:
	for(i = 0; i < GetThingCount(); i = i + 1)
	{
		if(GetThingTemplate(i) == tpl)
			CaptureThing(i);
	}

Return;

killed:
	source = GetSourceRef();
	if(GetThingType(source) == 10)		//player
	{
		SetInv(source, 14, 0);		//set force to 0
		PlaySoundLocal(snd, 1, 0, 0);	//play a sound
	}

return;
end
May the mass times acceleration be with you.
2005-06-24, 3:12 PM #3
cheers!

↑ Up to the top!