Solved Platform / Wall Question

Question that is answered or resolved.

Bruce

Active member
Hello everyone,
I'm learning about platform/wall which is challenging for me right now.

I have this platform in the door.c to prevent the entities walk through it until the door is destroyed. If I understand the manual correctly, this platform will serve this purpose.

Platform -138 -138 1 0 228 8

I used Chronocrash Modders Tools to edit the level, that's how I got this platform numbers from.
However, this platform numbers don't work as I can still walk the door without breaking it. Obviously, something is not set correctly.

Can someone please take a look and see what's going on?
Thank you so much for your help.

wbardoor01.gif
 
Solution
Due to angle of this door, bbox for this obstacle might not be 100% accurate.
This is my suggestion for platform setting for this door:
Code:
anim idle
    delay    1000
    offset    90 250
    bbox    40 0 120 280 30
    platform 160 285 -136 -10 100 100 62 5000
    frame    data/chars/misc/wbardoor/wbardoor01.gif

BTW you don't need script for this door obstacle.
@Bruce,

The file name door.c sounds more like a script file. Please post the full text file in code tags (if you don't know how, see screenshot) and let us have a look at it.

1660056282827.png

DC
 
@Bruce,

The file name door.c sounds more like a script file. Please post the full text file in code tags (if you don't know how, see screenshot) and let us have a
The name is actually wbardoor. I was trying to make short...
Please see thr code below, thank you.

Code:
name    wbardoor
health    1
height 1000
nolife  0
type    obstacle
shadow    0
noquake 1
falldie 0
antigrab 1
score 100 5
subject_to_wall 1
noatflash 1
flash    flash
diesound data/sounds/wood.wav

icon          data/chars/misc/wbardoor/eicon.gif
icondie     data/chars/misc/wbardoor/eicond.gif

anim idle
    loop 0
    delay    1000
    offset 84 248
    bbox 34 0 126 248
    platform -138 -138 1 0 228 8
    frame    data/chars/misc/wbardoor/wbardoor01.gif

anim death
    jumpframe    0 3.3 1.5
    loop 0
    delay    2
    offset 84 248
    frame    data/chars/misc/wbardoor/wbardoor02.gif
    frame    data/chars/misc/wbardoor/wbardoor02.gif
    frame    data/chars/misc/wbardoor/wbardoor02.gif
    @script
        void self = getlocalvar("self");            //Caller.

        if(frame==1){
        char Name = "wbardoordummy";
        void vEntity;                                       //Target entity placeholder.
        int  iEntity;                                       //Entity enumeration holder.
        char iName;                                         //Entity Name.
        int  iMax      = openborvariant("ent_max");         //Entity count.

        //Enumerate and loop through entity collection.
        for(iEntity=0; iEntity<iMax; iEntity++){
            vEntity = getentity(iEntity);                 //Get target entity from current loop.
            iName   = getentityproperty(vEntity, "name"); //Get target type.

            //Same alias but different entity?
            if(iName == Name && vEntity != self){
            killentity(vEntity);
            }
        }
        }
    @end_script
 
The name is actually wbardoor. I was trying to make short...
Please see thr code below, thank you.

Code:
name    wbardoor
health    1
height 1000
nolife  0
type    obstacle
shadow    0
noquake 1
falldie 0
antigrab 1
score 100 5
subject_to_wall 1
noatflash 1
flash    flash
diesound data/sounds/wood.wav

icon          data/chars/misc/wbardoor/eicon.gif
icondie     data/chars/misc/wbardoor/eicond.gif

anim idle
    loop 0
    delay    1000
    offset 84 248
    bbox 34 0 126 248
    platform -138 -138 1 0 228 8
    frame    data/chars/misc/wbardoor/wbardoor01.gif

anim death
    jumpframe    0 3.3 1.5
    loop 0
    delay    2
    offset 84 248
    frame    data/chars/misc/wbardoor/wbardoor02.gif
    frame    data/chars/misc/wbardoor/wbardoor02.gif
    frame    data/chars/misc/wbardoor/wbardoor02.gif
    @script
        void self = getlocalvar("self");            //Caller.

        if(frame==1){
        char Name = "wbardoordummy";
        void vEntity;                                       //Target entity placeholder.
        int  iEntity;                                       //Entity enumeration holder.
        char iName;                                         //Entity Name.
        int  iMax      = openborvariant("ent_max");         //Entity count.

        //Enumerate and loop through entity collection.
        for(iEntity=0; iEntity<iMax; iEntity++){
            vEntity = getentity(iEntity);                 //Get target entity from current loop.
            iName   = getentityproperty(vEntity, "name"); //Get target type.

            //Same alias but different entity?
            if(iName == Name && vEntity != self){
            killentity(vEntity);
            }
        }
        }
    @end_script

I'm not sure about the platform yet, but I see another minor issue right away. This script is copied from stuff I wrote an extremely long time ago. You need to replace openborvariant("ent_max") with openborvariant("count_entities"). This will speed up the script a bit.

DC
 
Due to angle of this door, bbox for this obstacle might not be 100% accurate.
This is my suggestion for platform setting for this door:
Code:
anim idle
    delay    1000
    offset    90 250
    bbox    40 0 120 280 30
    platform 160 285 -136 -10 100 100 62 5000
    frame    data/chars/misc/wbardoor/wbardoor01.gif

BTW you don't need script for this door obstacle.
 
Solution
Due to angle of this door, bbox for this obstacle might not be 100% accurate.
This is my suggestion for platform setting for this door:
Code:
anim idle
    delay    1000
    offset    90 250
    bbox    40 0 120 280 30
    platform 160 285 -136 -10 100 100 62 5000
    frame    data/chars/misc/wbardoor/wbardoor01.gif

BTW you don't need script for this door obstacle.
This works, thank you.
I removed the script and it still worked.
I can't understand what's the purpose of the checking script for?
I had to make a bit adjustment with the upper left and lower left values.
How did you determine the platform x and the z offsets?
So the bbox has to be correct in order for this platform to work as intended?
I used the Chronocrash Modders tools to set the platform and bbox, they looked like they would work. Then they didn't work. I've also tried to setup the platform for the trash obstacles, they didn't work either.
I'm so confused on how to set platform and wall values.

Thank you very much for everyone's help.
 
I can't understand what's the purpose of the checking script for?

Well, I was going to ask you where you got that script from :rolleyes:.

How did you determine the platform x and the z offsets?

Platform and wall have same way of declaration. Both are easier to measure from bottom corner of the wall/platform. 160 285 is the coords of the bottom corner of the door sprite you've posted above.
I'm so confused on how to set platform and wall values.

First you need to imagine the platform or wall as trapezoid. Then find the coords of bottom corner in image editor or something. If they are 2 corners, choose the bottom left one.
From there you can measure relative distance of the top corners. The right corners for this door are placed way to the right in my imagination. That's why the distance to those corners are 100 pixels.
Width is measured from bottom to top. I choose 5000 height with the assumption that this door can't be jumped over.

OTOH offset for this door doesn't have to be the same as that. I choose 90 250 cause it's placed at the center of the door and it allows setting bbox properly :)
So the bbox has to be correct in order for this platform to work as intended?

No. Proper offset for platform is needed for the platform to work.
 
Well, I was going to ask you where you got that script from :rolleyes:.



Platform and wall have same way of declaration. Both are easier to measure from bottom corner of the wall/platform. 160 285 is the coords of the bottom corner of the door sprite you've posted above.


First you need to imagine the platform or wall as trapezoid. Then find the coords of bottom corner in image editor or something. If they are 2 corners, choose the bottom left one.
From there you can measure relative distance of the top corners. The right corners for this door are placed way to the right in my imagination. That's why the distance to those corners are 100 pixels.
Width is measured from bottom to top. I choose 5000 height with the assumption that this door can't be jumped over.

OTOH offset for this door doesn't have to be the same as that. I choose 90 250 cause it's placed at the center of the door and it allows setting bbox properly :)


No. Proper offset for platform is needed for the platform to work.
I got the script from FF LNS. I am modifying it to double the resolution and adding my own characters, stages, and other things to it. I had to change alot of stuff in the game and it took me months to do so, and I am still not finished with it. I am using this game to learn about the OpenBor. I have noticed alot of scripts and stuff were copycat from this forum. I know that you guys don't support FF LNS project, and I respect that. I've tried to avoid asking questions regarding to FF LNS as much as I can. I very like OPenbor system as there are many things that I can do with it. of course, I have to learn it one by one first.
I've read the manual, but I can't understand alot of stuff on the manual. The manual is good, it is just lack of examples. I am more like a hands-on person, so I have to work on it to learn.
I read the manual about the wall and platform, but I still didn't get it :-(
I've tried to follow your instructions, but my values came out way off compared to yours, especially the -136 -10 100 100.
When you have time, can you please draw it? I really appreciate it.
Do you know if there is a tutorial video about Wall/Platform?

Thank you very much for your time and your help.
 
I've tried to follow your instructions, but my values came out way off compared to yours, especially the -136 -10 100 100.

The only image I have to help you is the one from manual in attachment below.

In your door sprite above, I picked bottom right corner of the door as the offset. The coords is 160 285. From there I measure distance to top left corner and by only taking the x value it is 126 pixels to the left. Therefore you can fill the first four parameters of platform command like this:
platform 160 285 -126 0 ...
The right corners are offscreen from the sprite but I highly assume that the door will be placed on right end of level, therefore I picked 100 pixels just to make the door thick enough. You could set higher value if you want ;).
As to why I set -136 -10 instead, that's because entities are touched platform by their offset but not visually with their body. So if they walk toward platforms/walls, they might look they are walking inside the platform/wall before the latter blocks them.
Therefore if their visual body width is say 20 pixels, you need to add extra 10 pixel to block them visually. So -126 0 minus 10 = -136 -10. You could increase this further if you need ;).
 

Attachments

  • Wall_tutorial2.png
    Wall_tutorial2.png
    14.9 KB · Views: 7
The only image I have to help you is the one from manual in attachment below.

In your door sprite above, I picked bottom right corner of the door as the offset. The coords is 160 285. From there I measure distance to top left corner and by only taking the x value it is 126 pixels to the left. Therefore you can fill the first four parameters of platform command like this:

The right corners are offscreen from the sprite but I highly assume that the door will be placed on right end of level, therefore I picked 100 pixels just to make the door thick enough. You could set higher value if you want ;).
As to why I set -136 -10 instead, that's because entities are touched platform by their offset but not visually with their body. So if they walk toward platforms/walls, they might look they are walking inside the platform/wall before the latter blocks them.
Therefore if their visual body width is say 20 pixels, you need to add extra 10 pixel to block them visually. So -126 0 minus 10 = -136 -10. You could increase this further if you need ;).
Awesome explanation.
If I understood your explanation correctly, it would be similar to the drawing I just drew. Please see the picture.

I've tried to follow your steps to create a platform for the trashcan, but it didn't work....there wasn't any platform at or closeby the trashcan in the game. I know the angel of this trashcan is different than the door but still the platform is at least closed by it. Please advise, thank you.
Please see the code and the trashcan picture, thank you

Code:
name        Trash
health    1
height 110
type        obstacle
#shadow    0
gfxshadow 1 3
noquake      1
nolife      0
flash        empty
noatflash    1
subject_to_wall 1


nodieblink    2
diesound     data/sounds/trash.wav

palette        data/chars/misc/items/trash01.gif #1

icon        data/chars/misc/items/eicontrash.gif 1
icondie     data/chars/misc/items/eicondtrash.gif 1



anim    death
    jumpframe    0 3.3 -0.5
    loop    0
    delay    2
    offset    40 106
    frame    data/chars/misc/items/trash02.gif
    frame    data/chars/misc/empty.gif
    ....
        
anim    idle
    loop    1
    delay    1000
    offset    40 106
    bbox    0 0 81 105
    platform 81 93 -90 -10 81 81 81 110
    frame    data/chars/misc/items/trash01.gif
 

Attachments

  • 20220815_113123.jpg
    20220815_113123.jpg
    467.9 KB · Views: 6
  • trash01.gif
    trash01.gif
    2.3 KB · Views: 8
Hmmm... I can't make out your drawing there :(.
I'm adding lines to the trash image you've posted above to show your how I did it.
anim idle
loop 1
delay 1000
offset 42 100
bbox 0 0 81 105
platform 14 108 -25 -10 85 70 15 85
frame data/chars/misc/items/trash01.gif

A difference with door before is there are two corners here so I chose the bottom left one. Also with second bottom corner, 5th and 6th parameter must be measured not assumed. 7th parameter is the width of the trash bin which is measured from distance between top red line to bottom red line. 8th parameter is the height of bin which is shown by green line.

HTH
 

Attachments

  • trashE.png
    trashE.png
    2 KB · Views: 8
Hmmm... I can't make out your drawing there :(.
I'm adding lines to the trash image you've posted above to show your how I did it.


A difference with door before is there are two corners here so I chose the bottom left one. Also with second bottom corner, 5th and 6th parameter must be measured not assumed. 7th parameter is the width of the trash bin which is measured from distance between top red line to bottom red line. 8th parameter is the height of bin which is shown by green line.

HTH
This worked.
I understood how you got your values for the trashcan based on your steps, but when I tried to do it by myself for the tires, it did not work properly. This time, the platform is right behind the tires....
Whatever values you come up, it works.
When I try to do it myself, it doesn't work properly. This is frustrating and I hate to bother you over and over.
I'll just play with the values and hopefully, I'll figure it out.
I really appreciate for all your help and kind. God bless you all!
 
The only image I have to help you is the one from manual in attachment below.

In your door sprite above, I picked bottom right corner of the door as the offset. The coords is 160 285. From there I measure distance to top left corner and by only taking the x value it is 126 pixels to the left. Therefore you can fill the first four parameters of platform command like this:

The right corners are offscreen from the sprite but I highly assume that the door will be placed on right end of level, therefore I picked 100 pixels just to make the door thick enough. You could set higher value if you want ;).
As to why I set -136 -10 instead, that's because entities are touched platform by their offset but not visually with their body. So if they walk toward platforms/walls, they might look they are walking inside the platform/wall before the latter blocks them.
Therefore if their visual body width is say 20 pixels, you need to add extra 10 pixel to block them visually. So -126 0 minus 10 = -136 -10. You could increase this further if you need ;).
Hello buddy, can you please help me with this? I have not had a chance to work more on platforms / walls since I asked this question.
Now I am creating my own game and trying to create a level.
I am trying to build a wall, and it is haunting me again :-(

I've tried to follow the manual, and
I can create these platforms/walls:
1752931973560.png

Right now I have the wall like this which is not good because the enemy is blocked by the air!
If I make the lower, they seem to walk in the air...
1752932069846.png

I can't seem to get my head around to create this:
1752932027219.png

Can you or someone please give me some advice?
Thank you so much
 
basemap is used for walking on slopes. Like Bloodbane, I use 2 basemaps and one wall, and that's what I did with one of the old projects back in the day.

Right now I have the wall like this which is not good because the enemy is blocked by the air!
If I make the lower, they seem to walk in the air...
Because you set its height too high. The depth looks short, but I don't know about your take.

wall {xpos} {zpos} {upperleft} {lowerleft} {upperright} {lowerright} {depth} {alt} {type}

wall 50 100 -100 0 100 50 9 34
 
Back
Top Bottom