OpenBoR Tips & Tricks

So are you using scrollx for direction leftright level?
Yes, I am.

Uhh... I don't understand why you would do that.
I realized that it's not necessary to use script for the leftright level, so disregard that.

You can examine this example regarding the leftright level here. I did several changes to correct with scrollx in some places. The scrolling is messed up in one or a few parts.
 

Attachments

Generic Portal
I still have draft for these but I don't feel like about splitting into single threads so I just post them here.

Generic Portal

ContraP.png


Intro: Generic Portal is advanced version of Alternate Portal above. They work exactly the same. The only difference is that Generic Portal allows modder to set different branch in level texts without making another portal.
This tutorial will describe how to modify alternate portal to make generic portal.
Procedure: 1st, here's example of alternate portal:


Now modify it into this:


As you can see, the script in FOLLOW1 is changed while the rest remains the same. What this script do is acquire this portal's alias then in 2nd frame, jumps to branch with that alias.
See above picture. This is example of how to set it in a level:



With this, you only need one portal entity to set 6 branches. Efficient, don't you think? :)

Limitation: The issue is exactly same as alternate portal's so I only mention its limitation. The most obvious limitation is that generic portal uses specific image (or nothing if you use blank image) and specific portal size. So it's recommended to set generic image and size so the portal can be used almost anywhere.
Hello, I need to understand something about generic portals.
Let's say portals T1, T2, and T3 lead to the left screen, connected to T1L, T2L, and T3L.
Jumptobranch will teleport to the level's spawn point, not the portal's spawn point, right?
How do I connect T1 to T1L and land at the exact specific spawn point?
 
Jumptobranch will teleport to the level's spawn point, not the portal's spawn point, right?
Yes, that's right. It's made for level select in which player only enters certain level and not going to specific coordinates in the next level.

How do I connect T1 to T1L and land at the exact specific spawn point?

You might need to use updated portal which specifies destined coords in the next level. The script in the next level will do the player positioning later.
Let me search my games to see if I've coded something like that :) .
 
@kimono I use this code and it works. But after you use branchs over and over, it starts to fail - it returns a null point and the engine closes.
I am still figuring out what happens, because something clear the value down the road.
Looks to be something related to "end" after a branch.

edit: btw I am sure about it as I have a log debug especific for that case and it returns null.
 
Thank you both. It would make more sense if, for example, the player is on a platform, they would stay at the same height on the next screen.

This could allow for more logical spawn points: if I exit to the right of screen 1 to end up on the left of screen 2, when I go back, I should find myself teleported to the right edge of screen 1 and not to the initial starting point.
 
Thank you both. It would make more sense if, for example, the player is on a platform, they would stay at the same height on the next screen.

This could allow for more logical spawn points: if I exit to the right of screen 1 to end up on the left of screen 2, when I go back, I should find myself teleported to the right edge of screen 1 and not to the initial starting point.
That is doable. You can store the branch name inside the player as an entityvar and, on the next stage, you check this variable and change your position based on it.
or on a globalvar, which is the method used on BB's safe spawn trick.
 
Thank you both. It would make more sense if, for example, the player is on a platform, they would stay at the same height on the next screen.

This could allow for more logical spawn points: if I exit to the right of screen 1 to end up on the left of screen 2, when I go back, I should find myself teleported to the right edge of screen 1 and not to the initial starting point.

I've checked my games collection and recalled that The House has such portal which is named Exit. You should get the demo if you haven't to see the exit entity. But the gist is this : Exit will store destination coords in 2 global variables (one for x and the other for z) when a player touches the exit before jumping to destined level. In destined level, level script will acquire those coords and put each player at those coords.

That's for 3D. For 2D, the idea is the same but the stored values are x and y. You should play Ruins of the Deep to see how it works.
 
Thanks, Bloodbane, for reminding me of these marvelous tech demos, and The House v2 is just what I needed ;) .
It's really nice to share this knowledge with other developers on OpenBoard once again.
I'll try to contribute in my own way soon.
 
Back
Top Bottom