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 → 2 cogs
2 cogs
2002-02-22, 12:10 AM #1
Don't you hate titles that tell you nothing of what is in the thread? Anyway:
I'm new to cogging. okaay
So can someone write me a cog where it changes the textures on the player? Its simple but i can't figure it out?!
And can someone show me a cog that changes the camera position?
Plz!

------------------
Never made it as a wise man
I couldn't cut it as
A poor man stealing
Tired of living like a blind man
I'm sick of sight without
A sense of feeling
And this is how you remind me
Producer->Prey->Predator
2002-02-22, 2:38 AM #2
You can't change the textures on a player through a cog, but you can change the player's model to an identical model with a different skin. That would produce the effect of chaning textures.

The function that'll do that is SetThingModel(thing, model).
Dreams of a dreamer from afar to a fardreamer.
2002-02-22, 10:06 AM #3
Okey Dokey, but that doesn't mean much to me. It seems like a simple cog though, so can someone help?
Producer->Prey->Predator
2002-02-23, 6:21 AM #4
anyone?
Producer->Prey->Predator
2002-02-23, 7:32 AM #5
When do you want the 3do to change??

------------------
So young so angry damn that rap music

[This message has been edited by C_T (edited February 23, 2002).]
So young so angry damn that rap music
2002-02-24, 9:15 AM #6
By hotkey
Producer->Prey->Predator
2002-02-24, 12:04 PM #7
>You can't change the textures on a player through a cog,

Haven't tested it, but I think you can use SetMaterialCel() to change a material directly so all things that use the material will be affected - including things like the player.

------------------
Each cog better than the next
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-02-24, 1:28 PM #8
Yep. 'Setmaterialcel()' is global, meaning archi, sprites, 3d0s, EVERYTHING with that material, the celnum is changed.

------------------
Success is the inverse relationship between effort, gain, and loss.

JK editing resources.
And when the moment is right, I'm gonna fly a kite.
2002-02-25, 5:13 AM #9
You didn't say how you wanted the material to change, but the cog below demonstrates how the material can be changed.

Code:
# mathotkey.cog
#
# Change a material's cels when the hotkey is pressed.
#
# [SM]
#======================================================================#
symbols

message	activated
message	startup

int		count			local
int		numCels=3		local
material	mat=yourMat.mat	local

end
#======================================================================#
code
#----------------------------------------------------------------
startup:
	count=0;

Return;
#----------------------------------------------------------------
activated:
	count=count+1;
	if(count > numCels) count=0;
	SetMaterialCel(mat, count);

Return;
#----------------------------------------------------------------
end


If you haven't already, you'll have to replace the player's mats with a multi-celled mat. Put the name of the mat in the symbols and give numCels the real number of cels in your multi-celled mat.

There you go. [http://forums.massassi.net/html/smile.gif]

------------------
Each cog better than the next
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-02-25, 6:42 AM #10
Thankyou Very much [http://forums.massassi.net/html/smile.gif]
Producer->Prey->Predator

↑ Up to the top!