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 → Would it be possible to make the darkjedi cogs into actor cogs?
Would it be possible to make the darkjedi cogs into actor cogs?
2003-05-16, 3:22 PM #1
I'm trying to modify/remake the darkjedi cogs so that they can be used as actor cogs, but I don't know how to get the cog to recognize the actor. I would think that you would use getsenderref() to get the cog to find the actor, but I'm not sure.

I tried adding "darkjedi=getsenderref()" to the startup part of the code, but it didn't work, I don't know how to make this work. So I'm asking for some help with this, so if anyone is willing to give any, thanks.

------------------
Look for my current project, The Force in Your Soul.
Last week I cudn't evn spel grajuat, but now I is one.

*Takes out his blaster and fires shots at the wall, the blastmarks leave the words "S-TROOPER WUZ 'ERE!!!"
2003-05-16, 3:40 PM #2
the 'startup' message doesnt send anything that 'GetSenderRef()' could use.
if the cog is in the things template all the things messages such as damaged, killed, activated, fire, and created are sent to the cog, then you can use GetSenderRef() to tell which actor the message is from.
just put darkjedi = GetSenderRef() at the top of all the messsage sections.
hope that helps.

------------------
Famous last words - "It seemed like a good idea at the time."

[This message has been edited by DSLS_DeathSythe (edited May 16, 2003).]
Famous last words - "It seemed like a good idea at the time."
2003-05-16, 6:00 PM #3
I think (it's been a while) that you add cog=someactor.cog to the actor's template file. Then, you don't actually have to add the cog to the jkl. However, that makes it so most (if not all) parameters you try to pass from the jkl to the cog won't work (at least in my experience). Depends what you're trying to do, exactly.

And ALWAYS remember to reload templates in Jed! [http://forums.massassi.net/html/smile.gif]
------------------
"The Just shall live by faith." - Galatians 3:11

[This message has been edited by DogSRoOL (edited May 16, 2003).]
Catloaf, meet mouseloaf.
My music
2003-05-17, 5:43 AM #4
Ok, here's my cog, but for some reason it gives the player, not the actor, the saber, and when the actor dies, the saber shrinks lik when it is deactivated or when a jedi dies, can anyone tell whats wrong?
Code:
symbols

message     startup
message     newplayer
message     damaged
message     killed

thing       darkjedi                         mask=0xfff  local

flex        damage                           local
int         damageType                       local

material    tip_mat=saberblue0.mat         local
material    side_mat=saberblue1.mat        local

template    tpl_wall=+ssparks_wall           local
template    tpl_blood=+ssparks_blood         local
template    tpl_saber=+ssparks_saber         local

int         victim                           local

end

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

code

startup:
newplayer:

   darkjedi = GetSenderRef();

   jkSetPersuasionInfo(darkjedi, 8, 16);
   jkSetSaberInfo(darkjedi, side_mat, tip_mat, 0.003, 0.001, 0.100, tpl_wall, tpl_blood, tpl_saber);
   jkSetFlags(darkjedi, 0x5);

   Return;

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

killed:

   darkjedi = GetSenderRef();

   ClearActorFlags(darkjedi, 0x80);
   jkClearFlags(darkjedi, 0x20);
   SetThingCurGeoMode(darkjedi, GetThingGeoMode(darkjedi));

   jkSetFlags(darkjedi, 0x8);

   Return;

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

damaged:

   darkjedi = GetSenderRef();

   damage = GetParam(0);
   damageType = GetParam(1);

   if(damageType & 1)                        // IMPACT
      damage = damage / 2;
   else
   if(damageType & 2)                        // ENERGY
      damage = damage / 2;
   else
   if(damageType & 4)                        // FIRE
      damage = damage / 10;
   else
   if(damageType & 8)                        // FORCE
      damage = damage;
   else
   if(damageType & 16)                       // SABER
      damage = damage;

   ReturnEx(damage);
   Return;

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

end


------------------
Look for my current project, The Force in Your Soul.
Last week I cudn't evn spel grajuat, but now I is one.

*Takes out his blaster and fires shots at the wall, the blastmarks leave the words "S-TROOPER WUZ 'ERE!!!"
2003-05-17, 7:57 AM #5
i made me some darkjedi actors a while ago (but they were for MotS).
when i did it i used a cog that when a switch was activated in the level the darkjedi was created.
i made the actor cog so that when it got the created message it setup the darkjedi's saber.
something like this:
Code:
created:
  darkjedi = GetSenderRef();
  jkSetSaberInfo(darkjedi, side_mat, tip_mat, 0.003, 0.001, 0.100, tpl_wall, tpl_blood, tpl_saber);
return;

thats the way i did it. you would need another cog put in the level that creates the actor when the level starts.

------------------
Famous last words - "It seemed like a good idea at the time."

[This message has been edited by DSLS_DeathSythe (edited May 17, 2003).]
Famous last words - "It seemed like a good idea at the time."
2003-05-17, 9:06 AM #6
I'll try that, but I'm trying to make it so that you wouldn't have to add another cog to the level like you have to do with the darkjedi. I'm trying to make it so that they can be added like any other actor, such as the Imperial Officer, you just add that to the level and its there, no level cogs used, but I'll try what you did.

Thanks for the help.

[EDIT]i muts lern to speel sumdaa...[/EDIT]

------------------
Look for my current project, The Force in Your Soul.
Last week I cudn't evn spel grajuat, but now I is one.

*Takes out his blaster and fires shots at the wall, the blastmarks leave the words "S-TROOPER WUZ 'ERE!!!"

[This message has been edited by Stormtrooper (edited May 17, 2003).]
2003-05-17, 9:50 AM #7
OK, I think I got it working, I took out the newplayer message and changed starup to created and added
Code:
created:

  darkjedi = GetSenderRef();
  Print("test");
  jkSetPersuasionInfo(darkjedi, 8, 16);  //copied from newplayer message
  jkSetSaberInfo(darkjedi, side_mat, tip_mat, 0.003, 0.001, 0.100, tpl_wall, tpl_blood, tpl_saber);
  jkSetFlags(darkjedi, 0x5);  //copied from newplayer message
return;

in the place of the startup message, thanks for the help.

------------------
Look for my current project, The Force in Your Soul.
Last week I cudn't evn spel grajuat, but now I is one.

*Takes out his blaster and fires shots at the wall, the blastmarks leave the words "S-TROOPER WUZ 'ERE!!!"

↑ Up to the top!