Toby R's Forum Posts

  • Just from the top of my head. Not tested.

    X=6, Y=4 are the cords of the field according to which you are searching for the nearest field with a value of 0.

    set searchOffset = 0;
    
    while not fieldFound (or whatever loop, this one is not important to specify)
    {
    	add 1 to searchOffset;
    	for "loopNameX" (X-searchOffset) to (X+searchOffset)
    	{
    		for "loopNameY" (Y-searchOffset) to (Y+searchOffset)
    		{
    			if Array(loopindex("loopNameX"),loopindex("loopNameY")) == 0;
    			//Do whatever you need
    			stop loop 
    		}
    	}
    }[/code:56q4jfsh]
  • If you mean Intel XDK then you might be interested with my ebook (link in the footer). It will walk you through step by step with explanations. And you can always email me if you don't understand anything.

    You can also simply post a topic on the forum with the particular problem you have.

  • Happy it works for you .

    What have you used for mobile version? Intel XDK or CocoonJS?

  • but Humble Bundle's offer was GMS pro + Android Export module for $12 (instead of $450). So it is worth a shot even if you won't stay with GMS IMO.

    C2 is trully amazing - there are no doubts about that. But for such a small price it is worth to at least take a bite of "the other side". It's like with programming languages. You may be a pro with JAVA but it is always nice to have some (even a small) practical knowledge/experience in other languages as well.

    To be honest I would never get interested in GMS if not this ridiculous $12 offer, because C2 is simply enough to do almost anything you imagine. For a price they sell GMS regularly I would go for Unity (as you said) if I'd plan some 3d project, but again for 2d project C2 has no competition at the moment, thanks to the intuitive editor and event system.

  • No problem . Very good Job! The only one thing I would change is the place of mana bar. I simply do not see it while playing because my left thumb is over it. This is very important to see it during fight so some top corner place would be better. But again, great game!

  • Ah yea. Well in this case you would need another function - let's call it - "adjustHealth".

    1. Add one more Family instance variable "healthToAdjust".

    2. Everytime champion got hit/healed you set "healthToAdjust" to X or -X.

    3. Right after that you will have to run "adjustHealth" function which will check each champion/sprite (you said you have 4 of them so that should not be a problem) separately if "healthToAdjust" != 0 then "health" += "healthToAjdust". Then set "healthToAdjust" to 0 and "health2" = "health".

    This is getting a bit complicated... but in your situation it might be worth a consideration.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Well... that makes sense. It will surely work if you copy health to health2. You can leave all your conditions as they are and use health2 variable only to pick the lowest health alive.

    But it's still a workaround and not a pretty solution, but I would probably also seriously consider this move instead of manually checking/fixing 25 000 events .

    I would definetly not do it with every tick (this might affect your performance) but just copy health to health2 everytime health value change. I believe you have some "updateHealth" function? So I would put the copy part there.

  • Ah Sorry I considered champions as different instances of one sprite object.

    So what I would try to pick character with the lowest health (but more than 0) is:

    Where "health" is an integer family instance variable and "isAlive" is a family boolean variable. Then you combine Family -> "Is boolean instance variable set" and Family -> "Pick highest/lowest" conditions.

    Haven't tested - just a guess.

    EDIT: nah I just realized it will never be true because it will probably pick the one with 0 health and check if it's alive or not, and it will obviously not be alive.

    EDIT 2: Well I've just tested it and it works. So first it filters the alive instances and then picks the lowest - so this is a solution for picking the lowest in health alive champion

    EDIT 3: OK... just read what you have edited above. I think rewriting your variables to family would be worth an effort, cause it will probably save you many problems in the future as well.

    Good job on not giving up - well done. We all were new to C2 or to programming in general and we also had not much more than manuals.

    When I was starting my programming adventure, there was no Internet in my country at all, so all we had that time was an old book and a strong will to do something creative.

    Nowadays everything is extremely easy to learn (if you really want to learn) thanks to Internet. I suggest you to start with some basic knowledge of programming. That would really help you a lot.

    It is not true that you are not a programmer because you do games in C2. What you do in event sheets is actually programming. You do not code it character by character as "traditional" programming requires, but setting all events logic in event sheet is a programming actually. All regular programming languages uses "if" statements, variables, constants, functions, loops etc. this is all part of programming.

    At the beginning programmers had to operate on bits (0/1), later Assembler came in, which was already a language where you could write instructions to your CPU, later developers were happy to have human readable programming languages like C, JAVA, PHP etc.... C2 is just a next virtualisation of the same thing - programming.

    Good Luck!

  • I'm not sure what would be the most efficient for you, cause it depends on the number of characters etc. But you could do something like that:

    1. create an instance variable "instanceName" (or "characterName") for your characters object

    2. create a Dictionary "aliveCharacters" and put there all characters names at the beginning of the game/stage

    3. once character dies you simply remove key which equals to dead character "instanceName"

    In that way you will have a dictionary of alive characters. You can loop throu it easily and pick objects by System -> Pick instance by comparsion (Object.instanceName = aliveCharacters.Get("happyDwarf"))

    You can also create disctionaries/lists of dead characters and whatever you need in your game.

  • Yes you can but not directly from C2. You have to wrap your HTML5 output with Intel XDK or other wrapper.

  • If you need both possibility, to stop/play particular sound and stop/play some groups of sounds then you need to tag each file distinctly (each sound should have unique tag/name). With this you are allowed to stop/play a particular sound.

    Now to be able to manipulate groups of sounds I would create a function in which you can put actions to stop them playing one by one. For example

    Function On "stopMusic" => Audio Stop "sound_1"

    Audio Stop "sound_2"

    Audio Stop "sound_3"

    Audio Stop "sound_X"

    Or if you name it with some assumed format like above "sound_x", then you may want to do some more clever thing like:

    System -> For "stopMusicLoop" from 1 to maxMusicIndex => Audio Stop "sound_" & loopindex

    So I would suggest something like this. There is no way in C2 to stop/play music and sounds separately.

  • Some details please. Everybody here dream to make games for a living - but what is it about? How can one decide if he is interested if there is no details at all .

  • You can create a function "muteMusic" in which you put actions to mute all your music tags. They simply use the function as one line of code to mute many different sound/music files.