boolean's Recent Forum Activity

  • Ah, I figured it out. I'm only taking into account the window size, not the layout size. If I set the window to match the layout size (eg. 1280, 1024) I can see the sprite being constrained to the layout.

    As the layout is often not the same size as the window, it's important to note then that some actions like destroying a bullet once it leaves the layout does not happen once it leaves the viewport, but the actual layout itself. In the case of huge layouts with scrolling worlds, these events might take a lot longer to fire than you expect.

    I wonder how many other people this has tricked <img src="smileys/smiley1.gif" border="0" align="middle" />

    Since we don't have a Bound to Window event, I'll have to figure out another way to constrain the sprite to the viewport.

  • This might be intended behaviour, but I'm just not sure if I'm doing it right.

    I found that if I have a sprite and set the behaviour "Bound to Layout" and I create the sprite at -500/-500 on startup, the box is correctly restrained to the layout. If I also try and set the position manually it is restrained correctly. However, if I set it to Mouse.X/Mouse.Y it's possible to click near the edge of the screen and have the object poke outside the layout.

    <img src="http://i.imgur.com/OgAlm.png" border="0" />

    Is there something different with the mouse behaviour I should be taking into account, or should this be working in all cases?

  • This thread on Stack Overflow sums it up nicely. Note that it took over a hundred million operations per second for any performance hit to appear, and even then we are talking nano-seconds of a difference.

  • Can I request you don't bury this just yet? I raised some issues over in this thread that the official plugin has some shortcomings compared to this plugin. I know I'll be using this plugin for the foreseeable future <img src="smileys/smiley19.gif" border="0" align="middle">

  • It would be nice to at least have the option - I would be much less concerned about a mistyping a string while having a clean project than mistyping a number and having a messy project (ie. I can typo a parameter index from Function.Param(1) to Function.Param(11) and C2 will not warn me). I'm not suggesting you switch from one to the other, it would just be nice if it supported both like the plugin by rex. Having a prompt when using a string (like when using a layer by name) would be handy, but I don't think it's critical considering there's no prompt for parameter typos by number anyway.

    Also there are already parts of C2 that take a string as a parameter with no error checking - For example, calling a key in a dictionary.

    This is just all my opinion. I have no idea how the rest of the C2 community feels about this, so maybe they are not as fussed as I am. I'm more than happy to keep using the plugin by rex, but it would be nice to see some of those features cross over into a plugin that is supported 'in-house' as it were.

  • Having the parameters inside the function helps a little (although it adds an extra step to maintenance and adds to the growing list of variables in the expression helper), but it leaves the problem that A) It's unclear what the parameters are from the action calling the function since it only separates by comma, not name, B) the action calling the function has its variables mangled together. Compare the format of the plugin from rex to the native function call (using some completely made up code for example purposes):

    Comparison screenshot between the rex plugin and native plugin

    Now I could make these variables in the event calling the function too, but now I have 3 variables calling the action and 3 variables naming the parameters inside the function.

    You also have to hope that you never decide to replace the order of your variables - Suddenly "Function.Param(0) + Function.Param(1) / Function.Param(2)" becomes completely different when you decide you don't need parameter 1 any more - Function.Param(2) becomes Function.Param(1)and you need to refactor because the position of the parameters changed.

    I hate to complain about the awesome work you guys are doing, but it seems like right now the plugin from rex is actually more powerful and easier to use. It just seems that using numbers to define parameters as well as requiring local variables on both sides to make the code readable is probably the only thing I can think of in C2 that makes things harder than regular programming <img src="smileys/smiley1.gif" border="0" align="middle">

  • One of the best parts of the Functions plugin by rexrainbow was I could name a parameter with a string, like "BulletX" and "BulletY". With the new built in function object/event though it seems we can only access them by numbers.

    Is there no way around this? Will this maybe be updated in a future release? It's nice having this built in, but calling and setting parameters by number quickly gets out of control.

  • I'm trying to use it sparingly. I've already found if you put it inside a loop C2 loses track of the 'loopindex' variable and crashes <img src="smileys/smiley1.gif" border="0" align="middle" />

    I think there is only one or two spots I need it in, so it should be ok.

  • Ah brilliant, that fixed it. Thanks mate!

  • With the C2 bug fix a few versions back in terms of picking newly created objects, I've noticed it changed how functions work a little.

    It seems that because of the decleration of the function itself, I can never reach the top level event when I create an object.

    <img src="http://i.imgur.com/rFhmr.png" border="0">

    Based on this post by R0J0hound, I would need to hit the top level event to get access to the newly created objects, or move the pick to a sub-event. It seems though that because I can't get access to the top level event (since I'm always inside the function) that the plugin can never create and get access to an object in the same call.

    Is this correct and just a limitation of the plugin, or am I using it wrong?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi all

    Is it possible to use expressions in the Initial Value of a local variable? It would be nice to be able to say "playerOffset = player.X + 100" for example.

    I noticed that back in 2011 when Ashely first announced that local variables were supported that this was a feature in development, I'm wondering if he ever got around to completing this?

    No huge deal if it's still not supported, I'm just doing a big cleanup of my code and this would be a nice little addition.

    Cheers!

  • Wow that's really good for 4 days of work. Good job!

boolean's avatar

boolean

Member since 22 Aug, 2012

None one is following boolean yet!

Trophy Case

  • 12-Year Club
  • Email Verified

Progress

13/44
How to earn trophies