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 → Changing Skins
Changing Skins
2002-01-31, 4:37 PM #1
I'm having problems with a cog that I made, that changes the skin of the player. When it changes you to the Sam skin, that one works, but with all of the others, it turns you into a random 3do in the level.
Code:
symbols

message	startup
message	activated

thing		player		local
thing		Frodo
thing		Merry
thing		Pippin
thing		Legolas
thing		Gimli
thing		Gandalf
thing		Boromir
thing		Aragorn

model		Frodo=ky.3do
model		Sam=kyA10.3do
model		Merry=kyA17.3do
model		Pippin=kyI14.3do
model		Legolas=kyG7.3do
model		Gimli=kyA11.3do
model		Gandalf=kyJ1.3do
model		Boromir=kyD0.3do
model		Aragorn=kyE6.3do

sound		changedhi=set_hi2.wav
sound		changedmed=set_med2.wav
sound		changedlow=set_lo2.wav

int		change=0

end

# ========================================================================================
code

startup:
	player = GetLocalPlayerThing();
	SetThingModel(player, Frodo);

Return;

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

activated:

if(change == 0)
{
	PlaySoundThing(changedlow, player, 1.0, -1, -1, 0x80);
	Print("You are Sam");
	SetThingModel(player, Sam);
	change = 1;
}
else if(change == 1)
{
	PlaySoundThing(changedlow, player, 1.0, -1, -1, 0x80);
	Print("You are Merry");
	SetThingModel(player, Merry);
	change = 2;
}
else if(change == 2)
{
	PlaySoundThing(changedlow, player, 1.0, -1, -1, 0x80);
	Prin("You are Pippin");
	SetThingModel(player, Pippin);
	change = 3;
}
else if(change == 3)
{
	PlaySoundThing(changedmed, player, 1.0, -1, -1, 0x80);
	Print("You are Legolas");
	SetThingModel(player, Legolas);
	change = 4;
}
else if(change == 4)
{
	PlaySoundThing(changedmed, player, 1.0, -1, -1, 0x80);
	Print("You are Gimli");
	SetThingModel(player, Gimli);
	change = 5;
}
else if(change == 5)
{
	PlaySoundThing(changedhi, player, 1.0, -1, -1, 0x80);
	Print("You are Gandalf");
	SetThingModel(player, Gandalf);
	change = 6;
}
else if(change == 6)
{
	PlaySoundThing(changedhi, player, 1.0, -1, -1, 0x80);
	Print("You are Boromir");
	SetThingModel(player, Boromir);
	change = 7;
}
else if(change == 7)
{
	PlaySoundThing(changedhi, player, 1.0, -1, -1, 0x80);
	Print("You are Aragorn");
	SetThingModel(player, Aragorn);
	change = 8;
}
else if(change == 8)
{
	PlaySoundThing(changedhi, player, 1.0, -1, -1, 0x80);
	Print("You are Frodo");
	SetThingModel(player, Frodo);
	change = 0;
}

end

Thanks in advance.
"The world is neither black nor white but differing shades of gray."
-By me.
2002-01-31, 5:35 PM #2
You might try defining all those 3do's in the models .dat.

Also make sure the 3do's of all those models are in the right directory.
Team Battle.
2002-01-31, 8:00 PM #3
If you have a static.jkl list 'em in there too. If not, make one and list 'em in there anyway. [http://forums.massassi.net/html/smile.gif]
-Hell Raiser
2002-01-31, 11:15 PM #4
Try putting change = 0; in startup and in the pippin section you spelt Print wrong.
2002-01-31, 11:53 PM #5
Why declaring models also as things? Notice that Sam is only a model and it works...


[This message has been edited by Nemios (edited February 01, 2002).]
"May the SourceCode be with you..."
Nemios, MOD developer.
2002-01-31, 11:56 PM #6
But sam is declared in the master.tpl remember?
Team Battle.
2002-02-01, 1:18 AM #7
You didnt put sam as a thing, maybe the others dont work because you had them as both a model and a thing.
2002-02-01, 4:01 AM #8
You do not have to put models in the static.jkl or the models.dat.

The problems:

1) Put a return under the activated message.
2) Correct 'prin' to Print
3) Take out all of the Thing Person stuff out of your symbols - this is what fouls up your models. You can't have two variables with the same name.
4) Put change=0 in startup. As I remember, startup was only loaded once, while startup runs at the beginning of every level.


Fix those and your cog will work fine. [http://forums.massassi.net/html/wink.gif]

------------------
Each cog better than the next
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-02-01, 1:05 PM #9
Thanks, it's glad to know that you care [http://forums.massassi.net/html/wink.gif] I forgot to check my variables section. To let you all know, The first programming code I learned was the TI-83 code. It's more complicated when you can have variables with more than one letter...
"The world is neither black nor white but differing shades of gray."
-By me.
2002-02-02, 8:41 AM #10
could you email this cog to me? my email address is Leeahoward@aol.com
Duff, donuts, duff, donuts, desicions!
2002-02-02, 9:10 AM #11
Why should I send you the cog?
"The world is neither black nor white but differing shades of gray."
-By me.
2002-02-09, 11:13 AM #12
I need it
Duff, donuts, duff, donuts, desicions!
2002-02-09, 10:45 PM #13
Dang, i'm always too late to help.
One day, after everybody else quits, I'll be the best.
Sith Mercenaries
^My site.

↑ Up to the top!