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 → Aim!
Aim!
2001-12-08, 7:43 AM #1
I need a rather simple cog. It's a cog for a hotkey to just change from 1 puppet to another. (there will only be two puppets) It needs to change from puppet 1 to puppet 2 and vice versa whenever it's activated. Note: This must work in multiplayer also.

------------------
Ohh Crap! - Darien Fawkes (The Invisible Man)
Ohh Crap! - Darien Fawkes (The Invisible Man)
2001-12-16, 5:52 AM #2
?

------------------
Ohh Crap! - Darien Fawkes (The Invisible Man)
Ohh Crap! - Darien Fawkes (The Invisible Man)
2001-12-16, 6:09 AM #3
Try something like this:

Code:
# Puppet Toggle
symbols

thing       player

message     activated
message     trigger
end

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

code

activated:
   player = GetSourceRef();
   if(SWITCH == 0)
   {
   // Change PUPPET1 to your own custom Text 
   Print("PUPPET1");
   SendTrigger(-1, 987123, 1, player, 0, 0);
   SWITCH = 1;
   Return;
   }
   if(SWITCH == 1)
   {
   // Change PUPPET2 to your own custom Text 
   Print("PUPPET2");
   SendTrigger(-1, 987123, 2, player, 0, 0);
   SWITCH = 0;
   Return;
   }
   Return;

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

trigger:
   if(GetSourceRef() == 987123)
   {
     if(GetParam(0) == 1)
     {
     // Change 1.pup to your custom puppet 
     ParseArg(GetParam(1), "puppet=1.pup");
     Return;
     }
     if(GetParam(0) == 2)
     {
     // Change 2.pup to your custom puppet 
     ParseArg(GetParam(1), "puppet=2.pup");
     Return;
     }
   }
   Return;

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

end
- Wisdom is 99% experience, 1% knowledge. -
2001-12-16, 7:51 AM #4
Umm, New_guy, you forgot to define 'SWITCH'. I know, you might be able to get away with it, but ONLY if another cog defines said variable WITHIN THE SAME JKL.

------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2001-12-16, 9:49 AM #5
You are wrong.

Cog doesnt require you to define any variable prior to using it.

Try it.
- Wisdom is 99% experience, 1% knowledge. -
2001-12-16, 10:55 AM #6
If I remember right, you can only change the .pup file once with ParseArg(), and then you're stuck that way. I might be wrong.

------------------
-There are easier things in life than finding a good woman, like nailing Jello to a tree, for instance

-Tazz
-There are easier things in life than finding a good woman, like nailing Jello to a tree, for instance

Tazz
2001-12-16, 11:05 AM #7
It didnt seem to be a problem when I was testing the version I posted above, but I know ParseArg(); can be a little unstable.
- Wisdom is 99% experience, 1% knowledge. -
2001-12-16, 5:01 PM #8
Hmmm. No he's right about both here. U don't have to declare variables before you use them. Usually at least. And he is also right, you can use parse arg to change puppet more than once. My note here is that it won't work in MP. Why? Because the puppets aren't declared in the JKL file. So it will work locally (in theory). I may be wrong, just guessin here.
2001-12-16, 5:24 PM #9
It doesn't need to work in MP. Animations/puppets are always synced (I think) over the network. Spork 1.2 changes the puppets back and forth, so does SBX.
Bassoon, n. A brazen instrument into which a fool blows out his brains.
2001-12-17, 2:26 AM #10
No - ParseArg() is a local verb. You'll need to use SendTrigger() to update it in multiplayer.

↑ Up to the top!