Greaver's Forum Posts

  • 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?

  • 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 ^_^

  • Try Construct 3

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

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

    I am trying to come up with the best possible way to create an inventory system with many layers, example;

    Start -> Opens Menu -> Picks an option -> Opens new window (such as equipment) -> Clicking item opens another. Etc.

    When pressing ESC -> Go back 1 step/window to the previous one.

    I was wondering the best possible way to do this and control one window at a time without accidently pressing on the window behind it.

    Is layer 'on screen' best option? U click 'Equip'-> moves current window offscreen and 'Equipment' Layer on screen? And so on?

    Or is it with variable? IF X is true, then ..?

    Anybody knows? ^_^

  • But those classic RPG's used layout yes?

  • Greetings there!

    So i made a layout inventory system, and ofcourse when items drop on the ground, i want to keep them there for when u open and close the inventory, so i gave the item the 'Persist' behaviour. Now, the items have a function 'on create' so the persist does not work properly with this function 'random frame on created', everytime i access the inventory and go back, this function plays again. So i gave the item also ''global'' to keep it from happening, but now whatever layout i go to, the items follows!

    Cant get rid of them lol! ^_^

    So how do i get rid of items, with both persist and global behaviour?

  • > Hey there! ^_^

    > So my big question here is; How could Final Fantasy 7, Castlevania, Breath of Fire etc, have endless inventory spaces?

    > U can store up so ridicously many items, how does that not lag the game?

    > Alsow hen u open inventory in these RPG games, is it counted as a new Layout?

    >

    > How can these old games on these old systems handle it?

    >

    There are a couple of ways to do inventory:

    You can use an array which is a little complicated to set up and you need to study the array tutorials but works well and can store massive amounts of items.

    OR you can use a separate layer or layout and use sprite place holders for items stored.

    I have used both and prefer the sprite inventory for most games because I can see the items as I create them and place them as needed on the inventory screen but both work well.

    You also want to study families to keep items organized.

    As for lag, once the game is loaded there should not be a lag with inventory but you probably remember some of those old games had a long load time. That was a result of large inventories and music . Today's systems operate much faster so the lag time is negligible and there are a few tricks to reduce lag time on loading using streaming music and loading images only as used.

    Hey! Thanks for the answer, but if ''pin to object'' is used for items, when pick up to pin them to the inventory space, wont the game lag if there are 100 items running around in the background, all pinned to spaces and slots?

  • Hey there! ^_^

    So my big question here is; How could Final Fantasy 7, Castlevania, Breath of Fire etc, have endless inventory spaces?

    U can store up so ridicously many items, how does that not lag the game?

    Alsow hen u open inventory in these RPG games, is it counted as a new Layout?

    How can these old games on these old systems handle it?