tarek2's Forum Posts

  • 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

  • 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

  • OK great thanks tarek2. Still getting used to c3. Think I put them on same layer in c2 as was restricted to number of layers. Thanks again 😀

    No problem mate

    If you ever need it to work with one layer only you can just change the Z-order, one way to this is by Right click on the TileMaps it will open a window go to Z-Order then choose "send to the bottom of the Layer" so the next time you try to select a Tilemap the one that was on the bottom it will be now on the Top so it can be selected

    have fun

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi kossglobal,

    I've created a c3p that replicates the issue on onedrive.

    https://1drv.ms/u/s!AuK9l4B5C4bGiWVAZy27lOm5fI0o

    As you can see I've created 2 tilemaps that use 64x64 tiles.

    I added some of tilemap 1 to layout first.

    I then added some of tilemap 2 to layout.

    Went back and added another tile from tilemap 1 ok.

    Now I can't add anymore of tilemap 2 or delete any of it.

    Thanks

    The problem is because you added the two TileMaps on the same Layer so when you click on them only the top TileMap object is selected. to avoid this and to make the life easier put each TileMap on their own Layer and Lock them. So whenever you need to work on any of the TileMaps Example:

    You need to work on TileMap1 then Unlock the layer where is TileMap1 located and Loock the Layer where TileMap2 is located so they don't interfere between them this way when you select a tilemap it will select the Right one

  • You do not have permission to view this post