tarek2's Recent Forum Activity

  • TitanGames

    The problem is in your event 2 because this event is continuously true while the NPC is not moving so the sooner you set Animation = 2 on collision with the bullet, the Event 2 sets it back to 0 right away and you gonna have the same problem with Event 3 if the Npc is Moving so the best thing is to add a boolean then put event 2 & 3 under it

    Then just Activate the Boolean on bullet hit and use a (Timer) 3 sec to deactivate it back again

    see here on the picture I added a boolean "Hit"

    https://www.dropbox.com/s/svzw0hzmbdj5lwd/Change%20Animation%20on%20Hit.png?dl=0

  • Thanks so much, :D how can i change the speed of the rotation?

    Add another Var= Speed

    Also for smother increase and decrease Speed, I replace Thickcount by Time

    (Time * Speed)

    dropbox.com/s/rwsb49yq11bq9yf/Rotate%20around%20%28X%2CY%29%20by%20%28Sin%2CCos%29V2.capx

  • Do you have a capx?? im lost with those functions :D

    dropbox.com/s/yzcgedoy5ev9mgd/Rotate%20around%20%28X%2CY%29%20by%20%28Sin%2CCos%29.capx

  • My object is spawned randomly inside the map, added your values but it's not working at the moment

    i don't see my object rotating

    If you spawn the object randomly then based on neverk set up you should change the (Xpos & Ypos) to the

    object spawned cordenates example:

    (Trigger where you Spawn the object): Action spawn Object

    Set>>>> Xpos = Object.X

    SetY>>> Ypos = Object.Y

    Also, make sure when you use the set position you put it under an (every thick) event as neverk explained

    Every Thick: set position

    x = xpos + cos(tickcount)* radius

    y = ypos + sin(tickcount)* radius

    Update: ups to late :) I see that neverk updated the post

  • Great man!!! I really really appreciate it. Finally I do understand the logic of managing instances.

    No problem mate

    I solved the double tap issue!!!

    Glad you manage to solved

    Issue:

    -I hope you don't rely too much on that (Event 2) as it doesn't look right :)

    -Event 5 is not gonna Work either

  • I indeed have read about containers, but got it the wrong way. By saying take one object, create a container and then add more objects, I thought it was kinda sub-events, one being parent, so my (wrong) underdtanding was:

    -if I destroy troop (parent), arrow gets destroyed

    -if I destroy arrow (child), troop stays.

    So nothing about it. Just behaving as a regular group. Lesson learned!

    No Worries mate

    The issue about "calling" arrows is a matter of idiom. I meant that I could pick an arrow based on its troop IID and viceversa. They should be supposed to have the same IID. So if I have global variable ActiveTroop set to Troop.IID on touching that troop, picking its arrow would be pick nTH (ActiveTroop). It may serve for picking both troops and arrows without adding another variable, let's say ActiveArrow. Just thinking in advanced for future functions. Or some way of doing the arrow drag&drop method.

    The purpose of the containers is to avoid what you trying to do "Adding More conditions" to pick the Arrow linked

    This is how it works

    if you Pick a Troop the Arrow gets Picked swell automatically

    or

    if you Pick an Arrow the Trop gets Picked swell automatically

    so meaning if I pick a Trop I can straight away make Actions to Arrow as is on a container and C2/C3 knows to which arrow I'm talking about

    Example I can do this:

    Pick Troop By (Whatever Method you like)

    Action: Set Arrow to (Whatever you like to Do)

    you see I didn't need to Pick the Arrow by Variables or IID because comes automatically Picked with the Troop, they are always together and they get destroyed together and they get Picked together

    Or I can do the vice-versa also:

    Pick Arrow By (Whatever Method you like)

    Action: Set Troop to (Whatever you like to Do)

    you see I don't Pick any Trop by Variables or IID

    If you don't want to use Containers and you prefer Picking by Variables I recommend the simplest method and secure by storing the UIDs on an "Instance Variable"

    Create an instance Variable on Arrow, Example lets call it "Parent" as a variable Type a Number so you will do

    On start of Layout:

    For Each Troop:>>>>Action: Create Arrow >>>>Arrow Set "Parent" to Troop UID

    Now you have linked them and if you need to Pick Arrow linked to a Troop you Do

    Pick Troop By (Whatever Method you like)

    Second Condition: Arrow.Parent = Troop UID >>>>>> Do your Actions

    That's it

    Picking by Nth they way you do is gonna give only troubles, Read Tutorials as I advise you they don't take long to finish them

    When I talked about creating, I was stating the case in which I didn't add instances on the layout, yet creating them with events on runtime. To make sure their arrows are created in the same order and share IID. In my capx, there are two troops but only one arrow, so the other arrow has to be created 'by the container'.

    I see what you mean

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I mean- I have two troop sprites with an arrow for each into a container. I call troop and arrow by IID. When touching troop, creates arrow, when moved to arrow, ot gets destroyed. Next time that arrow gets created, gets assigned again the previous IID, due to being related to the troop IID through the container, or simply stacks as the last IID?

    =============================================================

    A

    =============================================================

    I call troop and arrow by IID. When touching troop, creates arrow?

    I don't know what you mean how can you create if you already calling the Arrow & Troop meaning the Arrow was already create

    also if you create another arrow a Troop will be created with it

    when moved to arrow, ot gets destroyed.

    Again if you destroy Arrow the Troop will be destroyed with it

    Next time that arrow gets created, gets assigned again the previous IID

    if it was only one Arrow on the Game and you destroyed and created, Again and again, it will be always

    IID =0 because that's the index on which is been created if you had more arrows still on the Layout it will give him a different IDD

    Did have a look at the Manual?

    scirra.com/manual/150/containers

  • You do not have permission to view this post

  • Not necessary at all the double tap trigger. I wanted a three step method in case you wanted to change your mind once you had touched on target tile. So after touching target tile and "deciding it's ok" you 'do something' to lock the target. Because each troop is not going to move at the time target is chosen. You go picking troops one by one and targeting. Then, at the end of turn, every troop moves. Also in case you decide to choose another troop once you have already touched onto a target tile.

    Ok that's new Info you see, the problem you gave to much info in one go and it was not clear what you trying to do, if you just tried to give simple steps of what you were trying to do most probably someone would have already gave you what you need.

    When I say simple I mean just make steps example

    1-Is Game troops they all will move on the same turn at the end

    2-To Give them a Path to move you have to touch object then touch tilemap to set coordinates for that object

    3-You can cancel object Path by etc......

    4-Arrows >>> I dont know what is going on with the Arrows so >>>>bla blaa blaaaa etc.....

    5-And so on

  • Double tap is definitively a problem. The first touch repositions the arrow if not touched on the exact point, because it recognizes the tilemap being also touched. So it is always a tap on arrow/tilemap followed by another tap on arrow/tilemap. Is there a way of making the tilemap "untouchable"? Being that the case, I can allow to touch the arrow to lock the target without touching the tilemap and triggering the reposition.

    That's Why I omitted it on my example as is confusing Plus you gonna have to do many extra Events + Conditions unnecessary just to accommodate the double Tap so it doesn't interfere touching with either (Troops or TileMap)

    is it really necessary to do the Double Tap? I will just keep it simple like the example I give you where I locked everything by steps (Touch Troop and Touch TileMap to set a Path) other ways it's Locked you cannot move

    I'm gonna have to recommend you to slow down take a breath and start from the beginning but start by following some Tutorials so you can understand the Basics, once you that all the problems you have now you will be able to resolve them very easy.

    I say this as an advice because I see like you trying to do everything in one go and you get overwhelmed as you can see on this thread, there are Pages and Pages of different questions an many of them have been answered already but you still don't see them, I personally got lost I don't know what you are trying to do, there is so many info and questions and problems on this thread its hard to follow plus there is no Time to read all the different problems properly. I give you an Extra Capx to follow see if you can understand by studying it

    Here are some Tutorials:

    scirra.com/tutorials/253/how-to-make-a-platform-game

  • But I am not using nTH (which I suppose it's the one that takes the IID, referenced just for their sprite, so being into a container and created at the same time as their parent object, should always have the same IID, if I understood what you meant), but pick by evaluate variable

  • Hi santiagoestrade

    You have many errors there I didn't spend much Time to find all of them but I give you the most importants

    The First is Picking:

    The System Pick Nth Instance is different than Pick by UID

    System Pick Nth Instance = here You give IID of the objects

    Pick By UID: Here is where you give the UIDs

    If you don't know exactly or you get stuck, make some Debugs Txt to help you Debugging

    Here is one example so you understand what is UID and IID

    https://www.dropbox.com/s/a0ql8mcmxgle5c9/Picking%20UID%20Vs%20IID.capx?dl=0

    Activate and deactivate Events 5 & 6 to swap between them to see the difference

    Second Thing Triggers:

    Events that have The Green Arrow are "Triggers" this means that they run just once not very thick so the event 6 it will not do what you trying to do, you have to do it under some event that is true while the Player is Moving so Triggers are not suitable for this. Plus the triggers is most suitable to make them on the Top Events unless its really necessary

    You see you did the opposite event 2 the top event is true everythick an you put the triggers under it so the top event is Picking constantly, you should change it and put it on subevent of a trigger like on tap tilemap so it will pick the object only when is necessary not every thick

    This all for today :)

    I made a demo for you, but I couldn't read the whole explanation because I didn't have Time so it may not be exactly what you trying to do but it will help you and also I didn't look for 100% bugs free so you may stumble on some

    I hope it helps

    Link Capx: https:// dropbox.com/s/dtqzxlni8zj3knz/Chees%20Example.capx

    Strange doesn't let me post Links to the Capx so I split it

tarek2's avatar

tarek2

Early Adopter

Member since 26 Jan, 2016

Twitter
tarek2 has 12 followers

Trophy Case

  • 8-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • x5
    Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

15/44
How to earn trophies