AllanR's Forum Posts

  • insanesnake

    take a look at this thread from a couple months ago...

    https://www.construct.net/en/forum/construct-3/general-discussion-7/scrollto-lerp-front-instead-143258?kws=spaceship

    this is a sample I made, it drifts the way I would make a spaceship...

    https://www.rieperts.com/games/forum/spacebackground2.capx

  • I would do:

    IF 	a = "Test3"
    	b = "Test2"
    	c = "Test1"
    THEN Result = "True first"
    
    else
    
    -> IF 	a = "Test5"
    -> 		b = "Test6"
    -> 		c = "Test7"
    -> THEN	Result = "True second"
    
    -> else
    
    -> -> IF 	a = "Test7"
    -> -> 		b = "Test8"
    -> -> 		c = "Test9"
    -> -> THEN Result = "True third"
  • Mokoto

    I used to use Absolute X and Y occasionally, but I found that using Mouse.X("HUD") or Touch.X("HUD") where HUD is a layer with Parallax set to 0,0 works much better - and should solve the issue you are having.

  • Awesome! :) you have obviously put a lot of work into that! Very impressive.

  • potap100

    you must have an action in your event sheet that tells it to start playing the song, which is making it start the song over again.

    if the layouts share an event sheet, then you can first test if Audio is not playing anything, then start the song.

  • yeah, I saw that too in event 88.

    NaN stands for Not a Number, and means you are trying to put a text value into a number variable...

    You might want to use an array if you are going to have more levels. Then you can save and load the entire array with one action.

  • mOOnpunk

    if the value is going from 0 to 1, then you want a formula like:

    A + (B*(1-current value))

    you could add clamp() just to make sure the values don't get outside the range you want...

    EDIT: on second thought, I am not sure I completely understand what you are looking for.

  • ComGamer

    I have a library for making buttons that I use in a lot of projects - it covers all the states, multi-touch, overlapping, and other things.

    what I do is store the name of the function to call when the button is clicked in an instance variable of the button family. That way I can create a new sprite for a button, add it to the family, give it the name of the function to call, and everything else is handled automatically.

    You could do something similar... when the r key is pressed, let the object determine what function to call.

  • Aldenwar

    just guessing here, but you may need a "For Each PlayersCharacters" under the 4th event. That code might be failing if two players are dead at the same time. The Trigger Once may also be part of the trouble.

    I would try to eliminate the trigger once by expanding the player's status to Alive / Dead / Respawning

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • the array wont be loaded yet when event 8 executes (at start of layout)

    it will take a while before the AJAX on complete executes, after that the array will be loaded and available to other events...

    if you assign the text object in the AJAX on complete event (after loading the array), I would expect that to work.

  • in the AJAX On Complete event (event 7) you are setting a text object to AJAX.LastData

    you should be loading LastData into the array (Array Load AJAX.LastData)

    then you can access the array like this:

    TextObject Set Text Array.At(random)

    (Where random is a random number between 0 and the last entry)

  • another option I use a lot is to use TokenCount and TokenAt...

    put your text in a variable with a delimiter and then use TokenCount to see how many choices there are, and TokenAt to extract a random one.

    if you want any control over how often a particular text is chosen, or want to make sure it doesn't repeat until all the possibilities have appeared, then an array is a good choice - you can delete the entry that is chosen.

    (Using TokenAt is a great way to load up the array, and then delete each entry as it is used to make sure it doesn't repeat)

    EDIT: Nepeo can you remove an entry from the Advanced Random to eliminate duplicates? That would be awesome!

  • charles1311

    it looks like the tanks were getting overwhelmed with commands, and might have been using the wrong tank coordinates in some places...

    the left and right directions were getting cancelled by the up/down ones.

    I changed it slightly to do all the checking under one "For each tank" event, and made it always choose to go towards the coordinate (X or Y) that it was furthest from the target location. (I also made the target location visible so I could see what it was doing).

    www.rieperts.com/games/forum/tanks.capx

    EDIT: if your game will have any obstacles on the battle field, then path finding would be a very good idea - like plinkie said...

  • if the list of objects doesn't change dynamically at run time, then you can just put all the sprites in a family and use:

    Create object FamilyName

    that will have it randomly choose one of the family members to create...

  • ok, I see what you mean... choose cannot be used with a single variable like that, so you will have to use tokenCount and tokenAt.

    set the Sp_Data.BChoice to the list of possible objects "Sp_B1,Sp_B2,Sp_B3..."

    then: create object(tokenat(SP_Data.BChoice,floor(random(tokencount(SP_Data.BChoice,","))),","))

    what that does is count how many choices there are:

    HowMany = tokencount(SP_Data.BChoice,",")

    then randomly chooses one of them:

    WhichOne = floor(random(HowMany))

    and then extracts the text of the one choosen:

    tokenat(SP_Data.BChoice,WhichOne,",")

    https://www.rieperts.com/games/forum/createbyname2.c3p