PDA

View Full Version : Fun with JED till daddy took the cogs away



freshlamb
12-31-2006, 03:31 PM
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.

Tibby
12-31-2006, 04:11 PM
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.

Jarl
12-31-2006, 05:46 PM
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.

Tibby
12-31-2006, 05:47 PM
Then set an npc to use force pull?

Vin
12-31-2006, 05:47 PM
Then set an npc to use force pull?
...

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


...I have made a custom wav, but for some reason JK won't play it...
Use Goldwave (http://www.goldwave.com/) or Audacity (http://audacity.sourceforge.net/), save it as 16-bit PCM wav.

Yecti
12-31-2006, 06:42 PM
Moved to the correct location. Welcome to the forums, and you can thank GBK. He should have any COG answers you need.

freshlamb
01-01-2007, 08:40 PM
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.

SG-fan
01-03-2007, 06:58 PM
if you post the startup cog it might help a bit

freshlamb
01-04-2007, 04:50 PM
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

Stormtrooper
01-04-2007, 11:20 PM
To get rid of the bryar you have to edit the kyle.cog so that the bins for the bryar are set to 0.

SG-fan
01-05-2007, 12:54 AM
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.

And it's not kyle.cog, since kyle.cog only gives out the bryar for multiplayer, not singleplayer.

Try replacing
SetInvAvailable(player, 2, 0); // no bryar with
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.

Stormtrooper
01-05-2007, 01:13 AM
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...


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

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.

freshlamb
01-05-2007, 02:58 AM
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.

SG-fan
01-05-2007, 03:07 AM
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.

Kievan Mereel
01-05-2007, 07:48 PM
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 (http://www.geocities.com/shadow_jedi_academy/projects/startcog/start_cog.htm). 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.

Cogman
01-06-2007, 03:23 PM
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

Stormtrooper
01-07-2007, 02:19 AM
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

Kievan Mereel
01-08-2007, 03:37 PM
Stormtrooper speaks wisdom.