Oni Central Forum

A forum for the Oni community

You are not logged in.

#1 12/12/07 20:12

EdT
Moderator
From: Los Angeles, CA
Registered: 01/13/07
Website

Adding new characters to a level.

modify the lineup of spawnable characters in BINACJBOCharacter.

I was able to add Muro and Barabas to Level1, however, I lost 2 other characters.  When I first tried to add them at the end of the file, they would not appear, but is I added them to the middle, it would work, but the last 2 are missing.

In looking at the wiki at OBD:BINA/OBJC/CHAR I found this:
0x04      int32      2C 8B 00 00      35628     size of the complete collection from this postion in bytes.

Obviously, I need to change this value.  But how do I figure out the revised change in size?

Offline

#2 12/12/07 20:12

geyser
Member
From: beyond the veil
Registered: 01/14/07
Website

Re: Adding new characters to a level.

"how do I figure out the revised change in size?" add 0x220 for every added CHAR entry


Behold the power of that which is yet unborn! For the swirling images that flow forth from the Chrysalis are only a shadow of the sleeper's true power.

Offline

#3 12/12/07 22:12

EdT
Moderator
From: Los Angeles, CA
Registered: 01/13/07
Website

Re: Adding new characters to a level.

Strange, I must be doing something wrong.

Level 1 BINACJBOCharacter.oni

43 4A 42 4F 30 7C 00 00 27 00 00 00 20 02 00 00 (31792 size of the complete collection from this postion in bytes.)

I added 2 CHAR data to the end of the BINACJBOCharacter.oni file and therefore added 0x440

43 4A 42 4F 70 80 00 00 27 00 00 00 20 02 00 00 (32880 bytes)

Then used OniSplit to create new level1 files

70 80 00 00 appears in the level1_Final.sep file, but the 2 added CHAR data are not there.

Last edited by EdT (12/13/07 00:12)

Offline

#4 12/13/07 11:12

geyser
Member
From: beyond the veil
Registered: 01/14/07
Website

Re: Adding new characters to a level.

Oh, sorry, I forgot an important thing, namely the "size of next": http://wiki.oni2.net/OBD:BINA/OBJC
That means two things: first, for every CHAR entry, the overall size will increase by 0x224, not 0x220.
Second, you will have to update the "size of next" field at what used to be the the end of the collection.
The last 4 bytes (after the last CHAR entry) used to be 00 00 00 00, signaling the end of the collection.
You will have to change them to 20 02 00 00, to announce the size of the first element you're adding.
Then after your first new element you'll have to write 20 02 00 00 to announce the other new element.
Finally, after your "new last element", be sure to write 00 00 00 00 to signal the end of the collection.

And we also both forgot another very important thing, namely the size of the sep part in the dat smile
Be sure to increase it as well, by 0x224 for every new CHAR entry: http://wiki.oni2.net/OBD:BINA
(it's the field at 0x08)

Last edited by geyser (12/13/07 11:12)


Behold the power of that which is yet unborn! For the swirling images that flow forth from the Chrysalis are only a shadow of the sleeper's true power.

Offline

#5 12/13/07 20:12

EdT
Moderator
From: Los Angeles, CA
Registered: 01/13/07
Website

Re: Adding new characters to a level.

geyser:  I did exactly as you said, but still the 2 additional characters (Muro, Barabas) do not appear.  So then I tried inserting them before the last character. This time the first character (Muro) appeared.  If I insert them somewhere in the middle, then both will appear.

This is the interesting part, I looked at BINACJBOCharacter.oni in OUP and each time the last 2 characters was not there.  However, looking at the file with a hex editor, the last 2 characters are there.

Offline

#6 12/13/07 22:12

geyser
Member
From: beyond the veil
Registered: 01/14/07
Website

Re: Adding new characters to a level.

Did you, or did you not, increase the sep part size in the dat part?
If everything else fails, heck, just upload the .oni file somewhere.


Behold the power of that which is yet unborn! For the swirling images that flow forth from the Chrysalis are only a shadow of the sleeper's true power.

Offline

#7 12/13/07 22:12

EdT
Moderator
From: Los Angeles, CA
Registered: 01/13/07
Website

Re: Adding new characters to a level.

geyser: yes I increased the size in the dat.  But still, even though I added the 2 characters to BINACJBOCharacter.oni, when I create the level1 files with OniSplit, the sep does not include the last 2 characters.

Here's the file: http://edt.oni2.net/files/CJBOChar.zipNow

EDIT: Now, I'm not so sure if I did fix the size in the .dat.  I tried to manually add the characters directly into the sep and then modify the dat.  But I keep getting a "Stream Write Error" when I want to make the changes to the dat file.

So I tested it with a clean level1 files, no mods and still the "Stream Write Error" occurs.  I'm using OUP 35a.

Last edited by EdT (12/14/07 12:12)

Offline

#8 12/14/07 21:12

EdT
Moderator
From: Los Angeles, CA
Registered: 01/13/07
Website

Re: Adding new characters to a level.

Update: Using OUP 34b I can edit the dat file without the "Stream Write Error". I'm getting close, just the graphics are a bit off.

Offline

#9 12/14/07 22:12

geyser
Member
From: beyond the veil
Registered: 01/14/07
Website

Re: Adding new characters to a level.

We're sorry, but the current version of OUP gives "stream write errors" everywhere, so it's pretty much defunct.
As for 34b, it doesn't get all the texture formats right. You should try to -import into auxiliary mini-dats instead.
As you can see from  the scripts, OniSplit makes .dat files out of the contents of a specified folder (.oni files).
If you create a folder and make sure BINACJBOCharacter.oni is the only file in there, you can make a mini-dat.
You'll be able to edit that file with 34b rather painlessly, then reexport it as BINACJBOCharacter.oni... See? smile

If I were you, I'd wait till Alloc fixes the "stream write error" though. And I'd nag him relentlessy into doing so.


Behold the power of that which is yet unborn! For the swirling images that flow forth from the Chrysalis are only a shadow of the sleeper's true power.

Offline

#10 12/15/07 12:12

EdT
Moderator
From: Los Angeles, CA
Registered: 01/13/07
Website

Re: Adding new characters to a level.

Well, doing it the old fashioned way, works. :-)
That is using OUP 34b to export the BINACJBOCharacter file, then adding the 2 chars using a hex editor.  Then importing it back with OUP.  Making the changes in the sizes, saving the files. Play the game.

Somehow, using the OniSplit way caused the graphics glitch.  ie: Making the changes to BINACJBOCharacter.oni, then making new level1 files with OniSplit.  Then making the size changes to the dat and sep using a hexeditor.  I was hoping for the sake of Mac users to be able to make changes without OUP, since some are not able to use it.

attachment.php?item=145&download=1

Last edited by EdT (12/15/07 15:12)

Offline

#11 12/19/07 18:12

EdT
Moderator
From: Los Angeles, CA
Registered: 01/13/07
Website

Re: Adding new characters to a level.

Hmmm... I got an interesting problem.  I added OutroNinja to level1 works fine, except he doesn't stay dead!
Even though his health gets to zero, he keeps coming back, ready to fight.  I already changed the lose outcome from outro to all zeros in the CHAR data, but still it has no effect. Any ideas?

EDIT: Found a solution:

chr_wait_health OutroNinja 1
ai2_kill OutroNinja

Last edited by EdT (12/19/07 19:12)

Offline

#12 12/19/07 19:12

Your_Mom
Member
From: Canada
Registered: 01/31/07
Website

Re: Adding new characters to a level.

OutroNinja has the unkillable option turned ON. get rid of it tongue


droid803sig.jpg

Offline

#13 12/19/07 19:12

EdT
Moderator
From: Los Angeles, CA
Registered: 01/13/07
Website

Re: Adding new characters to a level.

Your_Mom: I checked the data but the character option is set to 04 (not prespawned) not 40 (unkillable)

Offline

#14 12/26/07 02:12

EdT
Moderator
From: Los Angeles, CA
Registered: 01/13/07
Website

Re: Adding new characters to a level.

I found the way to change the value of the sizes after adding characters to a level using OniSplit.
CHARlevel1.jpg

38 7C size of the part in the raw/sep file in bytes
30 7C size of the complete collection from this postion in bytes

By changing those values to reflect the adding of characters, all I needed to do was to create new dat,raw,sep files from the .oni files.

Offline

#15 01/08/08 21:01

EdT
Moderator
From: Los Angeles, CA
Registered: 01/13/07
Website

Re: Adding new characters to a level.

For your enjoyment.  I added the following characters to Level 1 for the Edition version:
evilkonoko, barabus, BoothMuro01, NinjaZip, TCTF_swat_blackops_(1 GrifOps03), red_hard_1 (GrifElite03), elite_hard_2 (C_Eb27), ninja_hard_3 (C_Tr28) and tanker_hard_1 (C2_t19).

Imagine the scripts you can write...

You will need to add this to the Level1 folder and recompile that level.

EDIT: I thought I included the attachment!  Oh well, here it is.

Last edited by EdT (01/12/08 14:01)

Offline

#16 01/12/08 13:01

Gumby
Member
From: Seattle, WA, USA
Registered: 08/30/07

Re: Adding new characters to a level.

I think you forgot the attachement...


Iritscen: roll
Iritscen: it's amazing this program even works
Gumby: i know
Iritscen: and that statement applies to my code, not just yours

Offline

#17 01/12/08 14:01

EdT
Moderator
From: Los Angeles, CA
Registered: 01/13/07
Website

Re: Adding new characters to a level.

Gumby: Attachment now included in previous message.

Offline

Board footer

Powered by FluxBB