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 → Need help getting player model.
Need help getting player model.
2000-10-30, 10:34 PM #1
I'm writting a cog that changes your player model when an item is activated. That is working fine. The problem comes when I need to set the original player model back. I've been using:

original = GetThingModel(player);

to try and get the 3do and then:

SetThingModel(player, original);

to set it back, but I keep turning the player into a 3do of a beam. I know that I'm missing the 3do name in the first part, but I am not sure how to do it. I tried:

original = GetThingModel(player, ());

but obviously, that just messed up the whole cog. Any help will be greatly appreciated.

mohh

"Seen it all, done it all, can't remember most of it."
2000-10-31, 1:24 AM #2
Post the entire cog (provided it isn't to large)...maybe theres something missing in the symbols section.

------------------
-El Scorcho

"One time I made a hat out of a lobster and a stick." -Pedro
-El Scorcho

"Its dodgeball time!" -Stormy Waters
2000-10-31, 5:00 AM #3
Ok, here it is:
Code:
symbols

thing       player
thing       og
int         actorFlags

message     startup
message     activated
message     pulse
message     killed

sound       lightActivate=activate04.wav
sound       lightDeactivate=deactivate04.wav

model       cloak=kypred.3do                   local

end

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

code

startup:
   og = GetThingModel(player);
   player = GetLocalPlayerThing();
   call stop_power;

   Return;

# ........................................................................................

activated:
   player = GetSourceRef();

   actorFlags = GetActorFlags(player);

   if(GetInv(player, 42))
   {
      if(BitTest(actorFlags, 4))
      {
         // Print("Cloaking Device OFF");
         jkPrintUNIString(player, 252);
         ClearActorFlags(player, 4);
         SetInvActivated(player, 42, 0);      
         PlaySoundThing(lightDeactivate, player, 1.0, -1, -1, 0x80);
         SetThingModel(player, og);
         ClearThingFlags(player, 0x10);
         SetPulse(0);
      }
      else
      {
         if(GetInv(player, 13) > 0)
         {
            // Print("Cloaking Device ON");
            jkPrintUNIString(player, 251);
            SetActorFlags(player,4);
            SetInvActivated(player, 42, 1);
            PlaySoundThing(lightActivate, player, 1.0, -1, -1, 0x80);
            SetThingModel(player, cloak);
            player = GetSourceRef();
            mode = GetSenderRef();
            SetPulse(1.5);
         }
         else
         {
            // Print("Cloaking Device out of power");
            PlaySoundThing(lightDeactivate, player, 1.0, -1, -1, 0x80);
            jkPrintUNIString(player, 253);
         }
      }
   }

Return;

# ........................................................................................

pulse:
   ChangeInv(player, 13, -10);
   if(GetInv(player, 13) == 0)
   {
      // Print("Cloaking Device out of power");
      jkPrintUNIString(player, 253);
      PlaySoundThing(lightDeactivate, player, 1.0, -1, -1, 0x80);
      SetThingModel(player, og);
      ClearThingFlags(player, 0x10);
      ClearActorFlags(player, 4);
      SetInvActivated(player, 42, 0);
      SetPulse(0);
   }

   Return;

# ........................................................................................

killed:
   player = GetLocalPlayerThing();
   if(GetSenderRef() != player) Return;

   if(IsInvActivated(player, 42) == 1)
   {
      SetPulse(0);
      ClearActorFlags(player, 4);
      SetInvActivated(player, 42, 0);
}
   Return;

# ........................................................................................

stop_power:
   SetPulse(0);
   KillTimerEx(1);
   SetInvActivated(player, 42, 0);

   Return;

end


[This message has been edited by Mohh (edited November 01, 2000).]

mohh

"Seen it all, done it all, can't remember most of it."
2000-10-31, 6:50 AM #4
With the above cog I get Katarn.

mohh

"Seen it all, done it all, can't remember most of it."
2000-10-31, 6:57 AM #5
I think that's happening because og is not getting the 3do name of the player, so it is using the default one. Is there a way to get the 3do name of the model that the player is using?

mohh

"Seen it all, done it all, can't remember most of it."
2000-10-31, 9:10 AM #6
Replace: 'thing og' with 'model og'

That should fix it.

Cheers...

Raynar


------------------
... the Jedi I admire the most, met up with Darth Maul, now he's toast ...
Rbots - a project to develop a working Bot for Jedi Knight... download the latest development version here
Pagewizard_YKS: "making your own lightsaber doesn't make you a nerd... "
Raynar - the man with a 10.75" ePenis
2000-10-31, 10:21 AM #7
I did what you adviced and it still comes up with Katarn. Thanks though. =)

mohh

"Seen it all, done it all, can't remember most of it."
2000-10-31, 12:43 PM #8
Ok, I seem to remember having this same problem back when I was messing around with restoring the player model after I chopped its limbs off as a result of being shot with something.

...I did eventually fix it, and I believe (forgive me, I wrote that cog nearly a year ago) the problem was the model wasn't defined by the game right at startup, and therefore its always retrieved the kyle model (as a default perhaps?)...I think I remember timers set at the beginning to combat the delay also didn't work for some god unknown reason. So that theroy may be incorrect.

So what I did was move the getthingmodel() out the startup message, and into the beginning of the killed message. You should be able to obtain the same results by placing your og = getthingmodel(player); at the beginning of activated instead. Give it a shot. I'm not sure thats your problem, but thats my guess for now.

------------------
-El Scorcho

"One time I made a hat out of a lobster and a stick." -Pedro


[This message has been edited by El Scorcho (edited October 31, 2000).]
-El Scorcho

"Its dodgeball time!" -Stormy Waters
2000-10-31, 5:11 PM #9
Kewl, thanks man. I'll try it out when I get home. I'm at work right now. Oh btw, should I return the model to a thing?

mohh

"Seen it all, done it all, can't remember most of it."
2000-10-31, 5:12 PM #10
No, Rayner is correct, models are models...not things.


------------------
-El Scorcho

"One time I made a hat out of a lobster and a stick." -Pedro
-El Scorcho

"Its dodgeball time!" -Stormy Waters
2000-11-01, 4:26 PM #11
Sorry to say that now it just stays cloaked. Maybe it has something to do with the fact that I use BFP2.1. Dunno, I'm going to add all of the models from BFP to my models.dat to see if that fixes it. Maybe it's been trying to find the model that I use but just can't find it so it defaults to Katarn. Thanks for the help, I'll place an update here after I've tested my theory.
I just noticed that I need to add the models to my jkstrings.uni also. Sigh... it's going to take a little while to add all of them.

[This message has been edited by Mohh (edited November 02, 2000).]

mohh

"Seen it all, done it all, can't remember most of it."
2000-11-02, 1:19 PM #12
Here's what it looks like so far:

[http://www.mohhs.com/shots/cloaking.jpg]

P.S. The field light on message will be changed on the finished cog.

mohh

"Seen it all, done it all, can't remember most of it."
2000-11-04, 6:20 AM #13
Well, even after adding all of the models from BFP2.1 I still only get Katarn. I guess the only thing to do now is to make this mod specific only for my clan by specifying the 3do for each member by matching it to their user name [http://forums.massassi.net/html/frown.gif]

mohh

"Seen it all, done it all, can't remember most of it."

↑ Up to the top!