LI0NHART's Forum Posts

  • I've created my wandering NPC's in my zelda game by creating a sprite object called "pathsprite" and in each frame have images for the avialable directions (make sure you set the speed to 0 so it does not animate) for example:

    frame 0 would have a image of an arrow pointing to the left

    frame 1 would have a image of an arrow pointing to the right

    frame 2 would have a image of an arrow pointing up

    frame 3 would have a image of an arrow pointing down

    frame 4 would have a image of an arrow pointing up,down,left and right

    frame 5 would have a image of an arrow pointing to up and right

    do this for all possible directions you require then set up logic like this

    If player overlaps pathsprite and frame = 0 then set "NPC" movement direction to 180

    If player overlaps pathsprite and frame = 1 then set "NPC" movement direction to 0

    If player overlaps pathsprite and frame = 4 then set "NPC" movement direction to choose(0,90,180,270)

    Also do a check position for when the NPC is (say) 4 pixels or less in distance then set NPC to the position to the pathsprite its overlapping. This ensures it goes throught the center of all pathsprites, you could also have the NPC wait at various places with a random timer to give the impression the npc is thinking were to go.

    Hope that maks sence im at work so unable to provide screen shots.

  • Thanks very much Wertle, I used find and works fine also understand the tokenat too, much appreciated :)

  • Hi, I have a sentence in a text object ,i want to check if the sentence has a certain word in it. im pretty sure I need to use tokenat but don't understand it could anyone help explain it simply with an example

    example:

    I went to the shops and bought coffee,tea,cakes and biscuits.

    I would like to see if the sentence has the word tea in it

    thanks

  • At start of layout use system to create your object and set parallax to 0,0 and make sure you layer is on the top :)

  • Create an invisible bar(titled background)and place it along the top,bottom,left and right of the screen, set it on another layer that is set to 0,0 parallax. It should stay put and have it collidable with your ship to shop it passing through.

    Hope this helps

    Edit: i see im too late

  • i would set up the bars at (lets say) 150 pixels apart on the y axis

    then upon pressing up or down the bartender would move that distance

    Exapmle:

    1st bar at 300 y position

    1st bar at 450 y position

    1st bar at 600 y position

    1st bar at 750 y position

    If bartender y position > 750 then set y position to 300

    If bartender y position < 300 then set y position to 750

    (this is how i did it for my zelda inventory navigation)

    and depending on what y position he is at set his x postion to the end of the bar.

    have invible boxes for all the posible places the customer could stand and have a pick object expression for them to move to it and then have it set to "occupied" or something so no other customer can use it.

    customers would also have a invisible box that when the drink overlaps it they would play their drinking animation, etc

    hope that helps

  • would like to know about this too :)

  • destroy mug object at begining of layout to solve the sound problem, i think you have to have objects in the layout, but hopfully that will be sorted in a future build

    There are lot of various easy way to do these but need more info on how your bar(s) are set up and how the bartender moves?

  • thanks ethan, not sure i understand but ill give it a go :)

  • I have a NPC that chooses 1 of 4 directions

    0=(right)

    90(down)

    180(left)

    270(up)

    If NPC has chosen one of these already how do I eliminate it from the next choose expression.

    I've given the NPC a "lastdirectionpicked" value I don't know the expression to take away the

    set "directionmovement" to choose(0,90,180,270)

    Thanks in advance

  • Yes i understand your point, as i use this method for a sprite movement and agree, i did not mean it as a complete replacement but rather an optional choice.

    thanks for looking though :)

  • When you need to type a sprite's animation name into the event editor for whatever reason, it can be misspelled(sometimes not noticed by the user and causing event(s) not to work) or if you've forgotten one of its names. You have to jump out of the event editor and to the layout page to click on the sprite(s) to view its animation(s) list to view all the animation names. You then have to navigate back into the event editor to type it in.

    So although a bit trivial it would be a nice addition and can speed things up by having an "animation name list" of the currently selected sprite to which you can just click&select to be inputted into your logic/coding etc

  • Awsome debugger tool thanks to the devs :)

  • I've managed to get it working. I just deleted the ballistics variable 'ballisticscount' for the object and added it as a global variable instead. Don't understand why it only works that way, maybe its a bug.

    Thanks for the interest of help tho :)

    PS. would interested if anyone can figure out why it wouldn't work using the object variable though

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The system tracks the amount of ballistics on screen and sets the ballisticcount variable to that amount(as circled by red). I only want 1 ballistic on screen at any 1 time. However when adding the check amount on screen condition (circled in green) it does not work at all.

    Here's the image

    image

    Here's the capx

    https://www.dropbox.com/s/ie3j1u4q12weny2/link.capx

    Hope this clears it up :)

    Thanks