SwatHound's Forum Posts

  • I want to spawn a few objects, lets say 3, on a certain location.

    I then want these objects to slowly give each other space between them.

    I tried using "if object is overlapping object, set object X to old.X, Object Y to old.Y, but this just made them never overlap and they just jut away.

    I understand I want to somehow make them move away at 1 pixel or so, and away from each other, I just don't understand how I would input this into an action.

    I can use "move at angle" , but I don't know what I would input to express "Away from overlapping object"

    I think I need to use Pick Nth instance on if overlapping, but how do I write sprite.x, sprite.y, - sprite,x, sprite.y if they are the same sprite?

    is there something like (sprite.x, sprite.y)Nth 1 - (sprite.x, sprite.y)Nth 2 ?

  • Ah, alright, thanks.

    I was worried I was going insane sifting through all of the events wondering why I could find one for every other behavior except destroy.

  • Is this possible?

    On start of layout, I want all objects outside of layout destroyed (Done by destroy outside of layout behavior)

    After that, I want them to no longer be destroyed outside of layout. (I have an object that connects to the mouse, so if the player reaches the outside of the layout it destroys the object)

    I think I should probably just have "on start of layout, destroy x,y,z, etc" But I was just curious if it was possible for events to disable/remove behaviors from entire families.

    Edit: I fixed the issue with the mouse object being destroyed by setting it bound to layout, so it's never destroyed by exiting. - Still wondering if the above is possible though!

  • You lost me, GideonG D:

    'with an instance variable set as a string' ....

    Uhm.. Haha whats a string xD. Looked it up, found no definition for solely string, just a lot of other definitions using it!

    Edit: Nevermind, found it under expressions, was looking under system expressions -

    'Text is also known as strings in programming, and Construct 2 also sometimes uses this naming convention.

    Text in expressions should be surrounded by double-quotes, e.g. "Hello" '

    Anyway uhh. Thanks guys, I was kind of dumb and hastey. - All I had to do was add another condition to pick the nearest sprite. (Thanks RayKi, I couldn't find "if overlapping object" so used this instead, thanks for the idea)

    --System - On start of layout

    Sprite - Spawn text on layer x imagepoint y

    -- Sub event -- System for each sprite --

    ---------------------text - pick nearest to (sprite.x, sprite.y)

    ---Action----

    ----Set text to sprite.units

    I still wish I could understand what you were trying to suggest Gideon D: - reading these things are hard, I think I'm more of a visual learner (images and videos, not so much text) Heehee probably why I failed math twice -- thanks again for the help guys

  • Have you tried setting another condition?

    Maybe find a way to figure out the player's IID, and use that?

    Maybe give the shotguns a variable equal to an instance variable a specific player has so that only that one shotgun will fire.

    I have not tried multiplayer so I'm not sure if that would help, but it seems that you just need to have the system hone in on what shotgun you want being fired.

    Hope I helped or gave you some ideas.

  • I'm not sure if this helps at all but,

    but do you have a dynamic ip or static ip?

    A few months ago I tried hosting some games and people could not connect to me for some reason, so I read somewhere that having a static ip and port forwarding would help with this.

    I'm not sure if this will help but, maybe you can look into it.

    Also have you tried running the game on different computers? Different host to different players connecting?

  • Thanks RayKi!

    I'll try that. I hope I can figure out how to make it spawn each units variable.

  • On start of layout, I spawn text for each object

    How do I, for each object, set the text individually?

    I can't seem to find anything relating to "for each unique IID".

    Is this something where I would need to use an array, loop, or a function? (I'm not too keen on either one of those, so I assume that might be where my problem lies)

  • Reminds me of Hammerwatch in style. the bombs feel a /little/ too loud for my taste, but I guess that might be because its 4 AM.

    The fact you made this with construct 2 is leaving me speechless.

    How many events do you have if you don't mind me asking?

    Oh, and also, would love a tutorial as I'm sure many others would :p

    Thanks for linking to Abhilash's tutorial page, I don't think I would have found it without you.

    Fun game btw!

    • - the tutorial by Abhilash2863 for those wondering
  • I hate to bump this but I must ask....

    How does Korbaach's event sheet work?

    I almost understood it for a moment, and then I feel like I took 5 steps back.

    So the layout starts, and then the system grabs all the Spawn1 objects, gives its instance variable a number = it's own IID, so they're all different.

    Then every second, the system grabs the Spawn1 object, only if the instance variable matches the global variable...

    It then proceeds to spawn the sprite, which has bullet and destroy on outside of layout - Why does the animation frame need to be set to spawn?

    And the big question is, where the system sets spawn to (Spawn+1)%5 , what is the %5 for?

    Is it because there are 5 Spawn1 Objects, so the system adds one, and then.. err.. does what with the %5?

    How does the system cycle back to 1? I'm assuming it has something to do with the %5? Then it goes 1,2, 3, 4, 5, then after 5 it resets to 1? Or in this case, what would be 0,1,2,3,4,?

  • Hey, I'm not sure if this helps you but.

    https://www.scirra.com/tutorials/308/cl ... man/page-2

    Not sure if you're using the same movement as in this tutorial, but hopefully it helps some what.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • guannstar, I think it would help people out if you posted an image describing what you want

    (Maybe a screen shot from a game that uses what you mean)

    I can't tell if you wanted an end game score screen (After the game is over and people can talk to each other, like in league of legends).

    " how do I create a multi-player group/clan stat page for my game?" <--- This is actually kind of confusing.

    Do you mean, you're game will have CLAN that players can join, and you want the stats for said team to be shown?

  • Haha thanks, LordShiva. I think I just needed to get some sleep, or I just did not want to use the "Add" expression(or is it function?) , but I guess it works.

    I was just hoping for there to be an alternative instead of Adding to it, I'm not sure why but I feel this is going to hurt me later down the line, but I guess I'll have to wait and see.

    My fear is that when the units start colliding into each other my event sheet will have a bunch of "Add to" and "Subtract from" and such, where I was hoping there was some way to have the whole value somewhere (And yes now it is in CombinedValuePlayer, thank you again for the help LittleStain and Spongehammer)

    But I was hoping more for a way to have the system to update to whatever X is without me having to "Add" or "Subtract" The value manually.

    Am I asking to much or is this something that perhaps I should have looked into Arrays for?

    Instead of System - Add Sprite.Units to CombinedValuePlayer, is there a way to make the add be... "Set to current value"? The more I talk about this the more I feel maybe this is an issue Arrays could solve.

  • I.... Thank you.. I don't know why... lol..

    I'm looking at your capx now and I'm kind of upset at why couldn't I get that.

    I'm not sure if I missed something in my capx but this seems to be working.

    Thanks a lot, appreciate it.

  • Thank you for the quick replies guys, but I'm still having some issues.

    I wan't the total count to be equal to the total value for each unit.

    I have TWO buildings, both with the same value, so lets say 10.

    I want the total value to equal 20, or atleast, I wan't to be able to count individual units and add the total up to later implement a unit CAP.

    I'm not sure if I asked the initial question funny or I'm doing something very wrong here.

    https://drive.google.com/file/d/0B-APu8 ... sp=sharing

    In this example, the text matches the numbers of the variable, but it should actually be double that (Since there are 2 blue buildings spawning units)