R0J0hound's Recent Forum Activity

  • inkfalcon

    Nope.

  • That curve is an arc. You could do it with:

    Repeat 10 times

    — set a to lerp(90,270, loopindex/10)

    — create point at centerx + radius*cos(a), centery+radius*sin(a)

    Or do the curve with multiple curves.

  • Im only focusing on doing an editor via as modular as possible events. Basically a small amount of objects to do the interface, a chunk of events using those objects (this is the guts that doesn’t need to be understood), and lastly simple events to tie in with project specific stuff.

    I’m unable to comment on the viability of other ideas such as doing it from a plugin or actually changing the construct editor.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Being able to draw paths for objects to follow would be cool. It’s the ultimate in “no programming required” to get things to move about. I’ve lost interest in making feature requests though. I’m more a try to make it myself now sort of guy, since I’m not very patient.

    The existing solutions of using sprites to mark the path can look messy pretty quick. That’s kind of a creative use. My thought is there’s always the in game editor solution. Then you could do whatever you want once you get past the boilerplate stuff.

    All the paths and vector shapes are just data and you can already do rendering of them utilizing sprites or the canvas plugin. It’s lower level than just throwing a svg at it but filled polygons will get you mostly there.

    The hard part is getting it to work with constructs collision system. Probably by utilizing a bunch of hidden sprites. Or you could make your own independent collision system. Decisions decisions.

  • I'd just use a variable. For example you could call it "hidden". Here's a possible implementation. You could use a boolean instead as well. You can also reduce it to just two events if need be.

    On key pressed

    -- sprite: set hidden to 1-self.hidden

    Sprite: hidden = 0

    -- set opacity to self.opacity - 50*dt

    Sprite: hidden = 1

    -- set opacity to self.opacity + 50*dt

  • Switch a and b in the formula. I made a mistake writing it down.

  • Global number a=0

    Global number b=0

    Function “n”

    — set a to min(function.param(0), function.param(1))

    — set b to max(function.param(0), function.param(1))

    — set return value to a+10-(5-b)*(6-b)/2

    For the same range of numbers you have at least.

  • You could just build a text string and evaluate it with the browser plugin

    Set result to browser.execjs(“2+5/3”)

    Or you could make your own parser to interpret an equation. One possible example here:

    construct.net/en/forum/construct-2/your-construct-2-creations-23/r0j0s-experiments-69314

    You could do something simpler though since you already have the numbers and operators separate.

  • I think what was mentioned was modular events. They had feature poll back in the day mentioning it, and more recently there was a blog post mentioning is as an idea. Using that to make plugins was also thrown around. I don’t think any of this is fleshed out though.

    Most plugins that interface with some third party JavaScript library would probably not benefit from it.

    You can already do somewhat modular events now but it’s very tied in to the project usually.

    If it ever becomes a thing I think it won’t be soon.

  • It’s only 4 ifs. You could get or make a plugin that runs some text as an expression, but that’s probably overkill. You could use the conditional expression to pack the ifs together to do everything in one event.

    Global number a=0

    Global text op=""

    Global number b=0

    Global number result=0

    Every 1 seconds

    — set a to int(random(100))

    — set op to mid("+-*/", int(random(4)), 1)

    — set b to int(random(100))

    — set result to 0

    — set result to (op="+")?a+b:result

    — set result to (op="-")?a-b:result

    — set result to (op="*")?a*b:result

    — set result to (op="/")?a/b:result

    — set text to a&op&b&"="&result

  • Offhand you can do the math directly to map x from a,b to c,d.

    X = c+(d-c)*(X-a)/(b-a)

    Or if you want to use some built in expressions you could do this.

    X = lerp(c, d, unlerp(a, b, x))

R0J0hound's avatar

R0J0hound

Member since 15 Jun, 2009

Twitter
R0J0hound has 156 followers

Connect with R0J0hound