Guizmus's Forum Posts

  • If you feed your array with datas just like the txt files, you should have the question in index 0, answers 1 to 5 in index 1 to 5, and the answer in index 6.

    I don't exactly know how you use those datas to display on screen, but it should be a text object per answer if I'm right. If this is the case, the solution is simple :

    • add a "answer Index" variable to each text
    • when you want to display a new question, empty all the text elements and set their answerIndex to 0
    • then, for i = 1 to 5, select a random instance of a text element that is currently empty, and set it to "ans"&i. Put the "i" loopIndex in the "answer Index".

    This way, you will have the answers randomly appearing on screen, but will still keep track of what answer is the right one.

    I'll send a capx soon to illustrate.

  • So if I understand right, the bike stops reacting to inputs, and the enemy don't slow down. Could you share the capx ?

    There may be something with the enemy movement. How do you move them ? Using the platform behavior and simulate input ?

  • Easiest way : use an array. Put all your names in this array, and then take a random element from it.

    Take a look here :events capture

    In the first event, I just put names into the array.

    In the second one, I select a random number, between 0 and (numberOfNames-1). This will be the index of the random name I want to use. I then set some text, but this was to show you how to access the array, and how to have the firstName or the lastName.

    Hope this helps !

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I don't know about this plugin you are looking for, sorry.

    If I was to do a custom list, it would go like this :

    • have a variable (an array ?) with the list options,
    • have a variable linked to the list, "SelectedOption"
    • use a 9patch for the design of the list (when not clicked) and a text for displaying the SelectedOption
    • have a sprite on the right of the list (the arrow to show all options) that calls a function to show the list
    • showing the list would be building multiple "option" objects, each one being a text, and then have a tiled background for the background of the list. Each option would have a "mouseover" to add some sort of focus (bold, new background, ... your choice)
    • clicking an element in the list would update the value of the selectedOption on the list, change the main text, and destroy all options
  • Platform and Physics are two "moving" behavior, meaning they can handle movement for your sprites.

    When you activate platform, if you let the controls to Default (you can change this in the behavior parameters), it will capture the keyboard, and use the arrows to control the Platform sprite (here, your enemy).

    Doing this, you loose control of the bicycle.

    The solution is simple : change the parameters of the behavior to "Custom controls", and all should be good.

  • You can't post link, but you can post the URL (in text format).

    Without more information, it could be anything.

  • It doesn't work because you use the events "On key pressed", witch is triggered only when the key starts being pressed.

    What you want is "on key down" witch will be triggered as long as the key is down. You would want to keep the "On key pressed" to handle the mirroring and change in animation though.

  • The Fade behavior can't be modified during runtime. So if you configured it to fade out after 1 second, during 2 seconds, with no destruction (example), you can't use that same behavior to fade in.

    What you can do is add another fade behavior, set to fade in, and inactive on start (btw, you can rename behaviors so it's easier to know witch does what). When the player dies, you then use an action like "Character : restart FadeIn"

    EDIT : you found the exact solution I was describing ><

  • If I understand right, in the image :

    Angle(World,Player) = 45

    Angle(World,Enemy) = 270

    (By the way, usually, angles are handled counter-clockwise)

    What you want is Angle(Enemy,Player). Let's decompose angles then :

    Angle(Enemy,Player)

    = Angle(Enemy,World) + Angle(World,Player)

    = - Angle(World,Enemy) + Angle(World,Player)

    In the schema's case :

    Angle(Enemy,Player) = - 270 + 45 = -225? = 135?, seems about right.

    Then, hit location is just a switch case.

    If the angle(Enemy,Player) is between -45 and +45, it's the front side.

    If the angle(Enemy,Player) is between 45 and 135, it's the right side.

    If the angle(Enemy,Player) is between -45 and -135, it's the left side.

    If the angle(Enemy,Player) is between 135 and 225, it's the back side.

  • Both seem ... equal. I wouldn't go with any of those though.

    What I would do :

    <img src="http://i.imgur.com/ISp46A8.jpg" border="0" />

  • Only way I see how would be to host some kind of server on the PC, and dialog with it with the websocket plugin (https://www.scirra.com/manual/153/websocket). I don't have knowledge to help you further this way though.

  • The problem you have is the last event : "player isReloading". Let's see how the computer will work with your script :

    • Ctrl pressed, set isShooting = true.
    • isShooting=true ? then start fire, and set isReloading = true
    • isReloading = true ? then wait 1 second and setReloading to false.

    Last event will be checked every tick, and so, every tick for 1 second, you will start a waiting period of 1 second and then set Reloading to false. This will make the Reloading set to false all ticks for 1 second basicaly.

    What you need to do : add a condition "Once while true" on the last event.

  • Hey there.

    Your basic game workflow should work.

    I have a concern though. The third array is more like a database than a dynamic array. I would suggest using the CSV plugin to do that, so you could access the datas with something more clear to read (column names is realy nice when you have lots of data for each items, plus it's easier to check/complete/modify item stats through Excel).

    Now let's take a look through your actions :

    o Player kills monster > call function "handle loot", passing monster.UID as parameter, before destruction of the monster object

    o Computer does a random number roll. > handled by the function

    o If the number roll is a success, the monster spawns a random item > handled by the function. spawn an item on the monster coordinates.

    o When the player collides("picks up") the item, the items corresponding number is added to the Slot array.

    Player On collision with Item, call function "pick up item" passing item.UID as parameter.

    The pick up function would first look for the first empty slot, then if it found one store the item in it, destroy the item object from the game. You should have a function that would update the "slot" display on the screen to call here.

    Then, you'll need a new "item object" (let's call it item2), different from the first one as it will be in your inventory, and would have a drag-drop behavior.

    item2 on drop on equipSlot : if the equip slot isn't empty, handle the unequipment of the object first. Then, update the EquipSlot with the caracteristics of the new item. Last, remove item from inventory/destroy the item2 object.

    I tried to described a little more what would be the script-flow, hope it helps.

  • Well, you are not that far, don't be afraid.

    If both players are in a family and only one is on the layout when you play, then you just have to replace every use of the "Character 1" object by the family itself. You can do a right click->replace object for this.

    The "slow" part will be the behaviors you put on the character 1. For a complete "familization", you would need to have those behaviors on the family, not on player 1.

    If both players play the same, and only the animation set changes, this would be the solution.

    Another solution, dirty but working, is without families. Instead, you have a single sprite for both players, and rename all the animations with a prefix, like playerName. This would meant "Player1__Attack", "Player2__Attack", ...

  • Yes of course. I used array to carry multiple datas at once.