Welcome, Guest. Please login or register.

What openbor you prefer: Double dragon,battletoads or final fight !? by lirexpatrio
[December 07, 2012, 07:15:27 pm]


what are your favorite games OpenBOR?! by lirexpatrio
[December 07, 2012, 07:09:46 pm]


Post Some Awesome Videos by maxman
[December 07, 2012, 05:51:39 pm]


Can @cmd playmusic "aaaa" 1 also increse music sound ? by BeasTie
[December 07, 2012, 05:24:38 pm]


Streets of Rage: Silent Storm by mtrain
[December 07, 2012, 03:45:05 pm]


Site will be down for maintenance on 12/8/2012 thru 12/10/2012 by Damon Caskey
[December 07, 2012, 07:42:42 am]


Cancelled SOR 3d Remake by riccochet
[December 07, 2012, 03:58:33 am]


Dungeon Fighter: B.O.R. by msmalik681
[December 07, 2012, 03:24:27 am]


[TUTORIAL] How to create 4 Games of OpenBOR in 1 CD (650 MB) by magggas
[December 06, 2012, 09:46:25 pm]


custknife by Bloodbane
[December 06, 2012, 09:34:09 pm]


blockfx help by B.Kardi
[December 06, 2012, 04:09:14 pm]


street of age 4 hd by corradlo
[December 06, 2012, 01:41:36 pm]


ClaFan - Classic Fantasy ver 1.17 by soniczxblade
[December 06, 2012, 05:01:20 am]


Bug Archive by Bloodbane
[December 06, 2012, 02:00:44 am]


"Bio-Doom" and "Gears of Doom" by BulletBob
[December 05, 2012, 10:07:21 pm]


Contra Locked 'N' Loaded v2 by Bloodbane
[December 05, 2012, 09:39:43 pm]


Downloadable OpenBoR Manual by BeasTie
[December 05, 2012, 08:31:24 pm]


Having trouble testing changes by B.Kardi
[December 05, 2012, 03:05:53 pm]


DragonBall Absalon by msmalik681
[December 05, 2012, 02:52:13 pm]


[Hi-Res] Swamp by Vibrant
[December 05, 2012, 10:47:14 am]


  • Dot Guests: 141
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.



Author Topic: A problem with obstacles!  (Read 565 times)

0 Members and 1 Guest are viewing this topic.

Offline Liu-Kang

  • Full Member
  • ***
  • Posts: 149
A problem with obstacles!
« on: October 01, 2012, 12:09:25 am »
I've run into a problem with obstacles recently that I could use some help with. In my Giant Monster game buildings serve as obstacles for the battling behemoths. Unlike obstacles in most games though I want these buildings to leave behind piles of rubble once they are demolished. Making them leave behind rubble was easy enough, but the end result isn't pretty:



I want the rubble to essentially become a part of the ground, so that the Monsters can walk over the rubble without being covered like in the picture above. Any help with the problem would be greatly appreciated.  :)

Offline LeeBrother

  • Full Member
  • ***
  • Posts: 138
Re: A problem with obstacles!
« Reply #1 on: October 01, 2012, 02:19:36 pm »
Well why don't  make the rubble as a part of the ground? Now place building obstacles in front of the rubble. Once they are destroyed, only the rubble-ground is left.

Offline Liu-Kang

  • Full Member
  • ***
  • Posts: 149
Re: A problem with obstacles!
« Reply #2 on: October 01, 2012, 03:10:42 pm »
Well why don't  make the rubble as a part of the ground? Now place building obstacles in front of the rubble. Once they are destroyed, only the rubble-ground is left.

I'd like to use this as a last resort because their are some buildings that leave behind bigger rubble from when they were standing like this ferris wheel and it would look incredibly awkward just looking like that:



EDIT:

Now this is creepy, we have the same post count  :wow!:
« Last Edit: October 01, 2012, 03:48:16 pm by Liu-Kang »

Offline zamuel

  • Commercial
  • Hero Member
  • *****
  • Posts: 564
Re: A problem with obstacles!
« Reply #3 on: October 01, 2012, 06:11:38 pm »
setlayer {int}
~This entity will be displayed as if it were at z position {int}, regardless of it's actual position.

Try playing with it some to find a value that works best for you.
FOLH Progress
Primary game: Done!
Extra mode: Done!

Street Team: Reign of the Iron Dragon - http://lavalit.com:8080/index.php/topic,6240.0.html

Offline Bloodbane

  • Hero Member
  • *****
  • Posts: 7113
  • Dark Dragon
Re: A problem with obstacles!
« Reply #4 on: October 01, 2012, 11:43:07 pm »
 I agree with zamuel, setlayer is the solution.
 Try setlayer 1 to the rubbles.
OpenBoR Manual

Basic OpenBoR Tutorials

OpenBoR Tricks & Tutorials

"The more often enemies attack, the more open they are to counter attacks"

Offline Liu-Kang

  • Full Member
  • ***
  • Posts: 149
Re: A problem with obstacles!
« Reply #5 on: October 02, 2012, 01:30:57 am »
Damn, I was hoping I could put setlayer for just the end frames  :bored: I'm gonna have to have the building death spawn a whole new entity rubble huh?

Offline Bloodbane

  • Hero Member
  • *****
  • Posts: 7113
  • Dark Dragon
Re: A problem with obstacles!
« Reply #6 on: October 02, 2012, 02:26:28 am »
 Ah, so the rubble is part of obstacle.
 If that's the case, add this script in obstacle's DEATH animation

anim death
@script
    if(frame==0){
      void self = getlocalvar("self");
      changeentityproperty(self, "setlayer", 1);
    }
@end_script
...

 This script will set layer at 1st frame when DEATH is played.
 If you want it run at other frame just change 0 to other frame number.
OpenBoR Manual

Basic OpenBoR Tutorials

OpenBoR Tricks & Tutorials

"The more often enemies attack, the more open they are to counter attacks"

Offline BeasTie

  • Hero Member
  • *****
  • Posts: 760
Re: A problem with obstacles!
« Reply #7 on: October 02, 2012, 03:37:03 am »
Nice one, handy script. :cheers!:

Offline Bloodbane

  • Hero Member
  • *****
  • Posts: 7113
  • Dark Dragon
Re: A problem with obstacles!
« Reply #8 on: October 02, 2012, 03:49:22 am »
 Yeah, but use it at your own risk. AFAIK there's no way to reset setlayer so once you set it with this script, entity will be stuck in that layer!

 I normally use this in 2D mod since there's no z axis and entity depth position can be controlled by setlayer so it's safe to use in 2D mod.

 And, I should post also that the script can be declared in other animation. Aside of frame, the value can also be changed. Just change 1 next to "setlayer" to any value.
OpenBoR Manual

Basic OpenBoR Tutorials

OpenBoR Tricks & Tutorials

"The more often enemies attack, the more open they are to counter attacks"

Offline Liu-Kang

  • Full Member
  • ***
  • Posts: 149
Re: A problem with obstacles!
« Reply #9 on: October 02, 2012, 05:25:23 am »
Thanks Bloodbane  :cheers!: You are WAY too helpful around here!  ;D

 



 0%




mighty
SimplePortal 2.3.3 © 2008-2010, SimplePortal