Daiz's Recent Forum Activity

  • Here's one approach:

    1. First, you just set a value (global, anything) to random(100).

    2. Then you just do lots of events like this:

    Is value between 0 and 56 (System expression) -> Jump to layout X

    Is value between 57 and 57 -> Jump to layout Y

    Is value between 58 and 99 -> Jump to layout Z

    Of course there's multiple other ways to achieve this and you could even do some sort of loop to check things via private variables making it more easily customizable.

  • You know, there's another idea that I think tossed around in the chat a while ago...

    Make the expression editboxes multiline-togglable. I noticed that if you write the expression on multiple lines in say Notepad and paste it to the expression editor it doesn't destroy the multi-lining and it even shows up in the event sheet editor.

    So that instead of having just

    clamp(3*distance( mousexy, xy),0,100)

    you could have:

    clamp(

    3*distance( mousexy, xy),

    0,

    100

    )

    Of course for such a simple sentence it doesn't do much but for me it helped writing some more complex stuff.

    Another thing that would be useful is syntax highlighting. And one thing specifically - when your text cursor is over a bracket, ( or ), it will highlight the equivalent start/end bracket. This is what editors like Notepad++ do by default and it helps so ridiculously much it should seriously be implemented in everything. Especially in Construct, since you can easily write expressions that end up looking like lisp (with (all (the (goddamn (brackets))))).

  • Well, create and families seem to work quite fine for my intended purposes... though for some reason I can't get timers to work with it. The cap straight out refuses to compile. In any case, take a look at this:

    When you run it, you can see that the first bullet creates bullets to both left and right, but then only the left side creates further two bullets. The right side should also create two more bullets and destroy afterwards, but right now it only destroys.

    Any ideas on how to solve this?

  • Another example upload for the same thread.

  • Try this:

    [snip]

    By using the System object to create new instances at the bullet's location you're interrupting the normal picking. The original bullet continues to sail onward, and spawns four bullets before fading out. Is that the result you were going for?

    The problem with the approach in your image is that if I do that there's no way to set things relative to the original bullet without using something like globals. Let's say I want the bullet to spawn at [original spawner angle]-90. With the spawn function, the new object would start with the angle of the original spawner, so I could just use .angle-90 for the new bullet, but if I were to use the create object (and not use "relative to another object") I would first have to store the original angle in a global before creating the new bullet, and then set the angle as global('spawnangle')-90.

    This isn't exactly what I'd want, because it'd complicate the bullet spawning code a lot, especially if I want to set other things besides just the angle relative to the original spawner object. And since I'm going for a bullet hell game, I'm going to have to do lots and lots of different kind of bullet spawns, and even some seemingly minor increase in the code required to create a spawn, the workload could increase very notably.

    I thought about using families as well, but they'd also introduce another layer of "things to worry about" when coding bullet patterns and it could slow things down quite a bit.

    In either case, you said it yourself:

    [quote:j8dkt3jk]However, you already have a specific instance of that object picked in the condition, so it appears the selected object list is getting confused as to which instance you mean to perform actions on.

    I would say that this is a bug, since in my opinion after spawning an object all actions in the same event should be performed on the new object afterwards.

  • So I'm posting this here since I'm not sure if this is intended behavior or not, though I bet it is not.

    See example cap here:

    Basically the problem is that spawning the same object doesn't seem to be working right. I have three behaviors for the bullet object, Bullet, Fade and Timer. I want the Bullet to spawn copies of itself, but it seems that when I perform Spawn "Sprite" on "Sprite", not only a new object gets created, but the original spawner object seems to reset/respawn itself too. The fade timer starts counting from zero, the timer gets disabled, etc. There are other tries at solving the problem in other layouts, all of which fail. I've tried working around the problem by using a value for a timer instead of the timer behavior, removing the fade behavior, using ball behavior instead of bullet behavior, using create object (with both relative to another object and just spawning at Sprite.X & Sprite.Y)... everything seems to fail.

    I don't really want to have multiple sprites for similar objects because it'd make the code a whole lot complicated for no good reason, and spawning copies of itself and setting new properties for them is quite a vital thing, especially for the bullet hell game I'm working on. It just isn't a bullet hell unless there's bullets shooting bullets shooting bullets.

    So is spawning/creating duplicates simply broken or am I just missing something?

  • An upload for this thread in Help & Support:

  • It should be layer based unless you enable Z layering in layer properties, I think.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Meshes can be kinda hard to grasp for people new to making games or unfamiliar with 3D... and the ways of rotation you can do with them is kinda limited by default means. They're most easy to use with topdown 3D stuff (or completely sidescrolling stuff) - anything beyond that requires a lot more thought and math to pull off. I was thinking about using meshes for my danmaku thing but ditched the idea for now since I couldn't be arsed to think about the math involved with moving stuff through the screen properly.

    EDIT: The mesh editor itself is simple to use and easy to grasp, and so is loading meshes at runtime. Doing UV distortion stuff via the events is where things get a bit more complex, and that's what is required to pull off basically all the 3D stuff people have been asking about.

  • You have to create the heightmap via some means anyway, so you could just write a simple construct app for yourself that makes meshes based on heightmaps and then saves them so that they can be loaded at runtime.

  • Couldn't you just create a mesh out of the heightmap and be done with it?

  • I don't have the code at hand right now (posting from a library), but it just basically creates a bamboo object at the back of the screen at either left or right with some X&Y variation, animation frame variation and filter variation. Then according to the levelspeed global the bamboos are simply moved down slightly diagonally and their width and height is scaled accordingly to make them look more convincing. It looks neat enough in motion.

Daiz's avatar

Daiz

Member since 9 Oct, 2008

None one is following Daiz yet!

Connect with Daiz

Trophy Case

  • 16-Year Club

Progress

16/44
How to earn trophies