nimos100's Recent Forum Activity

  • i think there is no other way but to compare it 1 by 1

    Might not

    Depends on what you are trying to achieve.

    The only reason I can see you wanting to use the | expression, is if you wanted to compare both sprites, like this:

    Sprite1.frame = 0 | Sprite1.frame = 1 = Sprite2.frame = 0 | Sprite2.frame = 1

    But in most cases I would still think using simple conditions like "Is between" and basic "Sprite1.Frame = 0" would make it easier to work with. Personally I haven't used | a lot, as I haven't really run into something where it would be extremely useful, but maybe someday

  • I tried this | "Pipe" symbol, construct 2 accepts it but when i run it, the other frames doesn't work.

    Example:

    Event:

    sprite1frame = 0

    sprite2 frame = 0 | 1 | 2 | 3 | 4 | 5

    Action:

    System go to layout 2

    On this example, only the frame 0 of sprite1 and frame 1 of sprite2 will work. The other frames seems to not work

    Its because you think the | works in a different way than it does.

    The | will return true or false depending on whether one of the Or conditions are correct.

    So it should look like this:

    If Sprite.frame = 0 | Sprite.frame = 1 | Sprite.frame = 2

    = 1

    Then it will return true and therefore condition is true as well. If Sprite.frame is not 0, 1 or 2 then it will return false.

    So its not a functionality where you can ask in the sense of whether Sprite.frame is 0,1,2.....100 and if that's that the case do something. Well you can but you have to write it as I did above and compare it to either 0,1 (False, True)

  • You could use a "is between" comparison.

  • Just use a for loop and name your loops

    For "loop1" from 1 to 12000 -> for "loop2" from 1 to 12000 -> if sprite2.animationframe = loopindex("loop1") -> if sprite1.animationframe = loopindex("loop2") -> do this

    I don't see how that would reduce the work a whole lot, but might have misunderstood what he is trying to do?

    But if loop1(10240) = loop2(9020) should do something different than loop1(11002) = loop2(4030) then you would still need to add this to the code somewhere, resulting in a lot of events.

  • Try Construct 3

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

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

    I'm trying to create an object and position to another multiple copied objects. I tried adding for each as a condition or sub event for the every tick, but nothing seems to work, some times it only shows on one object for this case is the enemy. Any help is very much appreciated. thank you in advance

    You need to specify which "enemygun" you want where, at the moment in the every tick you set the position of all enemyguns to enemy1 imagepoint.

    This will never work the moment you get more than 1 enemygun. as it will place all of them at the same enemy. You need to either pin the gun to the correct enemy.

    Here is how to do it:

  • Good day. I just want to compare my frames from sprite1 to the frames of sprite2 without having too much events everytime i compare the two.

    Please take a look at my example capx

    http://www.fileconvoy.com/dfl.php?id=g8 ... 4f2b1bb17c

    Think you have to explain in more details what you are trying to achieve with this, if you want help finding alternatives. When looking at you Capx, it seems that different things should happen if for instant (Sprite_1.Animation_frame 1 = Sprite_2.Animation_frame 1) but also if (Sprite_1.Animation_frame 1 = Sprite_2.Animation_frame 2) and so forth.

    But regardless of whether you use | in your condition, if you want different things to happen based on which condition is true, you will need to figure out which frame each of these were at some point and therefore use a lot of conditions.

  • What can affect an "Every Tick" condition?

    Not sure your question make a lot of sense?

    An every tick condition is what happens by default if an event in C2 doesn't have any conditions that would change the rate at which it is checked. By default this is 60 times a second. So when you ask what can affect an "Every tick" condition, the obvious answer would be nothing, as it have nothing that can be affected . But im pretty sure that weren't what you meant with the question, can you elaborate?

  • Hey! I'm making a game (tower defense) and when when I drag a tower over an area and drop it there, it's suppose to spawn a new object on the area(which is a sprite), but the problem is that if it's over two of the same areas, I don't know which one it's gonna land on. Can someone help me?

    The best and easiest way to solve this is to use a pick nearest/furthest action, when you drop the tower on the sprite where you want to spawn it. I guess you have some conditions that when you drop the Tower you want to place, you also check whether its overlapping this sprite where you can place it.

    Now if the Tower overlaps several sprites your pick counter of those sprites is likely to be greater than 1, but since you are also for certain closer to the sprite where you actually want to place the tower than those where you don't want to. You can use the pick nearest/furthest action to pick the sprite closest to the Mouse.X, Mouse.Y.

  • Your problem is with picking, understanding that in C2 is crucial if you want to make anything useful. Luckily when you get it, its really easy.

    This should get you started:

    https://www.scirra.com/manual/75/how-events-work

    Pretty much its all about setting up the correct conditions for your objects.

  • If you think you can make 3-4 games a day and you are happy with the 20$, why would you care about giving him the source code as well, it would make no difference anyway.

    Consider this, if you can produce that many games a day, they have to be fairly simple even if you are good at C2. So regardless of how you put it, the source code have no value, since you could either recreate the games fairly easy again yourself, but it also means that the majority of people here, could also recreate them anyway. So this person can't sell the source code to anyone anyway or at least not for the amount of money that you would have to care about it, I think.

    So if you are happy with the 20$ per game and think you can make 3-4 a day give him the source code as well

  • Random setting of Boolean

    Yet a minor addition that would be handy I think. At the moment you have the ability to Set a Boolean variable to either True, False. But in cases where it should be random, its easier to use an integer. So adding a new action could solve this.

    Action:

    Random Boolean - Would set the Boolean to either true or false.

  • The audio plugin doesn't seem to have any way to return filenames (according to the manual page). Here's what I'm working with:

    When "On 'tracks' ended" is triggered, I want to prevent the same song from playing twice in a row. Ideally I want it to call a function like so:

    [quote:19xxlsd7]On "tracks" ended:

    --Call function "AudioShuffle"

    --Set Parameter 0 to "(name of audio track that triggered this call)"

    On Function "AudioShuffle"

    If Param(0) and audio are equal, call the function again.

    Else, play (choose(track1,track2,etc))

    Yes, you could do this in a dictionary or array as well (toggle from 0 to 1 for "chosen track" to stop it from repeating), but I would be surprised if there were not a way to do this as the events currently are. Thank you!

    Then you have to be surprised, because there ain't

    As workaround solution instead of your array or dictionary solutions, wouldn't it be easier just to make a list (playlist) and add all your tracks to that and use that as your input string for your audio object. That way you can always make a check vs "text at selected index" to make sure that the same track isn't played again.

nimos100's avatar

nimos100

Member since 23 Sep, 2012

None one is following nimos100 yet!

Trophy Case

  • 12-Year Club
  • Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • RTFM Read the fabulous manual
  • Email Verified

Progress

16/44
How to earn trophies