nimos100's Forum Posts

  • Its in the construct 2 examples when you start a new project just type RTS in the search bar and it will show up as a template.

  • The addition of ("Bases") makes the x and the y based on the layer Bases..

    If you have more layers than one and the paralax or scale of those layers are different x and y values can get troublesome, for they differ between the layers.

    Ok that makes perfect sense, thanks

  • Was looking in the RTS example and found this:

    What is the purpose of ("Bases") at the end of Mouse.X and Mouse.Y, Doesn't recall haven't seen it before. And reading the rest of the code doesn't make it any clearer why and what this is used for.

    Anyone knows?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • First you need the sprite to "find a path" to somewhere.

    Then you need to check if the sprite have found a path "On path found" and in that case it should "move along the path"

    Then you add an "On arrived".

  • Running the bug preview I see I am getting around 45 FPS on desktop and on mobile preview I am getting around 12 FPS. I know desktops have better performance but should I be concerned with the low mobile frame rate?

    All my objects so far are sized with a power of 2 at 32X32 or 64X64, except for the player sprite, even my BG image is tiled at 64X64.

    It kind of depends on your game, if its a very small game or you are in the beginning of making one and you are seeing big drops in FPS, then something is most likely not working correct. But it also depends on your computer, and the debugger will always lower performance a bit compared to a normal preview.

    But are your game big with loads of graphic and events etc. Then loosing a bit of FPS in preview is rather common and should be expected.

    But what performance do you get with a normal preview?

  • Ok so if I understand you correct you have X amount of characters available, at some point during the game, the player can unlock these, and use them in later games if they wish. So when the player starts a new game you would like to load each unlocked character and show them in a selection menu, which is a tilemap?

    [quote:2pkn6525]As I write this the idea came to me that instead of using the UID of sprites or IID of the avatar family. I will look into just having the avatars in a folder in my project file and pull their img form there to replace a generic avatar. thus negating the need of a family. Worth a shot so give me some time and I will report back

    You don't have to pull the image from an url, if you use a tilemap it is much easier to store each character in the tilemap it self.

    So in Tile0 you make an image which might say "Unavailable" which you use for all characters that haven't been unlocked yet. As they get unlocked you simply switch a given tile to another tile. So if the player unlock character 1 you switch the tile (0,0) to tile1.

    If I understood you correct, you only need to store whether a character have been unlocked or not in a file, so you know this whenever the player starts your game. If you keep the family containing you characters you don't have to use an array to store there stats. These stats you make in the family and whenever a character is loaded you simply read these values from the family it self (The specific character sprite).

    So after you have started the game, and found out that character 1 and character 2 is available, you can make a function that get the stats for each character. If you also need it to be placed at a certain position, you can pass this as well, so:

    Requires:

    Parameter 0 = Character.UID

    Parameter 1 = Position

    Function "Load character stats"

    Sub event 1:

    Pick character1.UID = Function.Param(0) (Will only select character1 if the passed UID matches it, else it will just skip it)

    --------- If Function.Param(1) = 1 (Will place character 1 at position 1)

    Set textbox_CharacterName_1 = Character1.Name

    Set textbox_CharacterHealth_1 = Character1. Health

    Set Tile.At(0.0) to Tile1 (Assuming that this hold the image of character 1)

    --------- if Function.Param(1) = 2 (Will place character 1 at position 2)

    Set textbox_CharacterName_2 = Character1.Name

    Set textbox_CharacterHealth_2 = Character1. Health

    Set Tile.At(1.0) to Tile1 (Assuming that this hold the image of character 1)

    Sub event 2:

    Pick character2.UID = Function.Param(0) (Will only select character2 if the passed UID matches it, else it will just skip it)

    --------- If Function.Param(1) = 1 (Will place character 2 at position 1)

    Set textbox_CharacterName_1 = Character2.Name

    Set textbox_CharacterHealth_1 = Character2. Health

    Set Tile.At(0.0) to Tile2 (Assuming that this hold the image of character 2)

    --------- if Function.Param(1) = 2 (Will place character 2 at position 2)

    Set textbox_CharacterName_2 = Character2.Name

    Set textbox_CharacterHealth_2 = Character2. Health

    Set Tile.At(1.0) to Tile2 (Assuming that this hold the image of character 2)

    Then you just create one for each character and each position. And then you just call this function every time you need to load a character.

    Call function("Load character stats", <FamilyCharacter.UID or specific character UID>, <Position of where you would like the character to be loaded to>)

  • Im not really sure what you are trying to do.

    [quote:7uf79jho]The problem I am running into is that I can not link my array and family. Meaning that I cant run though the array and have each row correlate to a member of the family. I have tried having each row being the UID of each member but I can not find a way to automate that idea. And simply having Bob.UID in the first part of each row does not work.

    I don't understand what you mean that you want to link the array and family?

    The array hold whatever data you add to it, and can not be linked to anything, in theory any object in your game can use these data if you want them to, depending on your conditions for reading and making use of the content in the array. If what you mean is that you have stored some data to the array at some point and then when a character is available you want to use this to set some settings for the character, then you have to make sure that these characters UID matches the ones stored in the array, which it could sound like it doesn't.

    I get the impression that this is what you have been trying. But its very hard to troubleshoot when not sure how and what you store in the array.

    The family is also something that you cant link anything to, it more or less just a wrapper that can hold a group of other objects of different kinds but which share some common attributes, and therefore makes it easier to work on several different types of objects at the same time. So I don't understand what you mean with linking to it? If your characters are part of the family they are already "linked" to it through that and can be selected using:

    Pick Random FamilyCharacters

    Character1.UID = FamilyCharacters.UID (Assuming that the random Familycharacters chosen is a character1)

    Can you try to explain what you want to use the family for and when, and what the array hold of data that you need. And how and when you store the data, in correlation to when you need to read from it, think that would make it easier to help you?

  • Im not 100% sure but I don't think that the 8 bit pngs in PS works very well with opacity, and therefore if your sprites in 24 bit depth have smooth edges, they will render a white border around the image where the opacity occurs.

    To solve it you have some options:

    1. Make all sprites with hard edges, mean you paint them with pixel setting in PS. This is the time consuming way, as you will have to repaint all the sprites.

    2. You can use this website to convert 24 bit to 8 bit pngs and will preserve the opacity as well. You can only do it with one image at the time so if you have a lot it will ofc take some time as well. To save the 8bit image you just right click the image it self and choose "save image as.."

    http://www.8bitalpha.com/

  • Problem Description

    Not really sure if this is even a bug as much as an inconveniency. But if you create a sliderbar or any other system UI element such as buttons etc. And press "tab" until it is selected/highlighted. There are no way to deselect it again unless you press "Tab" once more.

    For the buttons you can use unfocus, but something like this doesn't exist for the sliderbar, and not sure there is a good way to deal with it for buttons anyway.

    The problem is that keyboard input doesn't work while one of these are selected.

    Maybe an option to remove these elements from working with "Tab" or something. Anyway not the biggest problem ever just inconvenient if you use them.

    Attach a Capx

    Not capx related

    Description of Capx

    Steps to Reproduce Bug

      Create any system UI element and tab during runtime until it is selected. Make something that react to a "key press" and it wont work, while the element is selected.

    Observed Result

    While selected keyboard input doesn't work.

    Expected Result

    Affected Browsers

      Tested with Node webkit

    Operating System and Service Pack

    Windows 7

    Construct 2 Version ID

    r180 but most likely all versions as these are system elements.

  • You can make combinations by adding several conditions, so if you want to make it so the character jump forward when Right arrow and top arrow is down, you can add 2 events, I guess you can use keycodes as well. Anyway here is how you can do it:

    Both event do the same, so making a function to handle the actual jump would be best. But If you are not sure how to use functions you can just copy/paste one to the other so they are the same.

    Event 1:

    On Right arrow pressed (Trigger)

    Key Top arrow is down

    Actions:

    jump forward right

    Event 2:

    On Top arrow pressed (Trigger)

    Key Right arrow Is down

    Actions:

    jump forward right

    Then you just make one for the left as well. The reason you make 2 for each side is just to make sure that the player doesn't have to be precise when wanting to jump forward. But you could probably get by just using the first event, if you don't care to much.

    Or you can make if so:

    Event:

    On Right arrow down

    On Top arrow down

    That would work as well and is probably the best way, as players are most likely moving when they want to jump anyway

  • Ahh ok cool

  • Problem Description

    Small user interface bug. Some functionality disappear if you do things in a certain way.

    Attach a Capx

    Not CapX related, as it can be done with a completely new project as well.

    Description of Capx

    Here is how to recreate it with some screenshots.

    1. Make a new group and select it and press "C" to add a new event. Select "On start of layout" and press "Done".

    2. Press "B" to add a blank event and add a new system event to it, while having the blank event selected and now the whole "Start & end" and "Save & load" category have disappeared.

    3. To get them back you have to delete the group and create a new one and add a blank event and now when you add the new system event they have returned.

    Steps to Reproduce Bug

      See above. Observed Result "Start & End" and "Save & load" category missing Expected Result That the categories were still there. Affected Browsers
      • Chrome: (YES/NO)
      • FireFox: (YES/NO)
      • Internet Explorer: (YES/NO)

    Operating System and Service Pack

    Windows 7

    Construct 2 Version ID

    r180

  • Cant you just make a game controller of some kind that keep track of which turn it is to move. And use this as an overall controller for all things. So if this variable "Turn = Player 3" then nothing else will trigger for any other player. And then in all your functions, events etc where you need to pick or do something with some units or whatever, you just make sure that you always check or pass the current player "Turn" into the function, or just read it from the game controller, so this value always match the player that is currently moving.

    I assume that all units/stuff in the game have a variable that indicate who they belong to. So if you make these match the "Turn" variable it should be fairly easy to always make sure that you select the correct units.

    I don't think you necessarily need to use arrays, it ofc depend on the game you are making. But it should be enough to just make one variable that you use to whenever you need to check the ownership of something.

    You could for instant make a small sprite called Faction, add it to a family and give it a owner variable and at the beginning of the game you spawn 4 of these for instant and set the owner as following:

    Owner = Player 1

    Owner = Player 2

    Owner = Player 3

    Owner = AI 1

    And you can then add to the family the variables that you need like INT:money, BOOL:Ally with player 1, BOOL: Ally with player 2 etc and you just switch these on off. Whenever something changes.

    Due to the Owner variable it should be fairly simple to select the correct faction:

    Faction.Owner = Turn.variable (From the game controller)

  • In that case I would destroy the video element at the start of layout, and create it whenever you need it. Which I do with all elements for that simple reason that you dont have things in the game that are not used, and to remove rogue objects that can all of sudden screw things up if you are not careful.

    So when the player trigger the TV and start playing the video you create the video object where it needs to be:

    Create video

    Video.set position = <X>, <Y>

    Video.source = "Video1"

    Video.Play

    Seen_video = 1

    Video.hasEnded

    Video.Destroy

    Subevent in video has ended:

    If Seen_video = 1

    Actions

    Set Seen_video = 0 Then it will not trigger again

    Go_to_map 2

    Another subevent in video has ended:

    If Seen_video = 2

    Actions

    Set Seen_video = 0 Then it will not trigger again

    Go_to_map 3

    [quote:2psyd3x0]This works fine in the first group of code in which it is used (it does detect the when the video ends), but then later, despite having

    set the video to a new source file, trying to read the Has ended property still seems to results in it returning a "True".

    You can check this really easy, if you in start of layout start video 1 then you make a video has ended and in here you tell it to play another video or the same video doesn't matter. And if it keeps playing you know that it works as it should. You ofc just have to make sure that your videos are not set to loop, which they shouldn't by default.

    [quote:2psyd3x0]Basically, why isn't this property reset to False when a new video file is selected for a given video object?

    Because its not a property that can be set, it is a trigger. It would be like wanting to set "On created" to true or false, its not how it works, it triggers every time a video has ended, and also why I think it was meant to have that little green arrow. It doesn't care which video file is selected, it triggers whenever that Video element is done playing a video.

  • The video "has ended" is just a trigger, so its not something that you set to true or false in that regards. But every time a video is done playing it will trigger what is in the video "as ended" , so unless you use some other variable to indicate what video "ending" you want your program to react to, it will react the same way to whether its the first video or the second video that is done playing.

    So you could make a counter that every time a video "has ended" you add one and as a sub event in the video "has ended" you check to see what this value is. And then you make the program do what it needs to do here.

    So first time when video 1 have played.

    Video_counter = 1

    IF Video_counter = 1 switch to map 2

    Then you play video 2 and add one more

    Video_counter = 2

    etc etc.

    Not 100% sure, but I think the Video "has ended" was actually intended to have the little green arrow, like "On created" "On destroyed" and so on, but might be a minor bug maybe.