PDA

View Full Version : Cog help



Spittor
06-22-2002, 11:15 AM
This is not a cog for a lvl, this is a player cog. I dont know anything about this launguage so mabey someone could write one up really quick.

I need a cog that will allow me to fly, and be able to be used with SBX.

I am not doing this is PO people, but to use in RPGs where I use a transport 3do as my character.

SaberMaster
06-22-2002, 01:00 PM
When asking for a cog, you have to provide details for the workings of the cog. On what event do you want to make the player able to fly? On what event do you want it to be disabled? And good grammar wouldn't hurt. http://forums.massassi.net/html/tongue.gif

------------------
Author of the JK DataMaster (http://www.geocities.com/sabersdomain/fileframe.html), Parsec (http://www.geocities.com/sabersdomain/fileframe.html), and the EditPlus Cog Files (http://www.geocities.com/sabersdomain/fileframe.html).
Visit Saber's Domain (http://www.geocities.com/sabersdomain).

Spittor
06-22-2002, 01:05 PM
Sorry. Something that would be ideal would be an item in my inventory that toggles flying/not flying, much like damage and trails on SBX3.1.

It should proboly replace a key or something, and I the item appears in my inventory on startup of a game.

SaberMaster
06-22-2002, 01:47 PM
So you want an item that lets the player fly when it's activated? Here's the code:



# flyitem.cog
#
# An item that enables the player to fly when activated.
#
# [SM]
#================================================= ====#
symbols

int on local
int bin=116 local
thing player local

message activated
message startup

end
#================================================= ====#
code
#--------------------------------------------------------
startup:
on = 0;

Return;
#--------------------------------------------------------
activated:
player = GetSourceRef();
if(on)
{
on=0;
ClearPhysicsFlags(player, 0x2000);
SetPhysicsFlags(player, 0x1);
SetInvActivated(player, bin, 0);
}
else
{
on=1;
SetPhysicsFlags(player, 0x2000);
ClearPhysicsFlags(player, 0x1);
SetInvActivated(player, bin, 1);
}

Return;
#--------------------------------------------------------
end


As for the items.dat, you should have a line like this:



bacta 116 1 1 0x122 cog=flyitem.cog


The name of the bin is "bacta" because the first five letters of the item's name must match an icon name. So by calling the bin "bacta", I'm giving the item the bactatank's icon. The bin's ID number doesn't have to be 116, but make sure that you replace the 116 in the flyitem cog with whatever bin number you use.

The min and max of the bin are set to one because the bin must have an amount in it when it is available (0x20 bin flag).

The bin's flags (0x122) mean that the bin uses a hotkey(0x100), is available on startup(0x20), and is an item(0x2).

And the cog assignment tells the exe in which cog to call the activated and deactivated messages.

If you need any features added or have a question, post again. Glad to help. http://forums.massassi.net/html/wink.gif

------------------
Author of the JK DataMaster (http://www.geocities.com/sabersdomain/fileframe.html), Parsec (http://www.geocities.com/sabersdomain/fileframe.html), and the EditPlus Cog Files (http://www.geocities.com/sabersdomain/fileframe.html).
Visit Saber's Domain (http://www.geocities.com/sabersdomain).

[This message has been edited by SaberMaster (edited June 22, 2002).]

Spittor
06-22-2002, 02:19 PM
I dont know if that can be used with SBX3.1, is there a way to make it so that items.dat doesnt need to be touched?

SaberMaster
06-22-2002, 05:58 PM
No, you have to use a bin in the items.dat. If SBX doesn't use all three of JK's free hotkeys, then you can add your item bin, and there won't be a problem - just change the bin number. But if SBX does use those hotkeys, you might use the hotkey of one of the original items like the fieldlight.

[edit] You will also need to add an entry for your hotkey in the jkstrings.uni. Search for "Activate16" in this file and you'll see a list of hotkey descriptions. The entries in this list must be in the same order as the hotkey-flagged bins in the items.dat.

------------------
Author of the JK DataMaster (http://www.geocities.com/sabersdomain/fileframe.html), Parsec (http://www.geocities.com/sabersdomain/fileframe.html), and the EditPlus Cog Files (http://www.geocities.com/sabersdomain/fileframe.html).
Visit Saber's Domain (http://www.geocities.com/sabersdomain).

[This message has been edited by SaberMaster (edited June 22, 2002).]

Spittor
06-22-2002, 07:29 PM
What would you suggest I do? It doesnt neeed to be an item, and SBX uses all hotkeys. I just want a fly toggle that works with SBX.

Clown made a SBX hack pack with some stuff like god and speed in items inventory, and that only uses cogs and bms.

SaberMaster
06-23-2002, 08:10 AM
If you only want the toggle, and you don't need the hotkey, remove the 0x100 bin flag (to make it 0x22) and the item will appear in your inventory, but not use a hotkey.

------------------
Author of the JK DataMaster (http://www.geocities.com/sabersdomain/fileframe.html), Parsec (http://www.geocities.com/sabersdomain/fileframe.html), and the EditPlus Cog Files (http://www.geocities.com/sabersdomain/fileframe.html).
Visit Saber's Domain (http://www.geocities.com/sabersdomain).

Spittor
06-23-2002, 01:27 PM
I don't know how flags and stuff work, can someone give do this? I never took the time to learn how JK works, I just picked up what file extention purposes are...

To be more clear on my origional intentions, a perfect product would be a fly toggle that I can access only by browsing my inventory (no hotkey), much like SBX3.1's saber damage toggle, motion trail toggle, and blade color cycling. I assume that this can be done by replacing an item, but I would like it to replace a key or something not commonly used in MP. I believe SBX uses some of the item_key cogs to use damage, motion trail, and color, so it cannot use one of those cogs. It must be compatable.

All help is greatly appreciated...

[This message has been edited by Spittor (edited June 24, 2002).]

SaberMaster
06-24-2002, 05:31 PM
Alright, use the cog I gave you above and put this line in the items.dat:



bacta 120 1 1 0x22 cog=flyitem.cog


If bin 120 is used, change it to a bin number that isn't used. And change the 116 in the cog to whatever number you use.

That should work. http://forums.massassi.net/html/wink.gif

------------------
Author of the JK DataMaster (http://www.geocities.com/sabersdomain/fileframe.html), Parsec (http://www.geocities.com/sabersdomain/fileframe.html), and the EditPlus Cog Files (http://www.geocities.com/sabersdomain/fileframe.html).
Visit Saber's Domain (http://www.geocities.com/sabersdomain).

Spittor
06-24-2002, 06:16 PM
I dont think I can edit items.dat, theres one in the SBX gob...

SaberMaster
06-25-2002, 09:33 AM
You should edit the items.dat from the SBX gob. How are you running your patch? With Patch Commander, or are you using directories and the -path command?

------------------
Author of the JK DataMaster (http://www.geocities.com/sabersdomain/fileframe.html), Parsec (http://www.geocities.com/sabersdomain/fileframe.html), and the EditPlus Cog Files (http://www.geocities.com/sabersdomain/fileframe.html).
Visit Saber's Domain (http://www.geocities.com/sabersdomain).

Spittor
06-25-2002, 09:38 AM
Patch Commander, as I rarely play away from the zone.

How did Clown make his SBX god/speed hack without editing items.dat?

SaberMaster
06-25-2002, 02:24 PM
Well, if Clown didn't edit the items.dat, then he must have replaced some of the original items.

Patch Commander is fine for playing patches, but for making/editing them, you should put the files in their proper directories and use the -path command.

Assuming you haven't done that: Create a folder in your JK dir called mod (or whatever name you want). In side this folder, create the cog, misc, ui, etc folders just as they appear in a .gob file. Create a shortcut to jk.exe and view it's properties. Add -path mod after the closing quotation marks of the shortcut's target.

Once you have that set up, extract the files from the SBX gob and put them in their appropriate directories. Then add the cog I gave you and add the new bin to the items.dat. When you're finished, create a new .gob with ConMan and drag the mod folder into ConMan's window.

------------------
Author of the JK DataMaster (http://www.geocities.com/sabersdomain/fileframe.html), Parsec (http://www.geocities.com/sabersdomain/fileframe.html), and the EditPlus Cog Files (http://www.geocities.com/sabersdomain/fileframe.html).
Visit Saber's Domain (http://www.geocities.com/sabersdomain).

Spittor
06-25-2002, 06:20 PM
Well, replacing the origional items was my intent, as long as its a key or something.

Spittor
06-26-2002, 06:42 PM
So what do I do to the above cog script to make it replace something?

SaberMaster
06-27-2002, 11:33 AM
Decide which item you want to replace and rename flyitem.cog to whatever the name of the item's cog is.

If you replace an item with a hotkey, you'll have to modify the jkstrings.uni to change the text that appears in JK's hotkey settings.

If you replace an item that is not normally available, you'll have to add SetInvAvailable(player, bin, 1); to the startup message of the cog.

I would reccomend that you just add a new item instead of replacing one. If you're having a problem getting the new bin to work, just explain the problem. http://forums.massassi.net/html/wink.gif

------------------
Author of the JK DataMaster (http://www.geocities.com/sabersdomain/fileframe.html), Parsec (http://www.geocities.com/sabersdomain/fileframe.html), and the EditPlus Cog Files (http://www.geocities.com/sabersdomain/fileframe.html).
Visit Saber's Domain (http://www.geocities.com/sabersdomain).

Spittor
06-27-2002, 05:54 PM
So, like this?


# item_bluekey.cog
#
# An item that enables the player to fly when activated.
#
# [SM]
#================================================= ====#
symbols
int on local
int bin=116 local
thing player local
message activated
message startup
end
#================================================= ====#
code
#--------------------------------------------------------
startup:
on = 0;
SetInvAvailable(player, bin, 1);
Return;
#--------------------------------------------------------
activated:
player = GetSourceRef();
if(on)
{
on=0;
ClearPhysicsFlags(player, 0x2000);
SetPhysicsFlags(player, 0x1);
SetInvActivated(player, bin, 0);
}
else
{
on=1;
SetPhysicsFlags(player, 0x2000);
ClearPhysicsFlags(player, 0x1);
SetInvActivated(player, bin, 1);
}
Return;
#--------------------------------------------------------
end



I can't seem to copy your tabs...

[This message has been edited by Spittor (edited June 27, 2002).]

SaberMaster
06-28-2002, 12:03 PM
Not quite. Change the 116 to 47, add SetInv(player, bin, 1); just below SetInvAvailable(), and make sure the name is item_keyblue.cog instead of item_bluekey.cog.

That should work.

------------------
Author of the JK DataMaster (http://www.geocities.com/sabersdomain/fileframe.html), Parsec (http://www.geocities.com/sabersdomain/fileframe.html), and the EditPlus Cog Files (http://www.geocities.com/sabersdomain/fileframe.html).
Visit Saber's Domain (http://www.geocities.com/sabersdomain).

[This message has been edited by SaberMaster (edited June 28, 2002).]

Spittor
06-28-2002, 03:07 PM
well, i tried this:


# item_keygreen.cog
#
# An item that enables the player to fly when activated.
#
# [SM]
#================================================= ====#
symbols
int on local
int bin=47 local
thing player local
message activated
message startup
end
#================================================= ====#
code
#--------------------------------------------------------
startup:
on = 0;
SetInvAvailable(player, bin, 1);
SetInv(player, bin, 1);
Return;
#--------------------------------------------------------
activated:
player = GetSourceRef();
if(on)
{
on=0;
ClearPhysicsFlags(player, 0x2000);
SetPhysicsFlags(player, 0x1);
SetInvActivated(player, bin, 0);
}
else
{
on=1;
SetPhysicsFlags(player, 0x2000);
ClearPhysicsFlags(player, 0x1);
SetInvActivated(player, bin, 1);
}
Return;
#--------------------------------------------------------
end


but got a checksum error...

tried it hosting and couldnt move...

[This message has been edited by Spittor (edited June 28, 2002).]

SaberMaster
06-28-2002, 03:16 PM
You changed the name. http://forums.massassi.net/html/rolleyes.gif Bin 47 matches the blue key, not the green key. The green key's bin is 51. Change the bin number or the name to get it to work.

[edit] Everyone in the game has to be using the same mod or their will be a checksum error.

------------------
Author of the JK DataMaster (http://www.geocities.com/sabersdomain/fileframe.html), Parsec (http://www.geocities.com/sabersdomain/fileframe.html), and the EditPlus Cog Files (http://www.geocities.com/sabersdomain/fileframe.html).
Visit Saber's Domain (http://www.geocities.com/sabersdomain).

[This message has been edited by SaberMaster (edited June 28, 2002).]

Spittor
06-28-2002, 05:34 PM
Oh, ok.

Well, I thought that didnt apply to cogs.

How do hax pass the checksum then?

Chao Killer
06-28-2002, 11:13 PM
Ok... what you're asking for here is what's called a "hack." It's where you edit cogs in-game to give yourself an unfair advantage.

It's darned near impossible to hook up a game over IRC, and if you pull out a hack, the guy will kick you without question.

[This message has been edited by SaberMaster (edited June 29, 2002).]

SaberMaster
06-29-2002, 06:54 AM
Chao, that wasn't really needed. I removed the offensive part of your message.


<font face="Verdana, Arial" size="2">How do hax pass the checksum then?</font>

They don't. No one on the Massassi Cog Forum will help you with hacks. It seems you lied about your original intent; The information you need is on this page, use it if you will.

------------------
Author of the JK DataMaster (http://www.geocities.com/sabersdomain/fileframe.html), Parsec (http://www.geocities.com/sabersdomain/fileframe.html), and the EditPlus Cog Files (http://www.geocities.com/sabersdomain/fileframe.html).
Visit Saber's Domain (http://www.geocities.com/sabersdomain).