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 → Fun with JED till daddy took the cogs away
Fun with JED till daddy took the cogs away
2006-12-31, 12:31 PM #1
I am building a SP level for JK. Along the way I have gotten a basic grasp of Cogs but have hit a brick wall on two small things. One : I would like the character to start with no weapon. No matter what's in the start cog the player always has the Bryar pistol. Is there a way to eliminate this? Two : I have made a custom wav, but for some reason JK won't play it. What are the specs for wavs in JK and what folder should it go in? Thanks for any help.
2006-12-31, 1:11 PM #2
Well i have bo clue, but having some new levels would be welcome!
You should get a page on the hub.
Also we own you're soul and etc.

And judging by you're name stay away from the PETA crazies.
2006-12-31, 2:46 PM #3
I remember someone talking about taking items and weapons from characters. I don't remember the exact way, but the player still loads with the item, you have to then *take* it from the player.

-I think.
2006-12-31, 2:47 PM #4
Then set an npc to use force pull?
2006-12-31, 2:47 PM #5
Originally posted by Tiberium_Empire:
Then set an npc to use force pull?

...
2006-12-31, 3:40 PM #6
Set the bin values of all the weapons to zero in your startup script.

Originally posted by freshlamb:
...I have made a custom wav, but for some reason JK won't play it...

Use Goldwave or Audacity, save it as 16-bit PCM wav.
And when the moment is right, I'm gonna fly a kite.
2006-12-31, 3:42 PM #7
Moved to the correct location. Welcome to the forums, and you can thank GBK. He should have any COG answers you need.
-=I'm the wang of this here site, and it's HUGE! So just imagine how big I am.=-
1337Yectiwan
The OSC Empire
10 of 14 -- 27 Lives On
2007-01-01, 5:40 PM #8
I tried setting all the weapons in my startup cog to zero using SetInv () but I STILL had a Bryar. So I used SetInvAvailable(player, 2, 0) but now you can't use the bryar even when you pick it up. I suppose I could make a cog to make it available again, but I'm not certain it's worth doing, as who uses a bryar when you have a stormtrooper rifle? As for the wav's I had 11khz mono 16bit files instead of 8bit. All good, learning lots. Thanks for the help. I'm sure I'll be back with a million more questions.
2007-01-03, 3:58 PM #9
if you post the startup cog it might help a bit
Sam: "Sir we can't call it 'The Enterprise'"
Jack: "Why not!"
2007-01-04, 1:50 PM #10
Mostly JED's startup cog modified by me just enough to make me happy.

#Level master COG
#Generated by JED 0.951 beta

symbols
message startup
message timer
int player local
end

code

startup:
// Register COG as master COG
SetMasterCOG(GetSelfCOG());
player = GetLocalPlayerThing();
// Initialise Goals
SetInv(player, 99, 1000);
SetGoalFlags(player, 0, 1);
// Give player weapons and ammo
SetInv(player, 1, 1); // fists
SetInvAvailable(player, 2, 0); // no bryar
// Initialize weapon.
SetFireWait(player, -1);
SetMountWait(player, 0);
SetCurInvWeapon(player, 0);
SelectWeapon(player, AutoSelectWeapon(player, 1));

SetTimer(15);
timer:
// Force ranking
SetInv(player, 20, 3);
SetInv(player, 14, 4*50);
SetInv(player, 21, 2.0);
SetInvAvailable(player, 21, 1);


jkSyncForcePowers();
Return;

end
2007-01-04, 8:20 PM #11
To get rid of the bryar you have to edit the kyle.cog so that the bins for the bryar are set to 0.
2007-01-04, 9:54 PM #12
actually, I was thinking of having this cog basically unset the bryar. It's being set somewhere else, but without knowing all the cogs in the level, I can't say where.

[edit: the following sentence is not true due to memory lapse]And it's not kyle.cog, since kyle.cog only gives out the bryar for multiplayer, not singleplayer.[/edit]

Try replacing
Code:
SetInvAvailable(player, 2, 0); // no bryar
with
Code:
SetInv(player, 2, 0); // no bryar


If that doesn't work, then you have another cog in your level that's giving the player the bryar just after this one tries to remove it. In which case, a short sleep at the beginning might do the trick, but that's just a hack.
So, if the code switch doesn't work, go through all your other cogs and make sure that they don't give the player the bryar on startup.
Sam: "Sir we can't call it 'The Enterprise'"
Jack: "Why not!"
2007-01-04, 10:13 PM #13
Originally posted by SG-fan:
And it's not kyle.cog, since kyle.cog only gives out the bryar for multiplayer, not singleplayer.


Umm, yes it is the kyle cog...

Code:
# ........................................................................................

init_kyle:
   SetActorFlags(player, 8);
   SetTimerEx(1.50, 1, player, 0);

   // Set Health to full
   SetThingHealth(player, 100);

   // Set Mana to full
   SetInv(player, 14, GetInv(player, 20) * 50);

   // Set Shields to 100 minimum
   if(GetInv(player, 60) < 100) SetInv(player, 60, 100);

   // Set Battery to 100 minimum
   if(GetInv(player, 13) < 100) SetInv(player, 13, 100);

   // Set the power boost to 1.0
   SetInv(player, 63, 1.0);

   // When player starts, give him fists, and a bryar.
   SetInv(player, 1, 1.0);
   SetInv(player, 2, 1.0);

   // Give 50 energy minimum
   if(GetInv(player, 11) < 50) SetInv(player, 11, 50.0);

   // Bacta
   if(GetInv(player, 40) == 0)
      SetInvAvailable(player, 40, 0);
   else
      SetInvAvailable(player, 40, 1);

   // IR Goggles
   if(GetInv(player, 41))
      SetInvAvailable(player, 41, 1);
   else
      SetInvAvailable(player, 41, 0);
   SetInvActivated(player, 41, 0);

   // Field Light
   SetInv(player, 42, 1);
   SetInvAvailable(player, 42, 1);
   SetInvActivated(player, 42, 0);
   ClearActorFlags(player, 4);

   jkEndTarget();

   Return;

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

init_multi_kyle:

   // Set Weapons
   SetInv(player, 1, 1.0);
   SetInv(player, 2, 1.0);
   SetInv(player, 3, 0.0);
   SetInv(player, 4, 0.0);
   SetInv(player, 5, 0.0);
   SetInv(player, 6, 0.0);
   SetInv(player, 7, 0.0);
   SetInv(player, 8, 0.0);
   SetInv(player, 9, 0.0);
   SetInv(player, 10, 1.0);

   // Set Ammo
   SetInv(player, 11, 50.0);
   SetInv(player, 12, 0.0);
   SetInv(player, 15, 0.0);

   // Remove bacta tank and IR goggles
   SetInv(player, 40, 0);
   SetInv(player, 41, 0);
   SetInvAvailable(player, 40, 0);
   SetInvAvailable(player, 41, 0);

   // Set shields to 100
   SetInv(player, 60, 100);

   // Do respawn effects
   dummy = CreateThingAtPos(teleport_particles, GetThingSector(player), GetThingPos(player), '0 0 0');
   dummy = PlaySoundThing(teleportsnd, player, 1.0, -1, -1, 0x180);

   SetFireWait(player, -1);
   SetMountWait(player, 0);
   SetCurInvWeapon(player, 0);
   SelectWeapon(player, AutoSelectWeapon(player, 1));

   Return;


notice the different areas for single player and multiplayer?

Your way should work in a startup cog, but it will only work for whatever level the cog is set in. Editing the kyle cog will make it the same for each level.
2007-01-04, 11:58 PM #14
Hmmm ... I was also wondering why the force powers weren't showing up on the force powers screen, I think this may be the answer. I will definetely play with it. Thanks.
2007-01-05, 12:07 AM #15
doh! I knew it would happen. I just knew it. :( I took a break from cogging, and when I come back, my memory fails me. Stormtrooper's right. In that case, you either edit the kyle.cog, or set up a delay in your startup cog so that it'll basically undo what kyle.cog does.
Sam: "Sir we can't call it 'The Enterprise'"
Jack: "Why not!"
2007-01-05, 4:48 PM #16
The startup cog generator in Jed doesn't work entirely like it should, in my opinion. It doesn't even have the MotS stuff in there. That's why way back in the day I made my own MotS Startup Cog generator. It uses the SetInvAvailable to 0 -- I didn't know that it didn't let you use the weapon later on in the level. I'll have to fix that. Heck, now that I know C++ I ought to make it a real plugin for Jed.
2007-01-06, 12:23 PM #17
The startup file is the best place to remove the Bryer in my opinion. You can Edit the kyle cog, but I don't think that you can get others to use it (short of a patch that everyone would have to run.)

I could be wrong here as it has been a while since I edited levels and cogs
:) ;) :) ;) :) ;) :) ;) :) ;) :) ;) Im Happy
2007-01-06, 11:19 PM #18
Originally posted by Cogman:
The startup file is the best place to remove the Bryer in my opinion. You can Edit the kyle cog, but I don't think that you can get others to use it (short of a patch that everyone would have to run.)

I could be wrong here as it has been a while since I edited levels and cogs



Make a new walkplayer template with the new cog defined instear of the kyle.cog
2007-01-08, 12:37 PM #19
Stormtrooper speaks wisdom.

↑ Up to the top!