Correct XSL?

36 replies [Last post]
Joined: 10/16/2009

I have a question about XSL's. I've looked at the general pages about it, and I think I have a general idea of how it's done.

But...I can't test the one I made for Goo2. I still have to round up some images, and such. The example ones didn't include buttons, so I can't tell.

Would this be correct? I'm adding the transition button to the main menu (MapWorldView.scene.xsl):

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 
  <!-- Copy everything not matched by another rule -->
  <xsl:template match="* | comment()">
    <xsl:copy>
      <xsl:copy-of select="@*"/>
      <xsl:apply-templates/>
    </xsl:copy>
  </xsl:template>
 
  <!-- Insert The WoG-2 Button -->
  <xsl:template match="/level/Buttongroup">
    <buttongroup id="mainbuttongroup" osx="130,1.2" >
      <button id="island1" depth="8" x="-89" y="341.5" scalex="0.534" scaley="0.534" rotation="-52.09" alpha="1" colorize="255,255,255"   up="IMAGE_SCENE_MAPWORLDVIEW_II_C1_UP" over="IMAGE_SCENE_MAPWORLDVIEW_II_C1_OVER" onclick="island1" onmouseenter="island1showtext" onmouseexit="islandhidetext" />
      <button id="island2" depth="8" x="-62.8" y="256.97" scalex="0.52" scaley="0.52" rotation="-110.63" alpha="1" colorize="255,255,255"   up="IMAGE_SCENE_MAPWORLDVIEW_II_C2_UP" over="IMAGE_SCENE_MAPWORLDVIEW_II_C2_OVER" disabled="IMAGE_SCENE_MAPWORLDVIEW_II_C2_DISABLED" onclick="island2" onmouseenter="island2showtext" onmouseexit="islandhidetext" />
      <button id="island4" depth="8" x="-226.78" y="252.57" scalex="0.656" scaley="0.656" rotation="124.41" alpha="1" colorize="255,255,255"   up="IMAGE_SCENE_MAPWORLDVIEW_II_C4_UP" over="IMAGE_SCENE_MAPWORLDVIEW_II_C4_OVER" disabled="IMAGE_SCENE_MAPWORLDVIEW_II_C4_DISABLED" onclick="island4" onmouseenter="island4showtext" onmouseexit="islandhidetext" />
      <button id="island3" depth="8" x="-144.1" y="210.08" scalex="0.727" scaley="0.632" rotation="-172.95" alpha="1" colorize="255,255,255"   up="IMAGE_SCENE_MAPWORLDVIEW_II_C3_UP" over="IMAGE_SCENE_MAPWORLDVIEW_II_C3_OVER" disabled="IMAGE_SCENE_MAPWORLDVIEW_II_C3_DISABLED" onclick="island3" onmouseenter="island3showtext" onmouseexit="islandhidetext" />
      <button id="island5" depth="8" x="-246.66" y="336.77" scalex="0.785" scaley="0.718" rotation="63.69" alpha="1" colorize="255,255,255"   up="IMAGE_SCENE_MAPWORLDVIEW_II_C5_UP" over="IMAGE_SCENE_MAPWORLDVIEW_II_C5_OVER" disabled="IMAGE_SCENE_MAPWORLDVIEW_II_C5_DISABLED" onclick="island5" onmouseenter="island5showtext" onmouseexit="islandhidetext" />
      <button id="wogcorp_intact" depth="8" x="-174.56" y="408.72" scalex="0.502" scaley="0.502" rotation="7.96" alpha="1" colorize="255,255,255"   up="IMAGE_SCENE_MAPWORLDVIEW_II_WOGC_UP" over="IMAGE_SCENE_MAPWORLDVIEW_II_WOGC_OVER" disabled="IMAGE_SCENE_MAPWORLDVIEW_II_WOGC_DISABLED" onclick="wogcorp" onmouseenter="wogcorpshowtext" onmouseexit="islandhidetext" />
      <button id="wogcorp_3d" depth="8" x="-174.41" y="404.61" scalex="0.666" scaley="0.61" rotation="7.96" alpha="1" colorize="255,255,255"   up="IMAGE_SCENE_MAPWORLDVIEW_II_WOGC3D_UP" over="IMAGE_SCENE_MAPWORLDVIEW_II_WOGC3D_OVER" onclick="wogcorp" onmouseenter="wogcorpshowtext" onmouseexit="islandhidetext" />
      <button id="wogcorp_destroyed" depth="8" x="-175.19" y="395.85" scalex="0.588" scaley="0.771" rotation="6.7" alpha="1" colorize="255,255,255"   up="IMAGE_SCENE_MAPWORLDVIEW_II_WOGCD_UP" over="IMAGE_SCENE_MAPWORLDVIEW_II_WOGCD_OVER" onclick="wogcorp" onmouseenter="wogcorpdshowtext" onmouseexit="islandhidetext" />
      <!-- WoG-2 Button -->
      <button id="wog2covert" depth="8" x="-127.66" y="63.83" scalex="1" scaley="1" rotation="0" alpha="1" colorize="255,255,255" up="IMAGE_SCENE_MAPWORLDVIEW_II_GOO2_UP" over="IMAGE_SCENE_MAPWORLDVIEW_II_GOO2_OVER" onclick="ObservatoryObservationStation" onmouseenter="" onmouseexit="" />
      <!-- This is it. For now, until we have a working title screen, it will lead to the final level of the game. -->
    </buttongroup>
    <buttongroup id="boringmenugroup" osx="54,1.12" >
      <button id="changename" depth="8" x="108.45" y="90.87" scalex="0.44" scaley="0.44" rotation="-1.09" alpha="1" colorize="255,255,255"   up="IMAGE_SCENE_MAPWORLDVIEW_MM_PROFILES_UP" over="IMAGE_SCENE_MAPWORLDVIEW_MM_PROFILES_OVER" onclick="showselectprofile" onmouseenter="showtooltip" onmouseexit="hidetooltip" tooltip="TOOLTIP_PROFILES" overlay="true" />
      <button id="credits" depth="8" x="181.33" y="93.88" scalex="0.44" scaley="0.44" rotation="2.89" alpha="1" colorize="255,255,255"   up="IMAGE_SCENE_MAPWORLDVIEW_MM_CREDITS_UP" over="IMAGE_SCENE_MAPWORLDVIEW_MM_CREDITS_OVER" onclick="credits" onmouseenter="showtooltip" onmouseexit="hidetooltip" tooltip="TOOLTIP_CREDITS" overlay="true" />
      <button id="quit" depth="8" x="250.35" y="97.77" scalex="0.44" scaley="0.44" rotation="0.43" alpha="1" colorize="255,255,255"   up="IMAGE_SCENE_MAPWORLDVIEW_MM_EXIT_UP" over="IMAGE_SCENE_MAPWORLDVIEW_MM_EXIT_OVER" onclick="quit" onmouseenter="showtooltip" onmouseexit="hidetooltip" tooltip="TOOLTIP_QUIT" overlay="true" />
    </buttongroup>
  </xsl:template>
 
<!-- XSL By Enchanter49 -->
 
</xsl:transform>

Joined: 10/16/2009

The strange thing is that most people don't seem to answer anyone's topics UNTIL AT LEAST ONE PERSON has made a comment...

This is THAT comment...

Joined: 12/31/2009

Well, the comment is usually made ny another person.
THIS would be THAT comment, if THAT was the CASE. Wink
Any ways, I dunno, that's a long read you have there...

Joined: 10/16/2009

It's required, as far as I'm concerned. I have to include everything that was already in the level (in the same category, ex. Buttongroup) so that they don't just vanish.

Also, James, did you receive my newsletter yet? I just sent WoG 2 Newsletter 3 to everybody. It explains a lot.

Joined: 03/31/2009

Enchanter49 wrote:
The strange thing is that most people don't seem to answer anyone's topics UNTIL AT LEAST ONE PERSON has made a comment...

This is THAT comment...

The strange thing is that goofans is getting little traffic and basically it's just you, James and occasionally Goosweek with random smileys. Smile

As for your question, well, nobody can tell you if it's ok. because they don't have all files and information. In general, yes, it's ok

My Gooish profile | Videos on YouTube | My WOG Mods

Joined: 10/16/2009

Thank you Pavke. I'll test it now.

Joined: 10/16/2009

Well, it failed. I think I made the xsl for resources wrong also...

I'll try again...

Joined: 10/16/2009

Can someone help me with this?

The button addition seems right, but I can't figure out how to add a resource correctly! Can someone give an example XSL for adding an image?

Joined: 03/31/2009

I would like to help but I don't understand it correctly, so what's happening when you run WoG with this? The button is functioning but it isn't showing right resource/images?

My Gooish profile | Videos on YouTube | My WOG Mods

Joined: 03/31/2009

You have to add these two lines in recourses.

<Image id="IMAGE_SCENE_MAPWORLDVIEW_II_GOO2_UP" path="res/levels/MapWorldView/ii_goo2_up" />
<Image id="IMAGE_SCENE_MAPWORLDVIEW_II_GOO2_UP" path="res/levels/MapWorldView/ii_goo2_over" />

But, let me guess, You already did and WoG crashes when you try to start it...

My Gooish profile | Videos on YouTube | My WOG Mods

Joined: 06/19/2009

Enchanter49 wrote:
The button addition seems right...

Err... well I tried the XSL you gave above, and it doesn't work for me....
And I can see a couple of reasons why....

I'd do something like this

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 
  <!-- Copy everything not matched by another rule -->
  <xsl:template match="* | comment()">
    <xsl:copy>
      <xsl:copy-of select="@*"/>
      <xsl:apply-templates/>
    </xsl:copy>
  </xsl:template>
 
  <!-- Insert The WoG-2 Button -->
  <xsl:template match="/scene/buttongroup">
    <xsl:copy>
      <xsl:copy-of select="@*"/>
      <xsl:apply-templates/>
      <xsl:if test="@id='mainbuttongroup'">
      <!-- WoG-2 Button -->
      <button id="wog2covert" depth="8" x="-127.66" y="63.83" scalex="1" scaley="1" rotation="0" alpha="1" colorize="255,255,255" up="IMAGE_SCENE_MAPWORLDVIEW_II_WOGC_UP" over="IMAGE_SCENE_MAPWORLDVIEW_II_WOGC_OVER" disabled="IMAGE_SCENE_MAPWORLDVIEW_II_WOGC_DISABLED" onclick="wogcorp" onmouseenter="wogcorpshowtext" onmouseexit="islandhidetext" />
      <!-- This is it. For now, until we have a working title screen, it will lead to the final level of the game. -->
	</xsl:if>
    </xsl:copy>
  </xsl:template>
 
<!-- XSL By DaftasBrush -->
 
</xsl:transform>

I'm not hugely UP on my XSL, there might be a better way of doing it.. but Baby Steps!
This SUCCESSFULLY adds an extra button... but I changed as little as possible...
It's just a renamed repositioned copy of the WOGC_intact.. with it's functionality and GFX unchanged...
But it should get you going... if you're still struggling with the actual adding.

Joined: 06/19/2009

Oh.. And...
This will add images to a resource file... (based on Pavke's 2 lines)

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 
  <!-- Copy everything not matched by another rule -->
  <xsl:template match="* | comment()">
    <xsl:copy>
      <xsl:copy-of select="@*"/>
      <xsl:apply-templates/>
    </xsl:copy>
  </xsl:template>
 
  <!-- Insert The WoG-2 Button -->
  <xsl:template match="/ResourceManifest/Resources">
    <xsl:copy>
      <xsl:copy-of select="@*"/>
      <xsl:apply-templates/>
<Image id="IMAGE_SCENE_MAPWORLDVIEW_II_GOO2_UP" path="res/levels/MapWorldView/ii_goo2_up" />
<Image id="IMAGE_SCENE_MAPWORLDVIEW_II_GOO2_OVER" path="res/levels/MapWorldView/ii_goo2_over" />
    </xsl:copy>
  </xsl:template>
 
<!-- XSL By DaftasBrush -->
 
</xsl:transform>

HTH..
Edit: Now I've actually tried it with the new images... it doesn't appear...
Swap them back to the originals... and it's fine!

Hmm... I suspect Pavke knows something we don't... Wink

Edit the Edit:
Or maybe not... I'd put the new images in the wrong folder DOH!!
All working fine! Have new button, with new images! Woo!

Joined: 10/16/2009

Daft As Brush, are those correct indentations? The images are pushed towards the left margin instead of in a group...?

Pavke, the button WON'T function BECAUSE I CAN'T add the correct image files... Thanks for your help anyway.

Joined: 06/19/2009

Enchanter49 wrote:
Daft As Brush, are those correct indentations? The images are pushed towards the left margin instead of in a group...?

It really doesn't matter...!!!
The identation / whitespace formatting has absolutely no effect on the loading / processing / outcome...
It's XML... it's the tags that matter! not what it looks like.

Edit:
Ta da! btw

Joined: 12/31/2009

Hol-e-crap he did it. Now we need to figure out how to re-direct it to go to a NEW chapter for WoG 2.(or anything else we have in mind)

Joined: 10/16/2009

James wrote:
Hol-e-crap he did it. Now we need to figure out how to re-direct it to go to a NEW chapter for WoG 2.(or anything else we have in mind)

As long as this works, no one but me should have to worry about those things. Wink

...trust me...

Joined: 12/31/2009

Well, since it works, WoG2 team has a bunch of stuff to do for new chapter. (And other WoG 2...um...stuff...I dunno)

Joined: 10/16/2009

James wrote:
Well, since it works, WoG2 team has a bunch of stuff to do for new chapter. (And other WoG 2...um...stuff...I dunno)

Look in the forums/Email.

Joined: 12/31/2009

...I can't see it: my method (listed in my sig) takes the entire DAY to get functioning (and school takes too big a chunk of it.) and my proxy doesn't allow me to sign in to ANYTHING!!! (Sure, airaim works, but it won't let me log in to my buddies list!)

EDIT: Screw it, I got it to work for about an hour...

Joined: 10/16/2009

James wrote:
...I can't see it: my method (listed in my sig) takes the entire DAY to get functioning (and school takes too big a chunk of it.) and my proxy doesn't allow me to sign in to ANYTHING!!! (Sure, airaim works, but it won't let me log in to my buddies list!)

Well, this is going off-topic. Tongue I meant look at the last newsletter and/or go to goo2forums.webs.com

Joined: 03/31/2009

first, @Enchanter49
Are you making WoG2 goomod or a complete new game. for a goomod 70MB is large.

DaftasBushes xmls are much cleaner, you don't have you put everything in main.xml to add button, just the lines that you are adding.

@DadtasBrush
I see you are using my New Look mod. Update it please, that version has a bug. You will be happy when you see bugless one. Smile

@Both
You added a WoG Corporation to main menu, that good, but...
I thing WoGC button is "allowed" by wog.exe

Try adding Going Up....

And try adding a button in side WoG Corporation...

My Gooish profile | Videos on YouTube | My WOG Mods

Joined: 06/19/2009

Pavke wrote:
I see you are using my New Look mod. Update it please, that version has a bug. You will be happy when you see bugless one. Smile

I only DL'd YESTERDAY!... I have v1.3 ... seems to be the latest!
But if you think I have the bug because of the "Ta Da!" screenshot... don't worry... that only happened when I was making mods to the xml myself... if I use GooTool and "Save"... it's all fine!

Pavke wrote:
@Both
You added a WoG Corporation to main menu, that good, but...
I thing WoGC button is "allowed" by wog.exe
Try adding Going Up....
And try adding a button in side WoG Corporation...

You think it's not possible to add a chapter. I saw a comment (maybe from davidc) saying that.
I was just helping with the XSL...
I assumed that Enchanter had found a way to do it...
but my tests so far have all failed.. *CRASH* or Button does nothing.
Only spent about 1 hour on it though...

If it is *impossible*...
My idea would be rewrite Ch.5... keep the existing levels in.. but make all the "standard" gfx smaller and put them in the bottom corner, and put the new "WOG2" stuff above (in the sky?).

Joined: 10/16/2009

Pavke wrote:
You added a WoG Corporation to main menu, that good, but...
I thing WoGC button is "allowed" by wog.exe

Try adding Going Up....

And try adding a button in side WoG Corporation...


DAB was the one who did the wogc shortcut. The only thing I could get to work was a button to a chapter...

Joined: 03/31/2009

Enchanter49 wrote:

DAB was the one who did the wogc shortcut. The only thing I could get to work was a button to a chapter...

I know! I'm just saying that it is impossible to add another chapter or a level in main menu. Only buttons that are "allowed" by wog.exe are 5 chapter buttons and three corporation buttons.

I'm just asking how are you gonna put your WoG2 together.

My Gooish profile | Videos on YouTube | My WOG Mods

Joined: 12/31/2009

Well, then do we do it the gootool way? (Upper hand corner button (not multiple, cause then people would skip all of them) of goo-filled hills= entire WoG2 first chapter?) chapter?)

Joined: 10/16/2009

James wrote:
Well, then do we do it the gootool way? (Upper hand corner button (not multiple, cause then people would skip all of them) of goo-filled hills= entire WoG2 first chapter?) chapter?)

NONONONONONONONONONONONONONONONONONO!!!!!!!!

We are definitely NOT going to do it that way...

If everything I've heard is true, which it is, then we will either:
a)replace all the other chapters in a goomod
b)make a new installation and STILL replacing all the other chapters (more likely)

We will probably do b as a will be a pretty large goomod file. Tongue

Joined: 12/31/2009

So...make the chapters have new images (changing the apperance to a NEW menu so that it doesn't look like the old one*) and replace ALL levels with our own?

*We should still add the originals somewhere on the menu...and yes, that would be the biggest dang goo-mod I would probably see in my life.

Joined: 04/10/2009

I vote for installation!!!

Crazeh man!

Joined: 10/16/2009

Joris wrote:
I vote for installation!!!

This is getting off-topic, but I agree.

If we use an installation, then the XSL is useless...

Joined: 05/26/2009

I don't get it. Most people think you have to make an XSL to edit a .bin file in WoG. What I just do is decrypt, edit, and encrypt. (GooTool -> Advanced -> Decrypt/Encrypt)

OVER 9000

Joined: 03/31/2009

jmleleven wrote:
I don't get it. Most people think you have to make an XSL to edit a .bin file in WoG. What I just do is decrypt, edit, and encrypt. (GooTool -> Advanced -> Decrypt/Encrypt)

Yes that true, but how do you share that as a goomod? Example above is goomod addin xml

My Gooish profile | Videos on YouTube | My WOG Mods