OddConfection's Recent Forum Activity

  • > ankas

    > It's your Mouse: Cursor is over events, they are a collision of sorts.

    >

    >

    I found that this is different. When I hover the mouse over the text, 'Poly checks' started to increase, while 'collision checks' remains at 600/sec.

    The collision check won't change just by putting your mouse over the text, the events creating the collisions are still running!

    Poly checks increased when you mouse over because it first does a bounding box check (which is now true) then compares against the objects collision polygon.

  • Try Construct 3

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

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

    It's your Mouse: Cursor is over events, they are a collision of sorts.

    You can check this by disabling them.

    You have 2 per menu item, which is why there are 10 checks per tick.

    You can reduce the number of collision checks by using Else, but I'm not sure it's worth it unless you're planning on adding a huge amount of objects and events to the menu and need to eek out every last ounce of performance (which this wouldn't improve much, if at all)

  • well, it looks I can do that, but the else is still saying (not valid here)

    I've just tried adding an Else event following the System-Is value type event, and that works, so not sure where you're putting your else to get that error.

    If you can't get the else to work, do another event with the same condition, but invert it (right-click, select Invert).

  • RealityMasque

    Just remembered something that works with boolean instance variables is the expression Object.BooleanVar ? "true" : "false"

    I wonder if that would work for the comparison here

    e.g.

    System-Compare two values: returnPage ? "notNull" : "null" = "null"

    EDIT: Had a quick look in the Editor, there is a System-Is value type condition, which you could use to see if returnPage is a string

  • RealityMasque

    Is that null as in no value or an empty string?

    If it's an empty string, doing System-Compare two values: returnPage = "" should do it.

    Otherwise, not sure if this will work, but maybe System-Compare two values: "" & returnPage = ""

  • Congrats2u

    Usual method for doing things where you need to pick two of the same type is to add a Family with just that object type in it.

    For example, if you have an object type called Player, create a family called Family_Player with Player as a member.

    So, your event could maybe be something like this:

    Player is on screen (inverted)
    Pick Family_Player where Family_Player.X > Player.X
    	-> Set Player.X to Family_Player.X - Player.Width
    [/code:2rq06c5u]
  • Is it possible to group a bunch of objects together? So say you have a load of different types of bullets, you make them in a group called bullets, then if any bullets touch enemy, destroy bullet? Rather than implement it for each individual one?

    Isn't that just Families?

    I'm guessing it's not available in the free/beta version of C3, just like it's not in the free version of C2.

    I suppose you could put the bullets into a single object, just as different animations, and do damage based on animation name. That would allow you to destroy the bullet in the same collision event that damages the enemy. You'd just have to set the right animation and other bullet properties when the bullet is created.

    Bullet on collision with Enemy
    	-> Enemy subtract Bullet.AnimationName = "BigBullet" ? 2 : 1 from HP
    	-> Bullet Destroy[/code:27n8w8dp]
  • Herks

    You could try setting Bullet bounce off solids to No, create a Family (call it Bouncy Solids) for solids you do want to bounce off and add an event: Bullet on collision with Bouncy Solids -> Bullet bounce off object (Bouncy Solids)

  • OddConfection is correct, but an easier way is to use Replace

    Damn, I should have thought of that.

    Just tested with this:

    Text -> Set text to replace(EXAMPLE,"/n",newline)

    Definitely the easier way to go.

  • Is there a way to add a new line in a string variable while setting the string's text?

    ...

    Is there a way to solve this without using an event or text properties?

    I don't think you can do it just with text within the variable, you'll need some sort of Event to handle it. You're adding the variable to the Text object using an Event at some point anyway, so it's just a matter of changing your Event.

    I've created an example capx (r233) using a for loop with tokencount and tokenat to add in newline where needed.

  • Radulepy

    Try using int(LocalStorage.ItemValue) when setting a variable after retrieving a value from LocalStorage

  • ...

    The host recieves the angle but assumes that the player was standing at a different position (due movement of the player while shooting)

    ...

    Is there a way to *sync* the angle together with the actual mouse click sync so the host recieves both data at the same time?

    Don't Sync clicks/input, use the On Click event to do a Send Message to the Host, with an encoded string or JSON data containing both clickType and Angle, so both arrive at the same time. You can include player position as well in that for verification/adjustment.

OddConfection's avatar

OddConfection

Member since 26 Jun, 2012

None one is following OddConfection yet!

Trophy Case

  • 12-Year Club
  • Coach One of your tutorials has over 1,000 readers
  • Email Verified

Progress

14/44
How to earn trophies