quackgyver's Forum Posts

  • + Sprite X < 500

    + OR: Sprite Y < 500

    You'd expect this to run actions with all Sprite instances picked that are left of X=500 or above Y=500. If it resets picking for every condition, it becomes essentially just "Y < 500" by itself, which will look broken again.

    I would expect this OR-condition to either pick all of the instances that are to the left of X=500, or pick all of the instances that are above Y=500. Even as we're talking about this, I struggle to think of what else it could logically do.

    Based on this thread, it sounds like what would happen is that it would pick all of the sprite instances that are to the left of X=500, while un-picking all of the sprite instances that are above Y=500. Is that what is supposed to happen?

    You could file a suggestion, but based on the problems I've shown, I don't see a better way it could work unfortunately! Then there's also backwards compatibility: we can't just change how thousands of existing projects work...

    Would it be possible to add a true OR condition? Or would that require fundamentally changing the way things work.

  • In my project I'm referencing music files by name.

    For some reason, if I move music files into subfolders in an attempt to organize them, they stop playing in-game.

    To make things stranger, this only happens for most- rather than all music files.

    My understanding is that folders are for organizing in the editor rather than for referencing, but despite that I'm able to reproduce the effect by moving music files in and out of subfolders.

    Why does putting audio files in subfolders have this effect?

  • That's a nice solution, though wouldn't it be more straight-forward to do something along the lines of:

     var OriginalMessage = "foo foo foo foo foo foo foo foo" 
     var MaxWidth = 10 
     var Index = 0 
     
     // For each word 
     foreach tokencount( OriginalMessage, " " ) 
     	Index = Index + 1 
     	CurrentWord = tokenat( OriginalMessage, Index, " ") 
     	var Line = "" 
     	var Message "" 
     
     	// The Line can fit more words
     	if ( len( Phrase ) + len( CurrentWord ) ) < MaxWidth 
     		Line = Line + CurrentWord 
     
     		// Add the last line in loop 
     		if Index == tokencount( OriginalMessage, " " ) 
     			Phrase = Phrase + newline + Line 
     
     	// Line is full, clear it 
     	else 
     		Phrase = Phrase + newline + Line 
     		Line = CurrentWord 
    

    I still think that this could somehow be expressed through a formula though. I wonder if anyone here has figured it out without looping.

  • Only idea that comes to mind is to use a tiledbackground object and use the "set face object" from the 3dshape with that.

    Yeah that's what I'm talking about. When you map an image to the face of a 3D shape, it's anchored to the same corner on every side.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Does anyone know of a good formula for word-wrapping based on an variable length limit?

    I.e. if I have String and the length limit is Foo, is there a good formula for splitting String in the right places so that it inserts line breaks where the lines would otherwise have exceeded the length limit?

    Thanks in advance.

  • When resizing a 3D shape that uses images for its faces, the face images are always anchored to the same corner on every side of the shape.

    Because of this it's impossible to tile 3D shapes seamlessly unless they're the exact size of their textures, because as soon as you reduce the size of a 3d shape it also shifts the position of its face images in ways that will often cause texture tiling issues.

    Is there any way to control the anchor/origin point for the images that are used as face images for 3D shapes?

  • Is there reason why Local_Loop_Done doesn't reset on each loop in this context?

    I thought that local variables are supposed to reset on every loop unless they're set to "Static", but in this case the local variable never seems to reset?

    In the documentation it says:

    By default, local variables reset to their initial value whenever entering their scope (usually every tick)

    Which to me sounds like it's supposed to reset the variable whenever whenever the root condition that evaluates "Script_Block_Is_Busy" and "Script_Keep_Looping" returns true.

    However instead, the variable never seems to reset as long as these root-level bools return true.

    Why is that?

    EDIT:

    I figured it out. I was expecting the variable to reset on every "For each"-loop, thinking that every such loop would count as "entering the scope" of the root event outside of the "For each"-loop.

    However, local variables won't reset inside a "For each"-loop if it was defined outside of the loop. This means that it'll only reset during ticks that take place outside of the "For each"-loop.

  • But the implication is that you want to change the animation on the ones that are carrying a torch, so since it couldn't find any then it's correct to apply to 0 instances. If you want to apply to PlayerObjects because Firefly is lit, you have to ask yourself, which PlayerObjects? Because none of them are carrying a torch.

    I don't think the implication is that I only want to affect PlayerObjects that are carrying torches, because carrying torches is only one of the two conditions for changing the PlayerObject's animation.

    If I didn't want to change the PlayerObject's animation in both cases, then I wouldn't have put it in an event with an "OR"-condition.

  • Ohh interesting, it picks 0 players due to failing the first condition, therefore doesn't change the animation?

    This is what I heard recently, yes.

    I would have guessed: after failing the first condition and 2nd condition succeeds, the SOL would have been reset when evaluating the 2nd condition, therefore changing all existing player's animation.

    Yes this is also the behavior that I would expect - i.e. I would expect an OR condition that doesn't trigger to simply fall back to allowing the picking of all of its related object types.

    Dev may weigh in on this later but he’ll probably refer to the manual, or refer to the suggestions platform or bug tracker. At this point in time the way or works probably won’t change because they are worried about keeping backwards comparability.

    This is why I think it would be great to have a "True OR"-statement, where "TOR" could be used in a way that doesn't affect the picking negatively while also allowing for backwards compatibility. :-)

  • Your observation show that it doesn’t reset the picking after each false condition. There’s probably some utility in that.

    I wouldn't say that it doesn't reset the picking. I'd say that it actively picks 0 instances of every condition that isn't triggered as part of the OR statement.

    In other words:

    IF A

    OR IF B

    OR IF C

    In the above case one object type would be picked if true, but the other two object types would also be picked but with 0 instances.

    Actually unless you have multiple instances of things using system compares is an ideal solution to avoid the picking or non picking.

    Unfortunately not every condition can easily be translated into "Compare two values", because a lot of conditions aren't available as expressions.

    Also, sometimes you need to be able to pick objects through an OR condition, such as when working with instances. There are a lot of cases where one of the OR-conditions might regard an instance of ObjectA while the other OR-condition regards every instance of ObjectB. In such a case you wouldn't necessarily want ObjectA or ObjectB to be excluded from the subsequent events.

    Imagine this scenario:

    IF PlayerObject is carrying a torch

    OR if FireflyObject is lit

    THEN change PlayerObject's animation to EyesSquinting

    In the above condition, PlayerObject would be un-selected if the FireflyObject fires true, and as a result you wouldn't be able to change PlayerObject's animation.

  • For as long as I've used Construct, I've assumed that "OR" works the same way as you'd expect an OR condition to work in any other programming language - i.e. the code runs if any of the provided conditions fire true.

    However, I learned just recently that "OR" in Construct actually functions like an AND condition, because what it apparently does is that it fires true if any of the conditions are true, but it *also* picks 0 instances of the conditions that return false.

    In other words, the following event:

    IF playerA.Something

    OR playerB.Something

    Doesn't translate into:

    Pick playerA.Something if true

    Or pick playerB.Something if true

    It actually translates into:

    Pick playerA.Something if true, and pick 0 instances of playerB

    Pick playerB.Something if true, and pick 0 instances of playerA

    To me this doesn't make sense, because it's inconsistent with how the toolkit otherwise works. All object types are always available to the user even if they weren't explicitly picked as part of an event, so why should an "OR" condition suddenly negate them from being picked just because they didn't fire? "OR" means "either 1 or 2", not "1 and no instances of 2".

    The reason why I'm bringing this up is because the way that the OR condition works prevents you from being able to utilize any object types inside of an event where those object types didn't fire as part of the event's OR conditions.

    In other words, let's say that you want to change JSON1 if JSON1.foo returns true OR if JSON2.foo returns true. Now you can't do that, because if JSON2.foo fires true then 0 instances of JSON1 are picked.

    I can't think of any use cases where Construct's way of doing "OR" is needed in order to be able to achieve effects that would otherwise be convoluted, but I can think of several use cases where Construct's way of doing "OR" makes it impossible to do certain types of events that are important to be able to do and which otherwise require complex workarounds.

    I guess my questions at this point are:

    - Has this been discussed before?

    - Is there a reason why "OR" works the way it does?

    - Has it always been like this?

    - Are there any plans for adding a "True OR" condition? I'd love to see a "TOR".

  • Could it be that it just uses the image and not the repeated version?

    No, it's definitely using the repeated version.

    Possible fix could be to use multiple smaller cubes or use a mesh distort to position the tiledbg where the face would be.

    Using multiple cubes unfortunately isn't viable due to the complexity of the level design.

    As far as I can tell, using object images for faces on 3D shapes seems to be bugged. No amount of messing around with the settings seems to have an effect.

    EDIT:

    I found out what the issue was. Apparently the setting "Z tiling factor" causes the toolkit to try to fit repetitions of the image into the Z-axis, by whichever factor that you input. For some reason it defaults to 8, which causes texture to get compressed 8 times on the Z axis. Setting it to 1 fixed the problem.

  • I'm trying to get around the fact that Construct isn't able to detect whether the player collides with any solid, so now I need to be able to determine if objects belonging to a specific family is also in the family "Blocking".

    How do I evaluate whether a family object's instance is also member of the "Blocking" family, and how do I pick that object if "Blocking" has a variable that is set?

  • Every thread that I've found that revolves around detecting collisions with any solid has suggested to use families, but that's not viable when there's a lot of complexity in terms of how solids are used.

    Is there no way to detect when an object is overlapping any solid, regardless of object type and without using families?

  • It seems that every single built-in movement behavior causes unwanted jarring effects in first person 3D mode, ranging from backwards sliding against walls to jittering to clipping through walls to speed issues.

    What are all the proper formulas for safely moving the player relative to the current direction, without these issues occurring?