Hey, we have forums!

Author Topic: White Square Head-syndrome  (Read 17170 times)

0 Members and 1 Guest are viewing this topic.

Offline Alphasoldier

  • Dream Bit
  • **********
  • Posts: 1810
  • Zero Suit!
    • View Profile
White Square Head-syndrome
« on: February 06, 2009, 06:02:55 pm »
So yeah, I've been working on a mod quite some time now, but I'm having problems with actually adding an entire new costume.

Everything shows up perfectly fine, except my head, it becomes a white square, meaning it can't find the texture. Which I completely don't understand, seeing the thing I'm having problems with is the Naija in my avatar, which clearly, does not have this syndrome.

So yeah, I've made that costume mod about a year ago so I don't really understand why it worked back then and not now.
I looked at the other 'skins' that are in the original files and my skin does not seem to be any different.

Code: [Select]
xml skin code:

<Bones>
    <Bone idx="4" gfx="zerosuit/zerosuit-BackArm1"  />
    <Bone idx="5" gfx="zerosuit/zerosuit-BackArm2"  />
    <Bone idx="10" gfx="zerosuit/zerosuit-BackArm3"/>
    <Bone idx="6" gfx="zerosuit/zerosuit-BackLeg1" />
    <Bone idx="7" gfx="zerosuit/zerosuit-BackLeg2"  />
    <Bone idx="12" gfx="zerosuit/zerosuit-BackLeg3"  />
    <Bone idx="0" gfx="zerosuit/zerosuit-Body"  />
    <Bone idx="8" gfx="zerosuit/zerosuit-FrontLeg1"  />
    <Bone idx="9" gfx="zerosuit/zerosuit-FrontLeg2"  />
    <Bone idx="13" gfx="zerosuit/zerosuit-FrontLeg3"  />
    <Bone idx="1" gfx="zerosuit/zerosuit-Head"  />
    <Bone idx="2" gfx="zerosuit/zerosuit-FrontArm1"  />
    <Bone idx="3" gfx="zerosuit/zerosuit-FrontArm2"  />
    <Bone idx="11" gfx="zerosuit/zerosuit-FrontArm3"  />
</Bones>

The only thing I could guess is that the emotion heads of Naija are somehow hard-coded for each costume and as so somehow thinks that the 'zerosuit-head' is supposed to have it's own hard-coded things too. Or I'm just missing out a great thing. I would be very happy if it would be possible to keep the original head with the emotions.

I already tried leaving out the line defining the head, but that didn't work either.

Thanks for your time. ^^
God sees and knows everything, but at least he won't gossip about it.

Offline Alec

  • Administrator
  • Dream Bit
  • **********
  • Posts: 2211
    • View Profile
Re: White Square Head-syndrome
« Reply #1 on: February 06, 2009, 11:54:37 pm »
Turn on recache in the mod settings.

Offline Alphasoldier

  • Dream Bit
  • **********
  • Posts: 1810
  • Zero Suit!
    • View Profile
Re: White Square Head-syndrome
« Reply #2 on: February 07, 2009, 12:41:25 am »
Where am I supposed to do that? And if it means that all my altered files change with the mod every time I reboot the mod or even the map, that already works. An other ideas?

Btw, the heads plus the emotion heads are also in that folder, does that matter anything?
God sees and knows everything, but at least he won't gossip about it.

Offline Titch

  • Bit Bit
  • ****
  • Posts: 55
  • Aquatic Rocket Scientist
    • View Profile
Re: White Square Head-syndrome
« Reply #3 on: February 07, 2009, 02:35:06 am »
The heads in my mod work fine. It's a little late right now, but I'll check how I got it working tomorrow when I'm up; or you could probably see in the Ninja form mod structure and check the file names, which I'm pretty sure is the key to it.

Offline Particlese

  • Bit Bit
  • ****
  • Posts: 85
    • View Profile
Re: White Square Head-syndrome
« Reply #4 on: February 07, 2009, 02:36:22 am »
Make sure the "Properties" line seen below is in yourmod.xml.  If it's already there, update it accordingly.  You could also try calling reloadTextures() in mod-init.lua just to see if it works.  I'm not sure what the difference is...both methods were mentioned in one go in another thread.

<AquariaMod>
   <Fullname text="..."/>
   <Description text="..."/>
   <Properties recache="1"/>
</AquariaMod>


Edit:  Or wait for Titch's next reply.:)

Offline Alphasoldier

  • Dream Bit
  • **********
  • Posts: 1810
  • Zero Suit!
    • View Profile
Re: White Square Head-syndrome
« Reply #5 on: February 07, 2009, 12:13:11 pm »
I've copy pasted the structure of an original skin.

I've named everything so that everything starts with 'zerosuit', skin, gfz files, nodes, there are no spelling mistakes anywhere, I quintuple-checked.

I honestly have no idea any more. I guess I'll wait for you Titch.

I added the re-cache thing you said, Particlese, still no effect.
God sees and knows everything, but at least he won't gossip about it.

Offline Particlese

  • Bit Bit
  • ****
  • Posts: 85
    • View Profile
Re: White Square Head-syndrome
« Reply #6 on: February 07, 2009, 05:41:20 pm »
Here's Titch's mod, if you haven't already compared it with yours.  Maybe you have the names right but there's something missing in the animation file or scripts...

I could also have the recache thing wrong, but that's what's in the Jukebox Mod, and it made my own mod take a lot longer to load, so I think it is what Alec was talking about.

Offline Titch

  • Bit Bit
  • ****
  • Posts: 55
  • Aquatic Rocket Scientist
    • View Profile
Re: White Square Head-syndrome
« Reply #7 on: February 07, 2009, 08:09:30 pm »
Ok, so getting heads to work 101. You can download the modfile here. I'm using a copy of AlphaSoldiers Zerosuit skin for this, since I was trying to help with his problem with custom head skins initially. You should substitute all instances of zerosuit for whatever name you used for your skins xml file in the animation directory.

1. Put all the png's for the skin in a \naija sub directory inside graphics. In the example of zerosuit

_mods\head_texture\graphics\naija\zerosuit-body.png
_mods\head_texture\graphics\naija\zerosuit-frontleg1.png
_mods\head_texture\graphics\naija\zerosuit-frontarm1.png

The game will automatically be looking for the head graphics in this folder. To my knowledge the head graphics are hard coded this way, no matter what you put in the skin xml file it will always look in the mod graphics folder and then in the root Aquaria graphics folder for a head file with a name that matches the skin, this means if you use naija.xml for your skin file you should end up with the standard form Naija heads in the aquaria root/gfx folder.

NOTE: If you just moved all your png's into the naija subdirectory, don't forget to update the xml file for the skin to point to "naija/graphic.png" so it doesn't screw up the rest of your skin.

2. All the heads must have a file title that matches the name of the xml that defines the skin. That means if you skin is called zerosuit.xml then your head must be :- graphics\naija\zerosuit-head.png.

_mods\head_texture\animations\skins\zerosuit.xml
_mods\head_texture\graphics\naija\zerosuit-head.png
_mods\head_texture\graphics\naija\zerosuit-head-pain.png
_mods\head_texture\graphics\naija\zerosuit-head-sing.png
...ect

3. If you aren't using naija.xml for your skin file, you will want to add at setcostume("mycosutmename") call in the code. To get it to switch. Putting this in mod-init.lua causes an instant crash. I just added a node into the level that switches the costume over on first update, like this:
Code: [Select]
runonce=false

function update (me,dt)
    if runonce == false then
        setCostume("zerosuit")
        runonce = true
    end
end
There is probably a more elegant way of doing it, but I was trying to put this tutorial together in a snap.
« Last Edit: February 07, 2009, 11:05:13 pm by Titch »

Offline Alphasoldier

  • Dream Bit
  • **********
  • Posts: 1810
  • Zero Suit!
    • View Profile
Re: White Square Head-syndrome
« Reply #8 on: February 07, 2009, 08:21:40 pm »
Uhm, no offence Titch and I appreciate the help, but I see no use of your post, that's everything I have already, done almost exactly like that, and the thing is, the skin just doesn't work with my mod while it does work on my old simple zerosuit mod. Everything works fine, but the head.

I tried placing the files in /naija/zerosuit and alter the xml to read them from there of course, but that didn't work either.

I also looked at Titch's mod, but that's, in structure, almost the same as mine.

Also, what does NB stand for?

God sees and knows everything, but at least he won't gossip about it.

Offline Titch

  • Bit Bit
  • ****
  • Posts: 55
  • Aquatic Rocket Scientist
    • View Profile
Re: White Square Head-syndrome
« Reply #9 on: February 07, 2009, 09:34:34 pm »
NB means nota bene, which is latin for 'note well'. The reason it worked on the old mod is that the skin file was called naija.xml, so the game was finding the default naija headset in the aquaria/gfx/naija folder. You could probably just called your skin file naija.xml but I worry about stuff like that causing conflicts, which is why the method I gave is more convoluted than strictly needed.

I've re-written the instructions to try and add some more clarity to them, I've also added a stripped down mod file so you can see the structure in it's simplist possible form. I'm not very good at tutorials, it took nearly two hours for me to pull this simple thing together because combined re-writes and having to start Aquaria so many times to check everything is in order. I'm sorry I can't be more helpful Alpha, explaining things through writing has never come very naturally to me. To my knowledge I am the only one who has fixed the head texture issue so I'm doing my best to help.
« Last Edit: February 07, 2009, 10:59:44 pm by Titch »

Offline Alphasoldier

  • Dream Bit
  • **********
  • Posts: 1810
  • Zero Suit!
    • View Profile
Re: White Square Head-syndrome
« Reply #10 on: February 12, 2009, 02:39:51 pm »
Hmm, never knew you edited this, but I just wanted to let you know that the head works now.

I found out that heads, no matter what, needs to be in /gfx/naija no matter what skin you're using. Eventually I ended up throwing everything into the naija folder, instead of having a subfolder called zerosuit, which I believe you told me to try earlier on.

Either way, if I would've seen you edited your post I wouldn't have spend 2 days on it. XD

The script I used was a simple click to change suit, which perfectly worked. I had no problems with that. Eventually, the only thing that went wrong, like I said multiple times was the head. I have to note that I'm not that big of a rookie in scripting. =p

Either way, thanks. ^^

Oh, and by chance, nota bene, is perfect Dutch too.

EDIT:
Next hole I fall into is that I want to have a working dual form. What I have in my script so far is that Naija is given the song, and Li is spawned with his flag being 100, which is his normal flag once you've found him and he follows you.
Sadly enough, when I try to change to dual form, the game just crashes, the log says nothing but that my last form was 0 and my next form is the Dual form, nothing after that.
Another nice riddle I can't figure out.

However, when I reload the map, still have Li with me, it works perfectly fine and I can change.
I think when the map reloads Li reloads too and somehow does something that makes Dual form work, but I don't know what, I've looked at several scripts li.lua, licage.lua and even the map everything happened in when you get the form, but I didn't find much, though li.lua is way too big, I must've missed something there.
« Last Edit: February 12, 2009, 02:49:00 pm by Alphasoldier »
God sees and knows everything, but at least he won't gossip about it.

Offline Titch

  • Bit Bit
  • ****
  • Posts: 55
  • Aquatic Rocket Scientist
    • View Profile
Re: White Square Head-syndrome
« Reply #11 on: February 12, 2009, 03:25:36 pm »
I'm glad it worked for you. I'm not terribly good at writing tutorials (dyslexia brain is a killer for that kind of stuff), which is too bad because I've worked a few things out on my modding journey and it would be nice get them down in a concise way.

I haven't dared touch Li's scripts yet. I have a feeling you are right about map reloading changing something with Li, either that or it's so internal state flag with Naija, which might be a problem. It's a bit of a shot in the dark, but have you tried giving Naija Li's song and singing it instead of reloading the map and seeing if that has any effect?

Offline Alphasoldier

  • Dream Bit
  • **********
  • Posts: 1810
  • Zero Suit!
    • View Profile
Re: White Square Head-syndrome
« Reply #12 on: February 12, 2009, 11:45:34 pm »
Okay, so, I've tried the song, it doesn't do anything, it doesn't bring Li into combat mode or off it, it's like Li isn't Li.

Naija however has the rock of Li when you're in your escape menu and can normally sing the song... It's as if Li doesn't know Naija knows... so the problem should obviously be with Li... I hope.

I know it can't be the flag, cause Li follows me, if I don't set the flag he becomes the unknown diver again.
I've seen that there is a 'li = getLi()' somewhere, but that also had no effect. I'm going to skim through Li's script again.
Thanks again for the hints and pointers, I really appreciate it. ^^
God sees and knows everything, but at least he won't gossip about it.

Offline Alphasoldier

  • Dream Bit
  • **********
  • Posts: 1810
  • Zero Suit!
    • View Profile
Re: White Square Head-syndrome
« Reply #13 on: February 13, 2009, 07:05:02 pm »
Well, this is also solved. Eventually I only added "setLi(getEntity("li"))"

Here's the script with some unimportant bits left out.
Code: [Select]
dofile("scripts/entities/EntityInclude.lua")

n= 0
liset = false

function init(me)
if getFlag(FLAG_LI) ~= 100 then
node_setCursorActivation(me, true)
end
end

function activate(me)
setControlHint("You've obtained everything!", 0, 0, 0, 16)
learnSong(SONG_DUALFORM)
learnSong(SONG_LI)
setFlag(FLAG_LI,100)
createEntity("li", "", node_x(me), node_y(me))
node_setCursorActivation(me, false)
liset = true
end

function update(me, dt)
  if liset == true then
liset = false
setLi(getEntity("li"))
  end
end

I don't know if the update function was entirely necessary, but it's working like this so I ain't gonna change shit. Also by checking if Li's flag is 100 I made it so that the thing can't be activated again, or you'd get two Li's... Which, I eventually ended up with about 6 Li's. xD

I think about now my mod is done... I only wish I could add some sort of script that would spawn a random ingredient every time you clicked on it, but I guess that would take too long or is not possible. I don't even know the original name of every ingredient. Someone have a list somewhere?
God sees and knows everything, but at least he won't gossip about it.