Scap's Recent Forum Activity

  • Thanks! It's working now! Actually I used it before, and now I got what was the problem earlier. I want to use the first animation frame and I sat "set frame 1" action. But the "1" is not the first it's the zero....

    Anyway It's wokring now thanks for you. Cheers!

  • Hello,

    In the construct 2 have any specific code/option which simple detect/notice if a variable change?

    Details:

    I have a "player_orientation" variable which change according to player movement direction. (0-left,1-right-2up-3down)

    I need it for a lot of reason and it's working fine, but I got problem now and I need this "changing detector staff" if it exist for this.

    Thanks!

  • Hello,

    I'd like to set the firs frame in the "Run_right" animation when my character jump. When I used the "set frame" option I saw that I can't choose which animation I want.

    What is the solution?

  • Thank you for your answer! With your help I could to do it. I tried the "for each" but it didn't work properly in my situation, but therefore I learned the properly use of compare instance function. So, the solution very easy now:

    Conditions:

    • On left button clicked on Builder decrease icon (minus button)
    • NPC Compare instance variable: NPC; "function" equal to "builder"
    • Pick a random NPC instance

    Action:

    • NPC Instance variable: Set value "function" to "idle"

    Finish. Now when I want to reduce only the amount of Builders (or other units) I can do it perfectly.

    Previously, my problem was that when I want to reduce this ones, not just the type of selected units amount were decreasing (now: Builders) instead, the other ones as well (for example: Woodcutters amount too).

    Anyway, now working properly!

  • Hello,

    Basic situation: I have an npc sprite with an instance variable (name: function). I can change this variable with buttons on the screen (woodcutters + - and builders + -). This variable decide what kind of unit will be the npc. For example, I have six npc with "idle" inst. variable. I add two "woodcutters" and three "builders" and one unit stay "idle". I can decrease the unit number with the minus button.

    The problem: When I use one of this button, not only the actual unit type reduced, but also to the other type. I try to explain you with this:

    This is my units:

    • W W B B B W // The first two Woodcutters and after three Builder and finally one Woodcutter again.
    • I want to decrease the builders now, so I use the "Builder -" button. What going to happen?
    • This: W W B B B I // I as Idle, this is the basic function.
    • I wanna to get this result: W W B B I W // As I don't need three builder I have to reduce on two, but I can't isolate only the builders.

    I don't know how pick a value between the builders without the woodcutters. First I have to isolate the builders and after I need to pick a value between the three builders and give this number (IID?) to a global variable. I tried a lot of solution but a always I got something problem. I tried every "pick" condition. Actually I don't know what should I do more. Any idea?

  • Thanks! The PickedCount was the missing part. The pick by comparison didn't work.

    I had to use the "pick by evaluate" It's working correctly now

    • pick by evaluate:

    Obj: NPC

    Expression: NPC.Function = "Woodcutting"

    • Set global variable

    Npc.PickedCount

  • Hi,

    I have one npc type with a "function" instance variable. This variable consist a basic "idle" value. I have six in this npc type.

    I can change their instance variable one by one if I want. So, if I change 4 units inst vari instead of idle to woodcutting I remain 2 npc with idle and 4 with woodcutting inst vari.

    Now, I want to counting that how many woodcutter units I have at this moment and write in a global variable.

    I don't know how should I do this because I need a number to "set global vari", but have no any number except the 6 npc. How can I count how many woodcutters and idle units I have?

    I tried this method:

    Conditions:

    • Every thick
    • Pick nth instance >>> Object: NPC >>> Instance: npc.Function = "woodcutting"

    Actions:

    • Set global variable >>> ??????

    Thank you!

  • jojoe Of course I need these templates! Unfortunately I couldn't send a PM for you because I didn't reach the 500 reputations yet and until I haven't this amount (or more) not possible the PM sending. So, If you can send me one with these templates. Im sure it's going to be very useful for me! Thank you.

  • Thanks guys it's working! I can separately control the units now if I want it. I used the Pick random instances and Nth instance. I don't know the array yet, but i will learn it as well meanwhile I make this game.

    Thanks for the exemples, I check this ones and try to learning more I'm sure that I will be more "beginner" questions in the future which will connect to this project. I hope you guys will help me next time too. Thanks!

  • Try Construct 3

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

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

    I wanna to make a kind of strategy game, but I stuck at one point because I can't control the units separately.

    For example, I have four unit and one of these ones have to go to cut a tree. In my game I can not do the "select one unit and send to the tree" method! I just select the tree and marking as cutting and after one (or more) unit automatically depart in direction of the tree and will cut it. Of course not the cutting the point, only the control over my units.

    So, the main problem that all worker units start do it instead of only one. How should I solve this problem? Something about the UID/IID? I don't know...

    Each units have a unique IID number. Somehow I should use it, but I don't know how should I give an order/action to only one unit.

    Condition:

    • If I clicked a tree

    Action:

    • A unit with IID 4 (or a random units) start to cut the tree meanwhile the others stay calm.

    Please help me I really need the solve it's an essential step! Or any tip/idea?

    Thank you all!

  • Thank you!

    It's a good idea and almost working. I had to change some parameters. My next problem with this, that the ship not too precise and not go throught the object every time. I don't know what can it be the problem. Sometimes almost precise, sometimes not. That's why the enemy spaceship fire or hit or not.

    I did some print screem action because I thought it's interesting.

    The lines the ship 'footprint', the red part the 'shoot range'. I did every test 60 second and I didn't change nothing.

    1 Hit, 15 fault

    16 Hit , 0 fault

    10 Hit, 5 fault

    Nothing change among the test, just I click on restrat. I did a lot of test not just three. The result is same. Sometimes not precise with many fault and a lot os test quite precise and some avarge same the third picture.

    Thanks again, the result is not bad, I can use your idea. I'm just curious why can this be...

  • Hello

    I'd like to do that the enemy's spaceship go toward one of mine object (ship, building ...) and shoot when it close to one. If this ship reach my object need to go forwad in order to do a new attack cycle. So the ship reach this object go forward and if it's far enought have to turn away and back to go to my object (begin again the cycle, re-attack).

    However this idea is not working as I guess the basic movements (bullet, pathfinding ...) unsuitable for this method. I can to do that the npc fire if it's close enought and it's go forward toward the object but the bullet behaviour can't turn away, the patfinding if should turn, the firt thing what do it stop, and just afterthat turn away to object. I drew a picture for the ease of understanding.

    Any idea?

    Red arrow, top right - Enemy ship, npc

    Green dot, center - Object

    Greenish yelow line - Enemy movement

    1. Go forward toward object (I can to do it)

    2. Movement continue meanwhile starting fire (I can to do it)

    3. It reached the object but must not stop, just should to go foward (how?)

    4. Turn away to object like on the picture. Must not stop! (I have no more idea how can I do it ...)

    5. Fire again while reach the object. Same as 2. (I can to do it) (Meanwhile we're in the cycle/turn 2.)

    6. Go throught the object whitout stop. Same 3. step.

    Etc etc... again and again.

    Thank you!

Scap's avatar

Scap

Member since 6 Nov, 2013

None one is following Scap yet!

Trophy Case

  • 11-Year Club
  • Email Verified

Progress

12/44
How to earn trophies