MrBadAtThis's Forum Posts

  • System expressions

    > zeropad(number, digits)

    > Pad number out to a certain number of digits by adding zeroes in front of the number, then returning the result as a string. For example, zeropad(45, 5) returns the string "00045".

    >

    Perfect thanks for the help

  • So I'm trying to add a score to my game but the way I want it is to have It start at 00000000, but then when points are earned it goes to 00000100. Instead all I can seem to do is turn my score into 100 and it gets rid of all my other 0's

  • If you don't have the spawner in the conditions, any action will apply to all the spawners. I'm guessing you only have on collision with coin in your event. Try adding a system pick nearest condition.

    Perfect once again thank you =D

  • Okay next part is when I walk over the money with my player I want the money to despawn and the spawner to become active again.

    I have it set to destroy money add 100 to score and set moneyspawner.moneyspawned to 0

    But what that does is allows every single money spawner to spawn another money

    Which perplexes me because moneyspawned is an instance variable it should only affect the one he touched

  • Before your current system condition that picks a random Moneyspawner, you need an additional condition that first picks all Moneyspawners that do not have money on them. Use the condition from the Moneyspawner object rather than the system compare two values to check the instance variable. This way, the system pick random Moneyspawner will only pick from the already picked empty Moneyspawners.

    Actually I'm not sure if it will work in the same event, you might need another subevent between the every 2 seconds and pick random events.

    Edit: You dont need another subevent. From the manual - [quote:3fmknbgp]Pick random instance

    Pick a random instance from the currently picked objects. In other words, if Pick random instance follows another condition, it will pick a random instance from the instances meeting the prior condition. Otherwise it picks a random instance from all the instances.

    So order matters here. Make sure you put the Moneyspawners Is Empty condition before the system pick condition.

    Works perfect thanks for the help

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • So I have 8 spawner objects (MoneySpawner) and I want each to spawn a coin ONCE randomly.

    Once the spawner has spawned the coin I want that spawner to become deactivated until the coin is removed

    The way I have it set up now is like this

    However Watching in debug mode It will frequently pick a spawner that has money on it. It will not spawn extra money but it will cause a delay in my spawns. So It can take upwards of 10 seconds to get some of these to spawn

    How can I force it to pick an instance that doesnt have money on it?

  • Don't split up the events. Chances are you are spawning and deleting immediately. Make a sub-event for the count check.

    On click

    -> Monster.Count =0 -> spawn

    -> Else

    -> destroy

    Thank you so much its working correctly now

  • Now second part of my problem I can get things to spawn once and thats great =D But now how do I set it so If something is spawned it will instead destroy that object.

    I just tried spawner clicked and monster.count = 1 then destroy but that doesnt seem to work that stops things from spawning again

  • I don't understand the question.

    OH nevermind i think I made it more complicated in my head. The act of spawning a monster increases the count

  • "Compare two values"

    Thanks for the help and now how would I add something to that value?

  • Those are instance variables. Since there are no monsters, they can't be checked. You can use Monsters.Count to see how many exist. So, in event one, check Monsters.Count=0.

    How would I check for monsters.count? Do I chose instance variable still or do i I select something else entirely

  • I'm trying to set up an event to trigger while a monster is not on screen The way I am trying to make it work is by having a condition to spawn the monster ONLY WHEN another monster is not on screen.

    And IF there is a monster on the screen the button will instead destroy it

    I Tried several methods for making this work.

    (Method 1)

    I grouped all of my monsters into a family and gave it a Boolean for spawned. default is false

    I then have two conditions set up for one set of events (Clicking add another condition)

    First condition is that there are no monsters spawned

    Second condition is when a button is clicked

    So In my mind the way this is laid out is (If there are no monsters on screen, and the button is clicked. Spawn a monster)

    This should trigger the event to spawn any one of my monsters but it doesn't the screen just stays blank

    If I remove the Boolean condition I can spawn an infinite number of monsters but that's not what i want

    (Method 2)

    Rather than use Boolean I tried the same as above with an instance variable swapping between 1 and 0

    No luck there either

    I think I'm setting these conditions up wrong but cant think of any other way to do it

    Here's a screenshot Just in case I'm not being clear

    http://i.imgur.com/Y9NlF8U.png

  • I have image points on my object but they still follow this odd behavior

  • I have a blue box spawning objects just outside my layout and its on a layer with 0, 0 paralax however when using debug mode i noticed my spawner object does not move but where the objects are being spawned move.

    So at the very beginning it will spawn on the spawners origin point no problem. After moving around though the objects spawned will be in a different location than the spawner entirely. I'ts like a ghost version of my spawner is moving while the actual spawner is not. How could I go about fixing this

  • On my endless jumper game I have platforms shrink as the player gets to certain heights, I would like only off screen platforms to shrink however. I tried minscroll <-5000 with a sub event to pick platforms off the top of the screen but that doesn't seem to work.