OddConfection's Forum Posts

  • > 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.

  • 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]
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

  • Everade

    Yeah, I'm not saying give the peer full control, just let them do relatively trivial things like append an angle when they send the keystroke/command to shoot, to improve responsiveness for the peer.

    You can add in a check on the host side to make sure it's a valid angle, and if it's not then the Host can either ignore the shot completely or generate a new valid angle.

    Is your Host a non-player? Because if they are a player and you're worried about a peer cheating by sending an angle, what do you think the host player could get away with?

  • [quote:3rsaengk]To prevent that my goal is to directly display the shot (only display, not doing anything further since the host will detect actual hits later on), but it shall display the actual correct angle and distance the same as the host will calculate it.

    The peer still has to tell the host they have shot, correct? So, why not get them to calculate the angle and send that to the host at the same time? There's no need for the host to do all the calculation.

    That way the peer doesn't have to wait for a reply, they can show the shot straight away, and then they only have to wait for the result.

    The host can still broadcast for the other peers to fake the shot, but the delay for them isn't important since they aren't the ones who shot.

  • > enhance.fgl.com use this service to easily put ADs in your apk.

    >

    Looks good.

    What's the catch?

    I was curious about that too.

    If you let them manage the ads, they collect all add revenue and decide what portion to give to you.

    7.0 FEES, PAYMENT & EXPENSES

    Unless otherwise agreed to in writing by the parties, the Platform is provided to you free of charge.

    If you choose to manage services - such as ads - yourself, FGL will not take any revenue share from the developer or publisher Net.

    If you choose to use FGL's Fully Managed Ad System, EnhanceAdsâ„¢, all revenue from ads trafficked through will be collected by FGL and a portion of these revenues will be paid to you on a variable basis, as determined by us in our sole and absolute discretion.

    https://enhance.fgl.com/about/terms-of-service