You are not logged in.
I working on a boss and I have small problems.
I created level and I need that player passed througth level and defeated the boss. The boss must be activated when player will approach him.
How I can get or set X/Y coordinates of the boss or other objects?
And how I can block so that the player does not go beyond the boss arena and then unlock and continue the game?
Last edited by G.E.R. (2018-05-29 07:06:37)
Offline
Offline
I'm already studying this article. It's strange that I did not see her before in Wiki. A lot of questions are really solved.
Sorry for the large number of questions.
Offline
No problems, feel free to ask
Offline
So, I have this situation.
Boss and other objects is placed on the level.
Object BOSS
<....>Object A
<....>Object B
<....>etc.
I need to specify coordinates of objects A and B depending on the position of the object BOSS. BOSS is moving ----> A and B is moving too.
How I can made it? What API-variable should I use?
Last edited by G.E.R. (2018-01-14 10:56:15)
Offline
In the API you're using, you can export data from objects using $_shared_variables (they start with a '_'). Eg: $_boss_x, $_boss_y.
Offline
I working on "Lifting Basket" object. It looks like on object from Lava Reef
Press UP button - basket go up, press DOWN button - basket go down. Basket moves on rails.
How I can determine an end of rails and stopped basket?
I wrote:
on_button_down "UP" "moveup"
<...>
state "moveup"
{
on_collision "Lift_Rail_left" "moveup1"
return_to_previous_state
}state "moveup1"
{
move 0 -200
change_state "waiting"
}
but basket leaves the railways. Is it possible to determine the end of the rail in advance?
And second question. Can I forbid character to look up and squat while the basket is moving?
Offline
but basket leaves the railways. Is it possible to determine the end of the rail in advance?
Absolutely. If your railways have fixed length, you can calculate the trajectory of the basket before it moves. If not, the logic is more complicated, but still possible (you can try using collision detectors).
And second question. Can I forbid character to look up and squat while the basket is moving?
Make an auxiliary object that handles this logic. This auxiliary object can be a child of the basket, and will only be active if the player is on the basket.
Offline
Knuckles has ability to destroy "breakable" brick when he collision with they. Can I realized it on Open Surge engine? How to give a command to destroy brick?
Offline
I don't think you can do it directly with the current API. If I recall correctly, in 0.1.4 this behavior was implemented directly into the engine. When Knuckles was dropped, so was this behavior.
One thing you can do for the time being is to turn your breakable brick into an object, and let it be breakable by touch.
Another really neat trick you can use is to use a regular breakable brick, but put a collision detector on it. When the player touches the brick, make it roll for 1 frame. Then stop the rolling. When the player is rolling, the brick is broken, so that might give you the desired behavior.
Offline
In this case, Knuckles will not have this ability. This is not important for the game.
I studied the API Reference and I want fix bugs and finalize my old projects on next weekend days. Also, I thing that I can add a bonus levels and special stage "warp" object on secret places the levels (as in the original SEGA's games), instead Bonus after BPZ-3.
I have a question: if I placed "warp object" on level (Big Ring, for example) with "push_quest ....", when player will exit from the bonus level and returned in level from "default quest", this level will loaded with all objects. Can we compel the game don't load destroyed enemies, taken rings ect?
Offline
I have a question: if I placed "warp object" on level (Big Ring, for example) with "push_quest ....", when player will exit from the bonus level and returned in level from "default quest", this level will loaded with all objects. Can we compel the game don't load destroyed enemies, taken rings ect?
No, because the scene and its state gets unloaded from the memory.
Offline
How I can give a command to turn player on right/left ?
And is it possible to specify a command so that the engine does not respond on press button?
Last edited by G.E.R. (2018-05-28 10:21:17)
Offline
Yes, to do that you have to use the input routines from the API. You can simulate buttons or even change the input map.
Offline
Kinda off-topic but I would find it super useful if we could have a megathread for "questions and answers" and/or "ideas and suggestions" for modding.
Sometimes I find myself in a situation where I have a certain small doubt, just like G.E.R. had it here, but I don't feel like it's such a big problem as to create a new topic, so having a big one just for that would be great.
Creating and Editing Sprites.
Offline
No, because the scene and its state gets unloaded from the memory.
I found a solution for this situation. Because bonus is a small room, we can place it room on the level somewhere on bottom or on right and create a script with teleportation, changing music ect. In this way, the player moves from the level to the bonus room, playing the bonus and returning on the level without unloade level. One problem - abysses will cease to work and it will need to place a technical object with "kill_player" scenario.
Offline
Nice I love the creativity of modders.
A suggestion: place the bonus on the top instead, because then you won't have camera problems when reaching an abyss. Translate your level a few pixels to the bottom if you can (use a text editor)
Offline
How I can to determine which way looks the observed character?
Offline
How I can to determine which way looks the observed character?
http://opensnc.sourceforge.net/wiki/ind … _functions
http://opensnc.sourceforge.net/wiki/ind … _at_player
Offline
I know about this command, but I don't have idea how how to apply them to player (not object). I found a non-standard output as realise scene "flying Tails + carrynd Sonic" without bugs. You see as Tails carries him friend:
but actually, he carry a child object with Sonic's animation, but not the character. At the same time, game set new animation for Sonic (the character) as magenta rectange (the empty frame). Sonic position = Tails position, but Sonic is hided. When "fake Sonic" collision with the floor, this children object destroyed and Sonic get normal animation.
I'll post this script with comments after several tests.
Offline
I ask you to help me with creation enemy:
It's a red ball with a rotated gems:
object "Badnik_TetraGem"
<...>
set_animation SD_TETRA 0
create_child ".tetragem1" 0 0change_state "enemy"
}
state "enemy"<...>
object ".tetragem1"
{
state "main"
{
set_animation SD_TETRA 1
elliptical_trajectory 26 26 0.25 0.25
.......
It need to create 4 gems on 4 sides of the red ball and rotate it. How to set the starting position of the gems?
Offline
It need to create 4 gems on 4 sides of the red ball and rotate it. How to set the starting position of the gems?
This is really easy to do in SurgeScript.
In the old API, you can use elliptical_trajectory and set the initialphase to 0, 90, 180 and 270.
http://opensnc.sourceforge.net/wiki/ind … trajectory
Offline
Should I set as -
elliptical_trajectory 26 26 0.25 0.25 0
elliptical_trajectory 26 26 0.25 0.25 90
elliptical_trajectory 26 26 0.25 0.25 180
elliptical_trajectory 26 26 0.25 0.25 270
or differently?
Offline
Each gem has a initialphase. For gem i = 0, 1, 2, 3, set
initialphase_x = initialphase_y = 90 * i
For example: for gem 0, set elliptical_trajectory 26 26 0.25 0.25 0 0.
Offline
Alexandre
I have a request to you, can you compile this source code of the project and give me the output .exe file?
https://yadi.sk/d/oihf9QO53aBR8z
Offline