Bouncy Surfaces

19 replies [Last post]
Joined: 03/13/2012

Hi! I am trying a bounce surface and it seems not to work. Here is the materials.xml.xsl

 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output encoding="UTF-8"/>
<!-- Select all nodes -->
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="/materials[1]/material[20]">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
<material id="ngbounce" friction="0.3" bounce="20" minbouncevel="100" stickiness="0"/>
</xsl:template>
</xsl:stylesheet>

Please help!

Because writing signatures is too mainstream

Joined: 07/05/2011

You can take a view at my addin The Other Side of the Planet. There is a bouncy material in it. Wink
(by the way, WooGLE can generate the material xsl for you)

Joined: 03/13/2012

Mygod wrote:
(by the way, WooGLE can generate the material xsl for you)

Huh? how?
EDIT
It says the same i tried it and it did nto work. here is my scene.xml now:
<!-- Created by WooGLE v0.78 RC3 -->
<scene backgroundcolor="0,0,0" maxx="500" maxy="1000" minx="-500" miny="0">
	<line anchor="500,300" id="right" normal="-1,0" tag="detaching" />
<line anchor="-500,300" id="left" normal="1,0" tag="detaching" />
<line anchor="0,20" id="ground" normal="0,1" />
<SceneLayer alpha="1" animdelay="0" animloop="false" depth="0" image="IMAGE_SCENE_BOUNCYBALL_SKYTILE" rotation="0" scalex="3.933" scaley="3.99" tilex="false" tiley="false" x="5.48" y="496.23" />
<rectangle height="1009.7" id="geometry1" rotation="0.0" static="true" tag="ngbounce" width="104.53" x="-524.84" y="501.21" />
<rectangle height="1187.06" id="geometry2" rotation="1.57079632679" static="true" tag="ngbounce" width="83.46" x="23.67" y="-6.07" />
<rectangle height="1009.7" id="geometry3" rotation="0.0" static="true" tag="ngbounce" width="104.53" x="498.024465601" y="538.011831452" />
<rectangle height="1187.06" id="geometry4" rotation="1.57079632679" static="true" tag="ngbounce" width="83.46" x="3.63521507738" y="999.684146278" />
<linearforcefield antigrav="false" center="43.974375936,466.128384922" dampeningfactor="0" force="0,-10" type="gravity" water="false" />
</scene>

Because writing signatures is too mainstream

Joined: 07/05/2011

Just edit the material.xml.bin file and use the material in the WooGLE. WooGLE will generate XSL automatically while generating goomod.

Joined: 03/13/2012

You mean modify the game itself? Like the game i am editting?

Because writing signatures is too mainstream

Joined: 07/05/2011

nothinggoo wrote:
You mean modify the game itself? Like the game i am editting?
Yes. Edit the material.xml.bin in the game you are editing.

Joined: 04/29/2009

The minbouncevel of your material (ngbounce) is very high. Try a smaller value (about 0-1).

edit:
I think minbouncevel means minimum bounce velocity. If it's 100 anything needs a velocity of 100 to bounce off.

Joined: 07/05/2011

Yes. minbouncevel means minimum bounce velocity. Some of the materials use 102 as its value. Maybe it means it will never bounce. Try using 0 as its value.

Joined: 03/13/2012

Is this better:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output encoding="UTF-8"/>
  <!--Select all nodes-->
  <xsl:template match="node()|@*">
    <xsl:copy>
      <xsl:apply-templates select="node()|@*"/>
    </xsl:copy>
  </xsl:template>
  <xsl:template match="/materials[1]/material[20]">
    <xsl:copy>
      <xsl:apply-templates select="node()|@*"/>
    </xsl:copy>
    <material id="ngbounce" friction="0.0" bounce="5" minbouncevel="1.0" stickiness="0"/>
  </xsl:template>
</xsl:stylesheet>

?

Because writing signatures is too mainstream

Joined: 07/05/2011

Maybe you can try to replace /materials[1]/material[20] with /materials/text()[1]. I think this will be better. Tongue

Joined: 03/13/2012

OK....Then if it does not work i start over.

Because writing signatures is too mainstream

Joined: 03/13/2012

Nothing happens. The walls still behave as things with the "wall" tag. Besides, if i edit the game's materials.xml.bin it does not show up on the editor.

Because writing signatures is too mainstream

Joined: 04/17/2011

Mygod wrote:
You can take a view at my addin The Other Side of the Planet. There is a bouncy material in it. Wink
(by the way, WooGLE can generate the material xsl for you)

To be honest everyone could make bouncy material. If you want a challenge make a perfect escalator of geometries so the goo balls could stand on it and it's rotating - I have an idea of how to make it but I'm challenging you - If you do take a video, upload it on youtube and show it here.

Joined: 03/13/2012

Ummm...wiki...right now i have a problem and we are trying to fix it. As you can see not everyone can make a bouncy material. besides it does not work for me!!!

Because writing signatures is too mainstream

Joined: 09/01/2009

nothinggoo is right, wiki. Please don't criticize people who are having a genuine problem. Unless you have a suggestion, don't post.

Joined: 03/13/2012

URGH!!!! I even modified the original materials!!!! MY GAME DOES NOT SEEM TO LIKE IT! MOM4EVR! CAN YOU PLEASE DOWLOAD THE MOD IN THE "ERRORS" UNPUBLISHED LEVEL? http://goofans.com/download/level/errors

Because writing signatures is too mainstream

Joined: 09/01/2009

Ok, I uploaded a fixed version of the addin on that page you just linked.

Here's the final XML, autogenerated by WooGLE:

<!-- Created by WooGLE v0.78 RC3 -->
<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>
 
  <!-- Append -->
  <xsl:template match="/materials">
    <xsl:copy>
      <xsl:copy-of select="@*"/>
      <xsl:apply-templates/>
      <material bounce="5" friction="10" id="ngbounce" minbouncevel="1.0" stickiness="0" />
 
    </xsl:copy>
  </xsl:template>
</xsl:transform>

I think there were a couple problems. First off, you had tag=ngbounce for the geometry in that level, which I'm surprised doesn't crash the game in the first place. What you want is material=ngbounce instead.

Second, I don't think the Mac version of WooGLE is caught up enough to be able to autogenerate your XSL for you. We really need someone with Python knowledge to compile the latest source. Hopefully after this upcoming semester, I'll at least have enough understanding of Python to do that.

Third, the material is so bouncy, the Goo Balls fly out of the level within seconds, even when I changed all the rectangles to lines. So you'll definitely want to tweak the material properties there in order to get it to work more like how you want it. But at least now you have something working to build off of. Just edit the XSL in that goomod to toy with the material's values.

Cheers,
MOM

Joined: 03/13/2012

Thanks! Well, i am using the windows version on Mac, but still...Guess you are right.

I downloaded your version and it worked. Also, i made modifications in the original version and it worked. It was all the tag/material mistake. Oh and Mom4EVR, it was juts a test. A prototype for the Flying Gardens Chapter Pack.

Tank you everyone who helped!

EDIT
How about u change the bounce to 1.1 and upload as sample?

Because writing signatures is too mainstream

Joined: 09/01/2009

Ah, ok. I thought you were using the Mac version of the editor. My mistake.

Good idea with the sample. Let me do that...

Joined: 03/13/2012

Make me a co-author then please...

Because writing signatures is too mainstream