merge dir. problem, HELP!!!

7 replies [Last post]
Joined: 03/31/2009

lets get right down to the business

1. question: now can I in merge dir replace only one SceenLayer (BallInstance)?

example from addin file formats:

  <!-- Delete existing ball instances -->
  <xsl:template match="/level/BallInstance"/>
 
  <!-- insert drip balls into the place where the previous balls were -->
  <xsl:template match="/level/comment()[contains(., 'Balls')]">
    <xsl:copy/>
    <BallInstance type="water" x="-459.69" y="262.68" id="0" angle="0" />
    <BallInstance type="water" x="-341.64" y="279.34" id="1" angle="0" />
    <BallInstance type="water" x="-232.63" y="284.03" id="2" angle="0" />
    <BallInstance type="water" x="-122.63" y="284.03" id="3" angle="0" />
    <BallInstance type="water" x="-122.63" y="184.03" id="4" angle="0" />
 
    <BallInstance type="water" x="-329.74" y="411.84" id="5" angle="0" />
    <BallInstance type="water" x="-329.74" y="411.84" id="6" angle="0" />
    <BallInstance type="water" x="-329.74" y="411.84" id="7" angle="0" />
    <BallInstance type="water" x="-329.74" y="411.84" id="8" angle="0" />
    <BallInstance type="water" x="-329.74" y="411.84" id="9" angle="0" />
    <BallInstance type="water" x="-329.74" y="411.84" id="10" angle="0" />
  </xsl:template>

This deletes all BallInstances and replaces them with water goos but how can I replace only one goo? example:

   <!-- Delete only one goo -->
   <xsl:template match="/level/BallInstance/id="3" "/> , <xsl:template 
 
   <!-- insert only one water goo -->
   match="/level/comment()[contains(., 'Balls')]">
    <xsl:copy/>
 
    <BallInstance type="water" x="-122.63" y="284.03" id="3" angle="0" />
 
   </xsl:template>
 
  </xsl:template>

Is this OK? I think not because it isn't working.
What is the code to replace only one BallInstance/SceenLayer/or whatever?

2. question: Is it possible to set diferent SceenLayer position/size for diferent resolutions? Here's what I'm thinking: My curent code for my new main menu background is:

<SceneLayer name="bg" depth="-80" x="0" y="300" scalex="0.38" scaley="0.21" rotation="0" alpha="1" colorize="255,255,255" image="IMAGE_SCENE_MAPWORLDVIEW_BG"   />

and this workd only for normal resolution.

I think I saw somewhere in the addins something like this:

<SceneLayer (tipe/or stile="widescreen") "name="bg" ...... with different stats ........ image="IMAGE_SCENE_MAPWORLDVIEW_BG"   />

is it possible?

can we code for every resolution? I was thinking:

<SceneLayer (tipe/or stile="resolution1200x700")...with different stats.... image="IMAGE_SCENE_MAPWORLDVIEW_BG"   />

<SceneLayer (tipe/or stile="resolution1600x1000")...with different stats.... image="IMAGE_SCENE_MAPWORLDVIEW_BG"   />

can it be done?

Does anyone know something about this?

My Gooish profile | Videos on YouTube | My WOG Mods

thB
thB's picture
ContributorAddin AuthorKleptomaniacToo Much Free TimeSerious OCD
Joined: 04/17/2009

Dunno 'bout question 1, but a thought about #2:
Although it might be useful in some cases to have resolution specific scene layers this is a thing that imo should be avoided at all costs to keep levels generic.
There are so many different resolutions, you don't want to (and shouldn't!) include every single one of them to make your level playable. What about some guy with a strange resolution you didn't even think about?
As I said, just a thought. If there's an elegant way to set for example a default or "fallback" setting etc. I could live with it (if it's unavoidable for the level to "work"). Smile

my gooey profile | my video channel | author of Hazardous Environment

Joined: 03/31/2009

It is about my first mode http://goofans.com/download/theme/new-look-world-of-goo. Can you test it?

It works in normal resolutions but not in widescreen, you can see the end of the image and the right and left in widescreen.
If I set the scale to match the widescreen it would be to wide for the normal resolution.
That isn't the case with the original blue bg.phg and they are bouth the same proportion!!

(the image is in high resolution 2200x2200).

Currently it is working by overriding .xml but I want it to merge.

I wasn't thinking about supporting all resoulutions, just those that GooTool supports. Smile

My Gooish profile | Videos on YouTube | My WOG Mods

thB
thB's picture
ContributorAddin AuthorKleptomaniacToo Much Free TimeSerious OCD
Joined: 04/17/2009

Interesting, I thought that for widescreen the visible area is just cropped and the width is left untouched. Read that somewhere and it makes sense to me as one can actually see way "less" (regarding height) in widescreen. :I
I can try your mod this evening, I'm currently at work. Unfortuanetly no WoG here. Wink

my gooey profile | my video channel | author of Hazardous Environment

Joined: 03/31/2009

There was a bug, looked horrible!!! I fixed it now. Try downloading the 1.1 version Smile

My Gooish profile | Videos on YouTube | My WOG Mods

thB
thB's picture
ContributorAddin AuthorKleptomaniacToo Much Free TimeSerious OCD
Joined: 04/17/2009

Took a look at your mod, but didn't have the time to do any widescreen testing (except for looking at it). Tongue
Just had a thought about your first question, though.
You have an error in the matching pattern for the BallInstance you want to replace (and the tag syntax itself for that matter).
Again, no time to test, but I think this goes in the right direction:

<!-- delete old BallInstance -->
<xsl:template match="/level/BallInstance[@id=3]" />
 
<!-- insert water goo with same id -->
<xsl:template match="/level/comment()[contains(., 'Balls')]">
  <xsl:copy />
  <BallInstance type="water" x="-122.63" y="284.03" id="3" angle="0" />
</xsl:template>

my gooey profile | my video channel | author of Hazardous Environment

Joined: 03/31/2009

Yeah.. I was just beginig to understand... Used merge in Loadizing Mod and it works good. Thx for all your troubles.

My Gooish profile | Videos on YouTube | My WOG Mods

Joined: 11/04/2008

Pavke wrote:
1. question: now can I in merge dir replace only one SceenLayer (BallInstance)?

[snip]

   <!-- Delete only one goo -->
   <xsl:template match="/level/BallInstance/id="3" "/> , <xsl:template 
 
   <!-- insert only one water goo -->
   match="/level/comment()[contains(., 'Balls')]">
    <xsl:copy/>
 
    <BallInstance type="water" x="-122.63" y="284.03" id="3" angle="0" />
 
   </xsl:template>
 
  </xsl:template>

Is this OK? I think not because it isn't working.
What is the code to replace only one BallInstance/SceenLayer/or whatever?

Something like this should do the trick:

  <!-- Replace the goo with id 3 -->
  <xsl:template match="/level/BallInstance[@id=3]">
    <BallInstance type="water" x="-122.63" y="284.03" id="3" angle="0" />
  </xsl:template>

Pavke wrote:

2. question: Is it possible to set diferent SceenLayer position/size for diferent resolutions? Here's what I'm thinking: My curent code for my new main menu background is:

No, I don't think so. The only widescreen-specific stuff I'm aware of in the XML is the camera positioning in a level.

Pavke wrote:

I wasn't thinking about supporting all resoulutions, just those that GooTool supports.

GooTool offers up every resolution supported by the user's graphic card. Whether WoG runs under that resolution is at the user's risk!

-davidc