Greaver's Recent Forum Activity

  • Seems to be working now when i deleted the physics impulse.

    Code is;

    'X on created, - apply physics impulse 10 at angle 270 + (15-random30)) at image point 0'

    Why would this crash the game? And how to fix this code?

  • We will definitely need your project .capx or at least a shortened version of it to reproduce the possible bug and to help you with this.

    I am positive though that it is no bug and just a line of code that needs to be changed.

    Unfortunately i can not give u any type of version of this as the scale is way too large and the game almost done.

    Is there no other way to find out what the problem is?

  • Hey there! So i am trying to add a save and load function, but i keep getting the same error no matter what.

    I do not use any plugins or anything like that.

    Error says;

    Javascript error!

    Uncaught TypeError: Cannot read property 'ApplyLinearImpulse' of null

    http://localhost50000/Physics_Behaviour.js, line 2223 (col12)

    This may be a bug in Construct 2 or a third party plugin or behaviour -

    please report it to the developer following the bug report guidelines.

    EDIT; It happens always when the player is in a different layout than the layout the game was saved in.

  • Greaver

    You can do it swell by checking the distance maybe looks cleaner and easier to read the events:

    Here are a few Examples:

    https://www.dropbox.com/s/v6u3v1xaac8yao6/Diferent%20Options.capx?dl=0

    Wow cant believe u took the time to help this much! ^_^

    Thank u so much! Its perfect! No error, i understand now what u were doing ^_^

    Thanks a bunch! ^_^

  • Greaver

    Capx: https://www.dropbox.com/s/31xgr61zygs4dqk/shoot%20to%20angle2.capx?dl=0

    You can also do the same with just two line of sight

    line of sight 1 range to ( wich ever you like to star following) the player

    line of sight 2 range to (100) to trigger the attack

    Hey there! Thanks for taking ur time, but the sample u provided has few errors. If u just jump behind the enemy, he stops.. And he is always moving towards the character no matter distance, we need it via LOS.

    I will try 2 different line of sights, maybe that helps. But i still need help with this however.

  • Greetings there! ^_^

    So i have been looking through the tutorials on AI behaviour and there are some great ones! But however not what i need.

    I need the enemy to walk up to the Player and perform an attack when nearby.

    Basically so far;

    When Player is in LOS of enemy.

    If enemy is greater than the Players X, toggle Right

    If enemy is lesser than the Players X, toggle Left.

    But now, i want the enemy to attack at X+100 or X-100 of Players position, depending on which way they are coming from, left or right.

    However the other toggle right or left are interfering with this.

    I just want the enemy to walk up to u and start attacking when close enough. Anyone can help with this?

    Thanks in advance! ^_^

  • Hey there! ^_^

    So - i made an inventory, a simple one like this; https://www.scirra.com/tutorials/670/ze ... e-easy-way

    They are sprites placed out, which plays an animation and frame depending on what item u pick up.

    Now, i made this layer parallelx 0, so it always appear with the UI in the middle when called upon.

    I made it Global.

    However, when i enter a new layout, all the frames reset. Is there any way to fix this? If i add persist, it wont change anything.

    Next layout, it simply resets. I need it at parallalx 0, and it must be global to pass through all layouts and carry on right?

    Any help?

  • With that amount of slots and stats, it makes more sense to use a single array to keep track of each slots' stats seperately. Each x column can represent one stat, and each y row can be an equipment slot. Then with all the data available to you at any given time, you can apply the numbers however you like, and they are easily replaceable.

    Yeh dont really know how to do that, thanks anyway ^_^

  • One method would keep two separate stats for the player - base stats and equipment stats. Then you can just replace the equipment stat if you get new equipment. Any calculations done would simply add them together. This gives you more fine control over what stats are additive and multiplicative as well. However, this can be harder to implement if you have a lot of equipment categories modifying the same stats. You only have to do it once to set up the system though, and it should be flexible.

    An alternative is to subtract out the stats when you unequip as you mentioned, but to me that method raises immediate concerns about possible number bugs/mistakes that can be cumulative. Also if you have any stat modifiers more complex than straight addition and subtraction you will need to work backwards for those too.

    Hey there! Thanks for the reply! ^_^

    So basically we have 10 equipment slots. Each equipment slot needs a variable of what is equipped, example -

    ''Helm slot''

    Strength = X

    Dexterity = X

    Health = X

    Mana = X

    And so on....... And then when u equip, u will add to these variables the items stats and add them to the Heros stats.

    When u unequip, u subtrack the variable stats from the Hero stats, and replace the variable stats with the new item u equipped and add them to the Hero.

    Since we have alot of slots and items and stats, this will mean 10-15 variables for each slot. Is this really the easiest way to do it?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hey there! ^_^

    So im currently designing an 'Equip' system, and i need some advice on how to exchange the stats of the item, on the character when replacing the current item with a different item.

    Example;

    Say Hero has 'Dagger' equipped (+2 Strength and +1 Health)

    Player replaces 'Dagger' with a sword that has '+1 Strength and +5 Health.

    Now there are random stats on the items so doing a constant factor does not work, as a dagger may have 2 strength or 5 strength.

    Do we in this case save the stats of 'Equipped' Item, and deduct it from the Hero, THEN equip the Sword and add the stats to the Hero?

    How would that go? Thanks in advance! ^_^

  • If there are any other/more advices, please tell me! ^_^

  • I would use a variable condition. Assign each menu a unique number, and add variable ActiveMenu. Add the condition ActiveMenu=x so that you can only interact with the currect active menu, if they stack.

    Alternatively, you can just replace the previous menu completely when opening a new one, then you dont have to worry about stacking/overlapping at all. You can save what the previous menu was in a variable as well, for when you need to go back.

    Thanks, this information is useful ^_^

Greaver's avatar

Greaver

Member since 5 Apr, 2013

None one is following Greaver yet!

Trophy Case

  • 11-Year Club
  • Email Verified

Progress

12/44
How to earn trophies