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 In-Game
Changing Skins In-Game
2002-08-28, 10:52 AM #1
I know I've seen this done before, but I've never could figure out how to get it done on my own.

I suppose it's relatively simple. When the player crosses an adjoin, I'd want it to instantly change the model/skin to a predetermined one.

Like I said, I know this is possible, I've just haven't been able to suceed.

------------------
"If you enjoyed the show, tell your friends. If you didn't, tell your enemies."
"If you enjoyed the show, tell your friends. If you didn't, tell your enemies." - RSC

"Love's a joke. Unfortunately, I'm a comedian." - Me
2002-08-28, 2:01 PM #2
Code:
# skinchange.cog
#   Changes the playermodel upon crossing an adjoin.
# [Grismath]
#======================================================================================#
symbols
message		crossed
surface		crossSurf	local
int		passed=0	local
model		changer
end
#======================================================================================#
code
#--------------------------------------------------------
crossed:
if(passed==0) {
 if(GetSenderRef()==crossSurf) SetThingModel(GetLocalPlayerThing(), changer);
 passed=1;
}
return;
#--------------------------------------------------------
end


There ya go.

[This message has been edited by Lord_Grismath (edited August 28, 2002).]
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.
2002-08-28, 4:13 PM #3
Thanks a bunch.

[EDIT:] Uh...I can't get it to work. Is there anything specific I need to do, like change the cog to fit my exact needs?

------------------
"If you enjoyed the show, tell your friends. If you didn't, tell your enemies."

[This message has been edited by ComicKook (edited August 28, 2002).]
"If you enjoyed the show, tell your friends. If you didn't, tell your enemies." - RSC

"Love's a joke. Unfortunately, I'm a comedian." - Me
2002-08-29, 1:44 AM #4
Oops, heh, I had one too many local symbols.

Code:
# skinchange.cog
#   Changes the playermodel upon crossing an adjoin.
# [Grismath]
#======================================================================================#
symbols
message		crossed
surface		crossSurf
int		passed=0	local
model		changer
end
#======================================================================================#
code
#--------------------------------------------------------
crossed:
if(passed==0) {
 if(GetSenderRef()==crossSurf) SetThingModel(GetLocalPlayerThing(), changer);
 passed=1;
}
return;
#--------------------------------------------------------
end
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.
2002-08-29, 5:44 PM #5
Thanks once more.

------------------
"If you enjoyed the show, tell your friends. If you didn't, tell your enemies."
"If you enjoyed the show, tell your friends. If you didn't, tell your enemies." - RSC

"Love's a joke. Unfortunately, I'm a comedian." - Me
2002-09-06, 11:10 AM #6
Uh...it works. But for some reason it only changes the player into a bacta tank. [http://forums.massassi.net/html/confused.gif]

Any way to fix this?

------------------
"If you enjoyed the show, tell your friends. If you didn't, tell your enemies."

[This message has been edited by ComicKook (edited September 07, 2002).]
"If you enjoyed the show, tell your friends. If you didn't, tell your enemies." - RSC

"Love's a joke. Unfortunately, I'm a comedian." - Me
2002-09-08, 1:03 AM #7
Make sure that 'changer' isn't defined as the bacta tank model in JED.
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.
2002-09-08, 6:43 AM #8
I did that. No matter what model I assign it to, it still changes the player into a bacta tank.

------------------
"If you enjoyed the show, tell your friends. If you didn't, tell your enemies."
"If you enjoyed the show, tell your friends. If you didn't, tell your enemies." - RSC

"Love's a joke. Unfortunately, I'm a comedian." - Me
2002-09-08, 12:23 PM #9
Open up your JKL and search for "section: cogs". You should see your new cog in the list. Make sure the model listed after the cog on the same line is the model you selected and not bact.3do.

If you see bact.3do, JED is to blame. If not, then you have a more general problem with your level.

If you still can't get it to work, try using LoadModel("yourModel.3do") instead of the changer variable in the cog.

------------------
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.

[This message has been edited by SaberMaster (edited September 08, 2002).]
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.

↑ Up to the top!