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 → 3do template
3do template
2001-01-08, 3:47 PM #1
As some people know, I'm working on a somewhat contraversial MOD (don't see why...), it's a Build Mod. Basically it's a bunch of custom levels with custom cogs and custom 3do's to build. This won't create hackers because it'll be run as a patch.

Now my problem is that I made a custom 3do, made a template for it in my level, and added it to my level. I put in the template name in the weap_raildet.cog so it would build. It builds, but the template changes to a ghost item... I used the _walkstruct parent in the level, and the weap_raildet.cog will build OTHER 3do's fine, like landpads or catwalks... any help?
2001-01-09, 12:47 PM #2
What is a "build" mod?

------------------
"Dead Reckoning and now Dead Reckoning 2"
Dead Reckoning
2001-01-09, 4:30 PM #3
I'm guessing a "Build Mod" would be a blank level, where you could "build" your own structures using the weapons to shoot out doors and pillars. (Seen frequently in hacked games, like in Bespin, hackers that shoot out doors)

------------------
-Hell Raiser
"I am not defeated so easily!"
Co-staffer of Rbots
-Hell Raiser
2001-01-10, 5:58 PM #4
that's right... so any help?

------------------
2001-01-10, 6:28 PM #5
JK has a limit to how may things you can have in a level, like 500 give or take, so keep that in mind. =)

Oooh, and a suggestion. Since it's a mod, have a special weapon that builds the structures, and have a hotkey that changes the structure that gets fired from the build gun. [http://forums.massassi.net/html/biggrin.gif]

------------------
-Hell Raiser
"I am not defeated so easily!"
Co-staffer of Rbots

[This message has been edited by Hell Raiser (edited January 10, 2001).]
-Hell Raiser
2001-01-10, 7:32 PM #6
yeah that was the idea, but I'm still having problems with this cog... AAAAGGGHHH!!! *smashes face against keyboard repeatedly*
2001-01-13, 1:50 PM #7
why can nobody help me with this!? *continues to smash his face against the keyboard*
2001-01-13, 2:24 PM #8
Well, post the cog, I'll see if I can help.

------------------
-Hell Raiser
"I am not defeated so easily!"
Co-staffer of Rbots
-Hell Raiser
2001-01-13, 7:43 PM #9
this is the cog, where TEMPLATE is the 3do template name for the static .jkl file. the problem is that even if the parent for the template is _walkstruct, the cog (this is the weap_raildet.cog) will change the 3do template's parent template to _ghostdecor.

Code:
# Jedi Knight Cog Script
#
# WEAP_RAILDET.COG
#
# WEAPON 7 Script
#
#
#

symbols

model       povModel=rldv.3do                   local
model       weaponMesh=rldg.3do                 local
sound       mountSound=RailChargeArm01.WAV      local
sound       dismountSound=PutWeaponAway01.wav   local
sound       fireSound=RailChargeFire01.WAV      local
sound       outSound=RailChargeEmpty01.WAV      local

thing       player                              local

keyframe    mountAnim=RldVmnt.key               local
keyframe    dismountAnim=RldVdis.key            local
keyframe    povfireAnim=RldVpst1.key            local
keyframe    holsterAnim=kyhlstr.key             local

template    projectile=TEMPLATE                 local
template    projectile2=TEMPLATE                local

thing       rail                                local

flex        fireWait=0.1                        local
flex        powerBoost                          local
flex        autoAimFOV=25                       local
flex        autoAimMaxDist=5                    local
flex        holsterWait                         local

keyframe    railAnim=rld0anim.key               local

int         trackID=-1                          local
int         mode                                local
int         holsterTrack                        local

int         selectMode=1                        local

message     activated
message     deactivated
message     selected
message     deselected
#message     newplayer
message     autoselect
message     fire
message     timer

end

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

code

fire:
   player = GetSourceRef();
   mode = GetSenderRef();

   // Check that the player is still alive.
   if(GetThingHealth(player) <= 0)
   {
      Return;
   }

   // Check Ammo - If we are out, autoselect best weapon.
   if(GetInv(player, 15) < 1.0)
   {
      PlaySoundThing(outSound, player, 1.0, -1, -1, 0x80);
      if(GetAutoSwitch() & 1)
         SelectWeapon(player, AutoSelectWeapon(player, 1));
      Return;
   }

   jkPlayPOVKey(player, povfireAnim, 1, 0x38);
   SetPOVShake('0.0 -.01 0.0', '4.0 0.0 0.0', .05, 80.0);

   rail = FireProjectile(player, projectile[mode], fireSound, 18, '0.0214 0.15 0.00', '0 0 0', 1.0, 0x30, autoAimFOV, autoAimFOV*2);
   if((mode == 1) && (rail != -1))
   {
      PlayKey(rail, railAnim, 1, 20);
   }

   // Provide a kick backwards
   ApplyForce(player, VectorScale(GetThingLVec(player), -40));

   ChangeInv(player, 15, -1.0);

   powerBoost = SetThingType(rail, 6);
   ChangeFireRate(player, fireWait/powerBoost);

   Return;

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

activated:
   player = GetSourceRef();
   mode = GetSenderRef();
   jkSetWaggle(player, '0.0 0.0 0.0', 0);
   powerBoost = GetInv(player, 63);
   ActivateWeapon( player, fireWait/powerBoost, mode );
   Return;

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

deactivated:
   player = GetSourceRef();
   mode = GetSenderRef();
   jkSetWaggle(player, '10.0 7.0 0.0', 350);
   DeactivateWeapon( player, mode );
   Return;

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

selected:
   player = GetSourceRef();

   PlayMode(player, 41);
   PlaySoundThing(mountSound, player, 1.0, -1, -1, 0x80);
   jkSetPOVModel(player, povModel);
   SetArmedMode(player, 1);
   jkSetWeaponMesh(player, weaponMesh);
   jkSetWaggle(player, '10.0 7.0 0.0', 350);

   trackID = jkPlayPOVKey(player, mountAnim, 0, 20);
   SetMountWait(player, GetKeyLen(mountAnim));
   jkClearFlags(player, 0x5);
   SetCurWeapon(player, 7);

   // Check Ammo - If we are out, autoselect best weapon.
   if(GetInv( player, 15 ) < 1.0)
   {
      PlaySoundThing(outSound, player, 1.0, -1, -1, 0x80);
      if(GetAutoSwitch() & 1)
         SelectWeapon(player, AutoSelectWeapon(player, 1));
   }

   Return;

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

deselected:
   player = GetSourceRef();

   PlaySoundThing(dismountSound, player, 1.0, -1, -1, 0x80);
   jkPlayPOVKey( player, dismountAnim, 0, 18 );

   holsterWait = GetKeyLen(holsterAnim);
   SetMountWait(player, holsterWait);
   holsterTrack = PlayKey(player, holsterAnim, 1, 0x4);
   SetTimerEx(holsterWait, 2, 0.0, 0.0);
   if (trackID != -1)
   {
      jkStopPOVKey( player, trackID, 0 );
      trackID = -1;
   }
   jkSetWaggle(player, '0.0 0.0 0.0', 0);

   Return;

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

//newplayer:
//   player = GetSourceRef();
//
//   // Make sure that if the player is respawning, the old mount isn't playing anymore.
//   if (trackID != -1)
//      jkStopPOVKey(player, trackID, 0);
//
//   Return;

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

autoselect:
   selectMode = GetSenderRef();
   player = GetSourceRef();

   // If the player has the weapon
   if(GetInv(player, 7) != 0.0)
   {
      // If the player has ammo
      if(GetInv(player, 15) != 0.0)
      {

         // query for ammo
         if(selectMode == -1)
         {
            ReturnEx(900.0);
            Return;
         }

         if((selectMode == 0) && !(GetAutoPickup() & 2))
         {
            ReturnEx(900.0);
            Return;
         }

         if((selectMode == 1) && !(GetAutoSwitch() & 2))
         {
            ReturnEx(900.0);
            Return;
         }

         if((selectMode == 2) && !(GetAutoPickup() & 2))
         {
            ReturnEx(900.0);
            Return;
         }

         ReturnEx(-2.0);
         Return;

      }
      else
      {
         ReturnEx(-1.0);
         Return;
      }
   }
   else
   {
      ReturnEx(-1.0);
   }

   Return;

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

timer:
   StopKey(player, holsterTrack, 0.0);
   Return;

end


[This message has been edited by Angry_Cheddar (edited January 13, 2001).]
2001-01-13, 8:48 PM #10
Nohting wrong with the cog but elaborate on:

"the problem is that even if the parent for the template is _walkstruct, the cog will change the 3do template's parent template to _ghostdecor."

How are you finding out this information?

------------------
-Hell Raiser
"I am not defeated so easily!"
Co-staffer of Rbots
-Hell Raiser
2001-01-14, 7:41 AM #11
I make a 3do, make a template in the static .jkl with parent _walkstruct. I go into the game and it's a _ghostdecor 3do (meaning that you can walk and shoot through it as if it's not there).
2001-01-14, 10:29 AM #12
Can you post the template and parent template(s)?

------------------
-Hell Raiser
"I am not defeated so easily!"
Co-staffer of Rbots
-Hell Raiser
2001-01-14, 1:13 PM #13
I suppose...

_walkstruct parent template
Code:
# DESC: 
# BBOX: 0 0 0 0 0 0
_walkstruct       _structure         thingflags=0x400048


_ghostdecor parent template
Code:
# DESC: 
# BBOX: 0 0 0 0 0 0
_ghostdecor       _decor             collide=0


3do template (used in TEMPLATE for the cog). In this case it's platfrm1
Code:
# DESC: 
# BBOX: -1.15 -1.2 -.09 1.18 1.25 .09
platfrm1          _walkstruct        size=1.256947 movesize=1.256947 model3d=platform.3DO


[This message has been edited by Angry_Cheddar (edited January 14, 2001).]
2001-01-14, 2:38 PM #14
Hrmm, well, I'd hate to say it, but I'm stumped. =\

Last thing I can suggest is putting this at where fireprojectile() is in your cog:

dummy = fireprojectile(blah blah blah)
SetThingFlags(dummy,0x400048);

Hope this works for ya.


------------------
-Hell Raiser
"I am not defeated so easily!"
Co-staffer of Rbots
-Hell Raiser

↑ Up to the top!