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 → Surface transluctancy changing thingy motion blur you get the point click me!
Surface transluctancy changing thingy motion blur you get the point click me!
2004-08-16, 8:14 PM #1
Ok I need to get a cog that makes it when you use a bacta aswell as giving the health it also makes all the surfaces in the level get a face flag value of 2. After 10 seconds they all change back to thier origonal state. Here is a bacta cog to save you time.

Code:
# Jedi Knight Cog Script
#
# ITEM_BACTA.COG
#
# INVENTORY script - Bacta Tank
#
# [CYW & YB]
#
# (C) 1997 LucasArts Entertainment Co. All Rights Reserved
# ========================================================================================

symbols

sound			bactaSnd=BactaUse01.WAV
thing			player

message		activated

end

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

code

activated:
	player = GetSourceRef();
	if(GetInv(player, 40) > 0.0)
	{
		if(GetHealth(player) < 100)
		{
			// Print("Using Bacta");
			jkPrintUNIString(player, 250);
         PlaySoundThing(bactaSnd, player, 1.0, -1, -1, 128);
			HealThing(player, 30.0);
			ChangeInv(player, 40, -1.0);
			if(GetInv(player, 40) == 0) SetInvAvailable(player, 40, 0);
		}
	}
	
	Return;

end



Thanks.

------------------
~Nightfire Mod~
Spoting an error in post will result in a $100 reward.
Offer expires on 6/6/06. Valid one per customer, per day.

Rangi
2004-08-17, 5:32 AM #2
I ripped the code in the blur: and unblur: messages directly from GBK's "bluromatic" cog, and also the startup message.

Code:
# Jedi Knight Cog Script
#
# ITEM_BACTA.COG
#
# INVENTORY script - Bacta Tank
# Modified by Darth Slaw
# I used one of GBK's cogs for the blur/unblur algorithm, so he gets credit for that  [http://forums.massassi.net/html/smile.gif]
#
# [CYW & YB]
#
# (C) 1997 LucasArts Entertainment Co. All Rights Reserved
# ========================================================================================

symbols

sound			bactaSnd=BactaUse01.WAV		local
thing			player				local

int			i				local

message			startup
message			activated
message			timer

end

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

code
Startup:
	# First things first...
	# Loop though all the surfs and pull off any 0x1 face flags
	For(I=0;I<=GetSurfaceCount();I=I+1)
		If(GetFaceType(I) & 0x1)
			ClearFaceType(I, 0x1);
Stop;

activated:
	player = GetSourceRef();
	if(GetInv(player, 40) > 0.0)
	{
		if(GetHealth(player) < 100)
		{
			// Print("Using Bacta");
			jkPrintUNIString(player, 250);
         		PlaySoundThing(bactaSnd, player, 1.0, -1, -1, 128);
			HealThing(player, 30.0);
			ChangeInv(player, 40, -1.0);
			if(GetInv(player, 40) == 0) SetInvAvailable(player, 40, 0);
			call blur;
			SetTimerEx(10, 1, 0, 0);
		}
	}
	
	Return;
timer:
	if(GetSenderID() == 1)
	{
		call unblur;
	}
stop;

unblur:
	For(I=0;I<=GetSurfaceCount();I=I+1)
	{
		If(GetFaceType(I) & 0x1)
			ClearFaceType(I, 0x1);	# Remove 0x1 if window.
		Else
			ClearFaceType(I, 0x2);
	}

stop;

blur:
	For(I=0;I<=GetSurfaceCount();I=I+1)
	{
		If(GetFaceType(I) & 0x2)
			SetFaceType(I, 0x1);	# Set 0x1 if window
		Else
			SetFaceType(I, 0x2);
	}

stop;

end


------------------
nytfyre m0d || f33l t3h p0w3r || t3h l0st c0gz || OMF > *
May the mass times acceleration be with you.
2004-08-17, 6:08 PM #3
Thanks alot Slaw that worked great!

------------------
~Nightfire Mod~
Spoting an error in post will result in a $100 reward.
Offer expires on 6/6/06. Valid one per customer, per day.

Rangi
2004-08-18, 4:06 AM #4
Good to know my code is still foating around out there... [http://forums.massassi.net/html/wink.gif]

------------------
Dear lady, can you hear the wind blow, and did you know
Your stairway lies on the whispering wind.
:wq!
And when the moment is right, I'm gonna fly a kite.

↑ Up to the top!