lionz's Forum Posts

  • You need to pick the block that was picked up. At the moment the throw logic on 2nd event applies to all blocks so a condition is needed on the left to pick that one block. I would use an instance variable on the block so set a value on the one you are throwing in the 1st event, so you can pick it in the second event. You could use 'is pinned' but I prefer a variable like 'isHeld=yes'

  • Ah ok, sorry then I think that's not possible for css. I would try the text object instead if you want to colour part of the text.

  • Set text to : replace(Self.Text,"hi","[color=Orange]Hello![/color]")

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can use set text to replace() and inside, the replacement text can include the BBcode [color=red]text[/color] for example.

  • 1. 'is dragging' set object size scale higher, when not 'is dragging' (inverted) set object size scale to normal or 1.0

    2. use invisible sprites as the slots and set position to nearest when dropped, or have one character sprite and its image points and set position to image point

    3. you can store the initial positions of the objects as instance variable on the object, if you 'drop' an object and it is overlapping another (space is occupied) then you can set its position back to the initial x,y from instance variables

  • C2 is kind of ancient now and there are plugins that block from opening this capx. What problem are you having with inventories ?

  • Not sure if helpful but I have a medium sized game now and hardly use function in function, I prefer to call the function then wait for a signal from that function and run the next one, in this way you have all of the function calls in an action block and can easily see the flow. If I must use function within function then inside that function will be waiting for a signal from the embedded one.

  • Sometimes the order of picking matters so on event 4 the 'not full' condition needs to be first rather than just pick the lowest slot first, so swap those two conditions. The other issue is with the create action, you need to bring that down to even 4 so it creates it on the picked inventory slot.

  • main problem is you are clicking on a fruit then creating the same object. I would use a separate inventory icon object to create so you can see what's going on. Most problems should go away after this because you will now pick the fruit you clicked on to grab the animation name and create the inventory icon instead.

  • Nice! Yes I get what you mean, it is easy to think that it would just pick one condition but it actually runs lower down conditions if they become true before it gets there (in the same tick) so Else is important if you want an if/else type logic.

  • I'm saying for example when you collide and the shell is not moving you set it to moving, which makes the condition directly below true 'not not moving', whereas with an Else above each condition it would only run one of them.

    1. why is the player set to bounce when the shell is moving, that's what you intended? or is that a typo? Or if the player is not bouncing as you say, when is he meant to bounce?

    2. not sure on the direction as this is only set in one place and looks ok but maybe the else can tidy it up, or maybe it is a bug like when the shell goes to move state and moves past the player then it triggers the collision event again so this is why I say adding logging is good too!

  • without going too deep into it until we make some tweaks I think the main thing you are missing is an 'Else'. When you jump on the shell I think you want to do a one time check of what the state is at that point but based on your events if something else makes the status change as it is running that event you can end up with running more than one condition, so for the 4 state conditions under 'on collision with shell hitbox' you should add an Else at the top of the conditions that are meant to be an if/else type of logic so it only runs the one condition.

    When that is done, you can start to tidy up any other logic that interferes from the other events. Also adding Browser Log I find useful for debugging to check what is being run and in what order.

  • - for the family you just add 'card' to a family on its own. Because you won't be able to use 'card overlaps with card' or something like this, you can use one card as 'card' in the comparison, and use the other card as 'family' in the comparison, this allows you to distinguish card A and card B separately for whatever you need.

    - if you are having trouble with the picking it would be better to see something visual for how the game works, if something like 'on card clicked' is not enough to pick out the card.

    - for the final part you mentioned, it should be resolved by using the above card vs family - if card.variable=family.variable, where card is card A and family is card B.

  • I still can't get it to work. I thought I could change the direction platform behavior objects fell and that would make lining up/setting the cards easier, but I couldn't find how.

    Using instance variables didn't really make it work. I tried using frame tags too. I am not sure how R0J0hound recommended. The problem right now is that I can't figuere out how to make it so that cards that have the same variable/frametag/are-in-same-animation-and-frame to interact the way I need them to without interacting with every version of that object.

    In general it is to do with picking, you narrow the picked instances with a condition such as 'on object clicked' or 'variable=n', otherwise it picks all instances. In terms of merging, because it is difficult to pick card vs card that's why the suggestion comes above from Rojo about using card vs family to specify object A against object B.

  • why would you change colour of the text on an object you are immediately destroying? how do you know it destroys it 'at the end of the loop' if it is running every tick, it would just look the same no?