nimos100's Recent Forum Activity

  • This is tricky to work around - if you type on the comment box on this page, you can still select its text sometimes by dragging from outside the textbox. It even seems to focus the control sometimes, even though the click started outside the control. This kind of browser-default behavior is tricky to correctly disable: if you just say "disable mouse moves", then you can't select text at all inside the control, but trying to define how to say "disable when the click did not originate from this control" requires app-wide pointer tracking with support for mouse, touch and pointer events for cross-browser support, and co-operation between different plugins that need this kind of feature. So it's actually pretty complicated.

    I think it's a fairly minor issue that is easy to workaround with that event, but I'll leave the report open in case future refactoring of the runtime can resolve this.

    As you say its not the end of the world this issue and there are workarounds. But thought that if it turned out to be a simple fix, it might as well be done. But thanks anyway.

  • I've set up that item count goes up and down when you're buying/selling (i still need to set the limit so that you can't sell items that you don't have-could use some help on that too )

    If you store the amount of items the player is carrying in your player object as variables. (Item_1, Item_2, Item_3...etc) you can check against these to see whether the player have enough of them to sell. Simply but doing a Item_1 > 0.

    And you can do the same for the shop.

    [quote:3a80ffxz]The thing is, i can't for the life of me set things up so that when you buy/sell stuff, the final money value is added / substracted from your inventory. Finding out how to limit the trade so that you can't buy things you can't afford would be great too!

    This can be done the same way as above. In this case you just make a variable called "Player_money" and you add/subtract from this and again you can use this value to test vs the price of the item the player want to buy.

    Player_money >= Item_1_cost

    [quote:3a80ffxz]Also, i have some questions about randomizing prices, so help with that would be great!

    You can create random numbers using the following code:

    Random(Number)
    Random(10)   <- Will give you a random number between 0 and 10, including decimal numbers.
    
    Int(Random(Number))
    Int(Random(10))  <- Will give you a random integer between 0 and 10.
    
    Int(Random(Number) + 1)
    Int(Random(10) + 1)  <- Will give you a random integer between 1 and 10.
    [/code:3a80ffxz]
    So you can create random prices for your items like so:
    
    Item_1_cost = int(random(100) + 1)
    
    Will set the price to a random number between 1 and 100.
    
    But I might have misunderstood how your inventory works and that this is not what you meant.
  • You can avoid selecting the TexBox by simply unfocus it when you drag the sprite:

    Sprite| DragDrop is dragging -> TexBox| set unfocused.

    But the TextBox is always above the game canvas, so you will drag the sprite along behind the TextBox.

    If you want to avoid that, you have to make your own TextBox.

    That works fine, guess that is fine enough as a fix

  • I doubt this is a bug.

    As is outlined throughout the manual with regard to Form elements, they are rendered last above the canvas, so it seems logical that when moving over it, it would be top-most element and get focus.

    You might be correct. I believe the reason the form controls act the way they are is because they are web controls or what to say. But you would normally not select content of textbox in a non web control by simply dragging the mouse over it. So whether its possible to change that or whether its considered a bug im not sure of.

    But regardless of that problems does occur as you can see in my example when dragging a sprite around and suddenly form controls get focus when you would assume they wouldn't.

    So maybe its possible to add an exception or change the textbox so in order to select its content, you have to make an actually click on it to give it focus and not just by dragging the mouse over it, when the button is down. In a normal program that is not considered a mouse click, but again whether its possible or not i don't know, but think it would be a good fix to the already troublesome form controls.

  • Textbox form control

    Some of the 3rd party textbox plugins have a select all functionality, so thought it would be handy to integrate that as a standard functionality to the textbox object together with a deselect all.

    Select all - Select all text in a textbox

    Deselect all - Deselect all text in a textbox

  • Problem Description

    There seem to be a problem with textboxes and them getting focused when dragging your mouse over them, even when you are interacting with other elements.

    When you for instant drag a sprite around the screen and you happen to drag it over a textbox, it will start selecting the text inside the textbox.

    It seems broken in the sense that you would expect the program to focus on the sprite being dragged and not starting to select text inside the form controls if these doesn't have focus.

    Attach a Capx

    https://dl.dropboxusercontent.com/u/109921357/Textbox%20dragging%20bug/Textbox_dragging_bug.capx

    Description of Capx

    Just contain some textboxes and a sprite with drag/drop behaviour.

    Steps to Reproduce Bug

    Drag the sprite over the textboxes.

    Observed Result

    Expected Result

    That the focus would stay on the sprite and any mouse interaction with the textbox would be ignored. That selecting text inside a textbox would only happen if the textbox it self have first been activated by a mouse click, and that simply holding down the mouse button and dragging above them wouldn't give them focus.

    Affected Browsers

    • Chrome: (YES)
    • FireFox: (YES)
    • Internet Explorer: (YES)

    Operating System and Service Pack

    Windows 7

    Construct 2 Version ID

    r216

  • nimos100 did you report this as a bug in the bug section?

    No, Jase00 already added it.

  • Yeah I get this too. At least I'm not alone! I made a bug report a week or so ago:

    Hope this gets fixed soon

    Guess I have to go back to r216 again until this is sorted.

  • I tried installing the new NW.js Alpha 7 and when I use the chosenpath it returns "c:\fakepath\<filename>" regardless of what file is chosen through the dialog. I guess this is because the feature haven't been added in the build yet?

    Are there any information regarding when this will be added, as my program wont work unless this does?

    Cheers

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • nimos100 Actually, what you mentioned above worked for my issue. Thanks!

    [quote:2iyu6zao]

    Every tick

    For Each EnemyBox

    Pick EnemySkin.Enemybox_UID = EnemyBox.UID

    ---> Set Enemyskin.X/Y = Enemybox.X/Y

    I see, that's good

    Well this method I use a lot, its good for linking things together. For instant if a unit is killed and depending on which unit it is, something else only related to this unit should also be removed. So storing the UID of the child in the parent object works very well for something like this, when the objects are not in a container.

  • nimos100 By container, do we mean Family? Do you usually put all the hit detect and health on the enemy box and the only thing the enemy sprite does is do the visual part?

    Not sure I understand your question, I was answering the OP regarding what he was trying to get help with. But guess your question is whether I would make a "hit box" and then attached a skin to it, only for the visual part? if that's the case, then I wouldn't use that approach, at least my first thought is that there are no benefits in doing it like that, or at least I can't think of a situation where I would find this to be needed. The reason is that you will end up using more objects than necessary, which will consume primarily memory if these are sprites.

    Besides that I would store all the variables in either a family or the sprite it self and simply adjust the collision mesh if I were unhappy with it.

    But again I weren't sure what the OP was working on, so it might have been needed for him. And my comment on the container was just, that he said it worked for him. And if that were the case then I guess he was happy

  • Timer behaviour

    Adding a few extensions to this behaviour would make it more complete and easier to work with.

    Stop all - Would allow you to stop all timers running for an object, regardless of the tag.

    Pause timer - Would allow you to pause a timer using its tag.

    Pause all - Same as above but would just pause all timers regardless of tag.

    Resume timer - Would allow you to resume a paused timer using its tag.

    Resume all - Would resume all paused timers for the object.

nimos100's avatar

nimos100

Member since 23 Sep, 2012

None one is following nimos100 yet!

Trophy Case

  • 12-Year Club
  • Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • RTFM Read the fabulous manual
  • Email Verified

Progress

16/44
How to earn trophies