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: 159
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.



Author Topic: Merging panel and layer  (Read 1092 times)

0 Members and 1 Guest are viewing this topic.

Offline utunnels

  • Developer
  • Hero Member
  • *****
  • Posts: 2713
Merging panel and layer
« on: September 28, 2011, 11:19:47 pm »
I'm working on merging fglayer, bglayer, panel and frontpanel to a single type called s_layer.
But I know someone must want script access to them.

The old functions changebglayerproperty and changefglayerproperty need to be updated or changed to fit the new layout. But since panels are technologically layers with zero bgspeedratio,  it would be hard for the modders to know their indices.

Any ideas?


Offline Bloodbane

  • Hero Member
  • *****
  • Posts: 7113
  • Dark Dragon
Re: Merging panel and layer
« Reply #1 on: September 28, 2011, 11:41:54 pm »
Quote
But since panels are technologically layers with zero bgspeedratio,  it would be hard for the modders to know their indices.

 Sorry, I'm lost here. Why do we need to know their indices?
OpenBoR Manual

Basic OpenBoR Tutorials

OpenBoR Tricks & Tutorials

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

Offline utunnels

  • Developer
  • Hero Member
  • *****
  • Posts: 2713
Re: Merging panel and layer
« Reply #2 on: September 29, 2011, 12:09:37 am »
For script users of course.

If you want to change a layer property, you need to know its index.

Usually we define the level like this:

Code: [Select]
background blahblah... #layer 0
water blahblah...           #layer 1
bglayer blahblah....       #layer 2
bglayer blahblah....       #layer 3

panel  normal neon screen
panel  normal neon screen
panel  normal neon screen

order aabcccca # layer 4 onward

frontpanel blahblah...

fglayer blahblah...

Offline utunnels

  • Developer
  • Hero Member
  • *****
  • Posts: 2713
Re: Merging panel and layer
« Reply #3 on: September 30, 2011, 12:06:12 pm »
What, no one even complains?

 :hmm:


Anyway, I've merged the 4 script functions to 2.

getlayerproperty(string type, int index, string property);
changelayerproperty(string type, int index, string property, value);

Type specifies the old type of the layer, it can be: background, bglayer, fglayer, panel, neon, screen, frontpanel, water and generic.


background - only one background available in a level, so just use 0 for index
bglayer - those you defined using bglayer in your level txt. The first one is 0, and so on.
fglayer - similar to bglayer.
panel - a panel, now same as other panels, only differs in properties. The index is given using order command.  So if you have order aabac, you have 5 panels. The order has nothing to do with panel command.
neon - a neon panel, the rule of index is same as above. But keep in mind not all panels have a neon, so this method could fail if the panel index you give don't have one.
screen - a screen panel, the rule of index is same as above. But keep in mind not all panels have a screen, so this method could fail if the panel index you give don't have one.
frontpanel - similar to panel, the order is same as how you define them.
water - usually there's only 1, but according to the new logic you can have many, though it is better to use bglayer instead.
generic - this has not been created. I reserved it for a new command that can use all properties of the layer structure.
« Last Edit: September 30, 2011, 12:10:07 pm by utunnels »

Offline Bloodbane

  • Hero Member
  • *****
  • Posts: 7113
  • Dark Dragon
Re: Merging panel and layer
« Reply #4 on: October 01, 2011, 12:38:14 am »
 I haven't tinkered with background control scripts yet so I can't say much. But I think it's enough.

Quote
water - usually there's only 1, but according to the new logic you can have many, though it is better to use bglayer instead.

 We can declare more waters now? never heard of it before.
OpenBoR Manual

Basic OpenBoR Tutorials

OpenBoR Tricks & Tutorials

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

Offline utunnels

  • Developer
  • Hero Member
  • *****
  • Posts: 2713
Re: Merging panel and layer
« Reply #5 on: October 01, 2011, 12:44:14 am »
Water was just there to be backward compatible, it will be converted to a bglayer with water effect.
Everything is treated as a layer now.

Though you still can't have multiple background, the default palette logic of background must be kept for 8 bit mode. 


Oops, forgot to say, the build has not been compiled by the server. :laughing:

Offline Plombo

  • Hero Member
  • *****
  • Posts: 1724
  • Your source for useful modding tools!
Re: Merging panel and layer
« Reply #6 on: October 03, 2011, 10:58:25 pm »
This change (SVN r3483) breaks Mr. Q's mod "Art of Fighting: Beats of Rage Remix III" when starting a new game.  It prints this error message to the log:
Code: [Select]
ERROR: load_level, file data/levels/begin01.txt, line 0, message: Level error: level has no panels
It might happen with other mods too; I haven't tested with anything else yet.

Offline utunnels

  • Developer
  • Hero Member
  • *****
  • Posts: 2713
Re: Merging panel and layer
« Reply #7 on: October 03, 2011, 11:08:25 pm »
Not sure about that issue.  level->numpanels is determined by order command. I can't see a reason why there's no panels.

Have you tried a more recent build?


Offline Plombo

  • Hero Member
  • *****
  • Posts: 1724
  • Your source for useful modding tools!
Re: Merging panel and layer
« Reply #8 on: October 04, 2011, 12:17:40 am »
Not sure about that issue.  level->numpanels is determined by order command. I can't see a reason why there's no panels.

Have you tried a more recent build?

I'm running from the latest SVN.  I traced the issue to r3483 specifically after noticing it was broken.

Offline utunnels

  • Developer
  • Hero Member
  • *****
  • Posts: 2713
Re: Merging panel and layer
« Reply #9 on: October 04, 2011, 12:23:33 am »
Do you know the content of the level txt?

Offline Plombo

  • Hero Member
  • *****
  • Posts: 1724
  • Your source for useful modding tools!
Re: Merging panel and layer
« Reply #10 on: October 04, 2011, 10:40:32 am »
I can post it here:
Code: [Select]
music           data/music/MIX.bor
bossmusic data/music/BOSS1.bor
background data/bgs/s23/total2.gif
panel data/bgs/s23/n01.gif
direction       right
light  10   -30
at        0
settime         0
notime          1
noslow          1
order a
spawn1  105 20
spawn2  105 93
setweap 1
bgspeed 50 0

wall            400 260 0 0 100 100 300 1000

#-------1

spawn   intro01
flip    1
coords  0 276
at      0

spawn   ghost1
health  5
coords  530 220
at      0


Offline utunnels

  • Developer
  • Hero Member
  • *****
  • Posts: 2713
Re: Merging panel and layer
« Reply #11 on: October 04, 2011, 10:58:52 am »
I can't reproduce the issue with the settings.

 :hmm:

Offline Plombo

  • Hero Member
  • *****
  • Posts: 1724
  • Your source for useful modding tools!
Re: Merging panel and layer
« Reply #12 on: October 04, 2011, 05:18:28 pm »
Try downloading the mod and running it.

Offline utunnels

  • Developer
  • Hero Member
  • *****
  • Posts: 2713
Re: Merging panel and layer
« Reply #13 on: October 04, 2011, 08:46:11 pm »
It seems the mod is not on lavalit yet.

But I think I've found the problem.  I mistakenly used the wrong pointer in a memset call.


Edit*

Fixed.
« Last Edit: October 04, 2011, 08:49:44 pm by utunnels »

Offline Plombo

  • Hero Member
  • *****
  • Posts: 1724
  • Your source for useful modding tools!
Re: Merging panel and layer
« Reply #14 on: October 04, 2011, 10:23:59 pm »
But I think I've found the problem.  I mistakenly used the wrong pointer in a memset call.


Edit*

Fixed.

I can confirm that it's fixed now.  Thanks! :)

 



 0%




mighty
SimplePortal 2.3.3 © 2008-2010, SimplePortal