tarek2's Recent Forum Activity

  • Naurgalen

    [quote:22fek3zx]PS: I checked all those things tarek2 and many more, but thanks for the suggestions!

    sure no problem, I just mentioned because I saw that the txt box from the Test Project was calling the "EnemyName" & EnemyName but maybe that was your intention

    can you share your events to display the text boxes? and how you link them to the Enemies on the Actual Project

    or if you like you can remove any extras and send me capx just enough showing the problem by pm or share it here will be easier to resolve the Problem

    For me both Methods worked fine it must be something else that conflicts with your events instead of the other, I do agree with Pinkie though that is the correct way of ordering the events

    Capx: https://www.dropbox.com/s/gb1ldgu4zq3cd ... .capx?dl=0

    Capx2: https://www.dropbox.com/s/lsobfebnnmi52 ... .capx?dl=0

  • I want to give my all-ready created enemys (objects) a "name" (instance variable) that is different from the others (enemy1, enemy2, enemy3 etc...) as it solves tons of problems for me later on.

    I use for that a global number (EnemyName) that should increase every time the "for each" works.

    The problem thats driving me mad is that it works on tests but not in the actual project!

    It sets all the TileEnemys (objects) to the exactly same name (the global "enemyname"+1)

    Actual Project Code:

    https://ibb.co/kqBLO7

    Test Code:

    https://ibb.co/m4RyAn

    I would check two things

    1-if the Global (EnemyName) from the Actual Project Code: is by mistake Type = Txt instead of Number

    or

    2-if the (Txt box) where you show the debug names are calling the Right TileEnemy.TagName

    example

    Every Thick >> Set Txt Box >>To TileEnemy.TagName

    Because this sounds weird [quote:1sb986o4]to the exactly same name (the global "enemyname"+1)

    specifically this part >> "enemyname"+1

    at last if it was wrong it should be "enemyname"+the total Number of Enemies >>not +1 only, all the enmies should have added 1 to the Global, still is wrong but it shows like you had only one enemy calling when is not that's why I will look on those places first

  • the NPCs are allowed to choose any empty plot, as is the player, the event sheet shows it waiting and randomly selecting the NPC plots but that's only because i haven't gotten round to finishing the method the NPCs use to select their plots, this method only exists for me to be able to test other features are working right, eventually what will happen will be like this:

    -plot selector starts its run over the land

    -player clicks button when selector is over the plot they want

    -plot selector begins its cycle anew

    -NPC chooses its plot when selector is over the plot they want

    -plot selector begins its cycle anew

    -next NPC chooses its plot when selector is over the plot they want

    this continues until all four players have selected one plot each, each plot is only allowed to be selected once, so the player cant choose a plot that an NPC owns, the player also can't choose a plot he/she already owns, the same rules apply to each of the NPCs, as for who goes first, in the final product the game will randomly decide which player or NPC gets to choose the first plot and which order the remaining players get to choose, after the first turn, the player who is in the lead will choose the plot first and then the other players will get to choose in order of how well they're doing.

    so the first turn will have a randomly generated order for who chooses their plots and then all future turns will prioritise the winning player (winning chooses first, then 2nd place followed by 3rd followed by 4th).

    so the limited choices the NPCs currently have will not be limited in the final product, they will have the ability to choose any plot that isn't owned simply by choosing it when the plot selector is over the plot they want

    i hope this has cleared up some of the confusion

    Kazuato All made perfect sense until I hit This again which contradicts everything

    [quote:1ifd7ngv] the player also can't choose a plot he/she already owns

    How can the Player already be owning a "Plot" if he/she is only allowed to choose one Plot and when the players turn comes to choose a plot it starts fresh there no plots selected yet?

    it looks like you talking about saving all the plot previously chosen Plots by Player & NPCs maybe?? which if is true will change the whole thing about how you build the logic

    And this leads to the "key Question" I think this is the one that is been confusing the whole thread

    How do you define a full round Game

    1-Full Game by (Cycle Rounds)

    Each Player choose his plot on their turns then their plots are saved = end of one cycle

    The second cycle >>the same Each Player choose his plot on their turns (The only difference he cannot choose any of his previously saved plot chosen) then their new plots are saved swell = end of the second cycle

    The third cycle >>>> same but cannot choose any of the whole plots previously saved in previous cycles the same and so on

    The cycles go on until they are no more free Plots to choose in the next round as already they own the whole Plots= End of one "full round Game"

    2-Each player chose their plot on their respective turns and by the end of this choose who is the winner's end and start new and fresh round, but this still leaves the same question (How can the Player already be owning a "Plot")

  • Hi Kazuato

    There are many things still not very clear and confuse

    Is the Player allowed to select another NPCs Plot?

    Is the NPCs allowed to select Players Plot?

    Basically, who can choose who, or who cannot choose who, no idea yet

    Are they all can choose Plot at the same time in the same round???

    or

    Are they doing it one by one?

    If they doing it one by one who is first??

    Are they NPCs choosing Random plot from the whole Map or just between a few lines near to them? I see in your events like the NPCs just choosing position every 1.4 secs it looks like each NPCs are limited to a few Lines Max as the White plot selector cant travel very far in 1.4 so they will be most of the times spawn in the same line, that's why I'm asking, it looks everything very linear & in order

    Anyway since are many things unclear this is the Logic I found work best for me

    -Player choose Plot first

    -NPCs they already know player's Plot so it much easier to avoid his plot, and this way they are able to choose any Random plot from the whole Map

    -wait for the Selector pass by their Matching plot then set NPCs positions

    If is not exactly what you were looking for, the best thing is to simplify in steps your logic as shortest as possible like example

    1-press button start the new round

    2-player choose first

    3-NPCs choose after

    4-they cannot choose this but they can do that and so on

    If you keep using the waits like that you gonna end on trouble sooner or later use Timers instead

    [quote:1z9h73t4]

    one suggestion i was given was to use an array instead of my current method, so i've been reading up on arrays in the mean time so i'll know how to implement the array if it turns out to be the best solution

    I think that will be the best Idea

    Capx: https://www.dropbox.com/s/247hdhonuxkyp37/NpcPlotSelector1.capx?dl=0

  • Yes! Version 6 of your example is perfect. "Overlapping (Mouse.X, Mouse.Y)" is the equivalent of a point within() function.

    This is all I meant by no function needed -- just one action:

    https://www.dropbox.com/s/z19l9ypm2xx2d ... 2.c3p?dl=1

    Thank you so much! <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy"> <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy"> <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy">

    Cool no problem mate, glad you found the solution

  • [quote:2hv0qkxu]but I was hoping to combine them so that only one function call was required, instead of two.

    netdzynr is working fine on my end have a look again I added a Debug Txt to show the Function calling Times

    https://www.dropbox.com/s/r8e144990yuhp2m/TouchObject5.capx?dl=0

  • tarek2

    Please don't apologize! I'm grateful to receive your help, and your projects have been useful for me to better understand Construct.

    The example you posted is the right combination of triggers, but I was hoping to combine them so that only one function call was required, instead of two. Logic like this:

    IF

    zone is touched

    OR

    button is clicked with additional conditions

    THEN

    call function

    If this is possible, the function isn't even necessary, since there could be single (flash) action.

    Mmmm it shouldn't call twice is an "Else condition" >> it Runs the top condition or the Else if the previous condition didn't meet the condition, I'm gonna have to check now in the meantime

    Much better solution you save checking the extra conditions

    https://www.dropbox.com/s/52pvsg9tt3v4cg7/TouchObject6.capx?dl=0

  • tarek2

    Thanks once again. By looking at your example files, I was able to get a solution that seems to work.

    The goal was to make a sprite respond to a touch/click action, regardless of whether a button appears on top of the sprite. But interaction should only occur within the rect of the sprite. I used the Bbox properties of the sprite to establish the active (clickable) region for any button. You'll see that when a click occurs within the rect occupied by BOTH the sprite and the button, the trigger takes places. No trigger occurs when clicking outside the rect of the sprite. So this effectively acts a way to make the sprite react even when a button is overlaid on top of it.

    Construct 3 project

    https://www.dropbox.com/s/wxpwp0ms6ozmk ... d.c3p?dl=1

    Thanks again for your helpful projects.

    Upss That's too bad I understood wrong again lol <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile"> I thought that the button had to be inside the Zone, I see now that you were looking for the Touch (X,Y) specific coordinates jeje I guess I'm so slow motion, but slowly we getting there

    Glad you fixed man, well done

    [quote:1gjbipns]BTW, I wasn't able to find a way to combine the sprite touch and the button click into a single "or" event. Is this not possible because they are two different types of triggers? Like:

    zone is touched

    OR

    button is clicked

    Something like this maybe?

    https://www.dropbox.com/s/r8e144990yuhp2m/TouchObject5.capx?dl=0

  • tarek2

    man, this is just an example, there are situations where it is necessary to use groups. I'm not playing frogs, that was just a stupid example .....

    Indeed the request looked very stupid and weird the way you represented

    You asking for someone to spend their free time to make a plugin which is not very clear if is a (paid or free job) and you couldn't even support your request with a good argument to why is really needed just >>> "just a stupid example"

    do you think anyone will take you seriously?

    [quote:1559o5ic]there are situations where it is necessary to use groups

    Can you share a few of those situations?

    I'm curious now

    If you are lucky and manage to make the Pugin what will you gain from this Method that you couldn't do with Booleans?

    Is in it the end goal the same?

    Boolean is "Active"

    Sub Event: Do your staf here

    Groups is active

    your staff here

    Now even if they make the Plugin you requesting how would Construct know if Each "Group" from Each "Frog" or whatever objects have to be Active for that particular objects??

    wouldn't have to Loop through the objects to know this object has the group Active or False then run the code? doesn't sound Exactly like a Variable Booleans Job

  • tarek2

    I think that will work, thanks. The method is "cheating" a bit because if a portion of a button falls outside of the rectangular region of the sprite, the sprite is still triggered, but this is probably good enough for now. Perfect that multiple instances of the button will trigger the sprite as this will be my situation: multiple buttons stacked on top of each other, stacked on top of a sprite.

    if I understood properly unless the button is inside the rectangles parameters will not trigger yess?

    Now That I understand exactly what you trying to do I can give you a different option

    1-https://www.dropbox.com/s/ke8jw46fep8ox6w/TouchObject3.capx?dl=0

    2- https://www.dropbox.com/s/nh2z6tstlabi1o6/TouchObject4.capx?dl=0

  • hello. i am having problems with groups. i have a object called "frog", when the frog is in the trap the group "walk" disable, but if i have 2 frogs and only one in the trap the 2 frogs stop. I want to know if you can make these groups work in the 2 "frog" independently, that is, if the group stops only to stop for the "frog" that is in the trap for each. so, somebody can make a plugin that makes 1 group work in 2 or more objects independently? thanks.

    Two Frogs only? why not just add a "Boolean" to the Frogs??? and you save the hassle of the Plugin and maybe some money

    The Booleans work the same as "Groups" but individually to the objects just add a boolean "isTraped" to the Frogs then you can do

    Frog Is not Traped

    Sub Event>>Do your staff here

    Else Frog IsTraped

    set walk disable

    Triger once while true

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks for this, but unfortunately when overlaying a button on top of the objects, the button grabs the touch event and your player object doesn't respond. Even if the button is disabled in the editor, the touch event still seems to be blocked.

    This is why I'm wondering if there's some other way to simply test whether the touch/mouse falls within the rectangle occupied by the sprite (or the region on the screen).

    Haah I see what you mean now

    will this work for you?

    https://www.dropbox.com/s/0bah1qp7537rw6j/TouchObject2.capx?dl=0

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