tarek2's Forum Posts

  • imgur com/a/ocfvT

    mikewalton206

    That's weird Did you check if you by mistake create a white sprite?

    if you know exactly how many objects you have you can go to debug and check the object count and see if it shows any extra objects other ways I think the easiest will be to delete anything important and share the capx so someone can have a look

  • Rable

    You forgot to put the "For Each">> "famsprites" after the >>cursor is over the famsprites

    as is picking more than one object

    Example:

    cursor is over the famsprites

    -For Each>> "famsprites>>>>Call Function

    It should work now

  • [quote:1m8awvjk]Hi sunfirexl

    is it something like this what you are trying to archive?

    https://www.dropbox.com/s/12nn8ylurb2dc ... .capx?dl=0

    Yes, that is the basics of what I need. However, would I be able to add a value to each of those animation frames? For example, If I want the player to select 4 tiles that add up to 24, would I be able to do that with this method of filling a grid?

    Elijah

    Yes you can do anything you like you can use Frames like on this example https://www.dropbox.com/s/bgnf3sgx33ty5ed/CreateBlocksIn_aGrid2.capx?dl=0

    Or you can add Instance Variables and do anything you imagen

    Update: I just saw that you found out already the same thing so you are good to go then congrats

  • Ups!!! that is really sad news rexrainbow did a huge contribution the community and never asked for any penny which is awesome plus his plugins are Top Class

    I personally try to avoid all the third part Plugins but there is one that I cant live without it the Amazing "MoveTo" I use it in almost every project it's simple and works smooth as butter, I always wonder how can such a Grate Plugin is not included in C2 & C3 is indispensable, If Scirra was my company I will definitely hire rexrainbow to work for me making official Plugins, another one that I will hire will be definitely R0J0hound with all the awesome contributions that he made all these years and many more contributors, at the list I will be ofering them free c2 & c3 to use to keep them on the Forum as Thank you, they win and my company Wins wins, My users win win wins Every one wins bro

    rexrainbow Thank you for all your hard work and the all the amazing Plugins that you contribute to this forum its really appreciated

  • Okay, so I am trying to build a 13 x 13 grid of (32px X 32px) blocks. Each block will be a random number between 1-10.At the start of the layout, I am trying to spawn in blocks to fill the entire grid and I cannot even get one to spawn in. I have tried using all these examples from the tutorials and no matter what I put, nothing happens. I would add a pic but I do not see any upload options for images, nor any file upload area so I can upload the game.

    Hi sunfirexl

    is it something like this what you are trying to archive?

    https://www.dropbox.com/s/12nn8ylurb2dcvk/CreateBlocksIn_aGrid.capx?dl=0

    The Link you provide to the Google drive is not working for me by the way

  • Kazuato

    [quote:1uv4t38v]sorry i forgot to mention that you get to choose a new plot each turn, the turn structure goes like this:

    -players acquire plots of land.

    -players then pick up a mule (gull)

    -players then equip the mule(gull) with a resource

    -players take mule (gull) to their chosen plots

    -the mules (gulls) stay in the plots and produce more of their equipped resource

    -the players end this stage by entering a building (pub)

    -the next stage begins in which the players take turns buying and selling resources from one another

    -the turn then ends and the process is repeated beginning with each player selecting a new plot whilst continuing to own the plots from previous turns.

    No Problem mate,

    Since we now have a clear view of what you trying to do then the Answer to your Original question will be (Arrays or Sprites) and since you mention earlier that you need to learn Arrays I will recommend you (Sprites as a Tile) because you can add variables & booleans as you need and is much easier to control, for the size of the Land area you don't need many Tiles

    Here is a Demo Capx : https://www.dropbox.com/s/1gtbbw209dcilqf/NpcPlotSelector2.capx?dl=0

    Now on this Capx at the end of every cycle waits 3 seconds and goes directly to the next cycle where they can choose again Land, I left it like this intentionally so you can Debug and see how it works and to check how they chose new Lands without selecting the already Owned from previous Cycles, and the other reason so you can add your own Logic on top of it other ways you will not learn.

    I didn't comment it because I put names to the (Variables, Booleans, Functions & Timers) that they explain by them selfs so it should be easy to follow

    -if you don't wanna use Overlap for the "selector" check my first capx, there I did it without Overlap and copy it

    Now since you already have you Logic it should be very easy to adapt it to your needs

    Example:

    New Cycle Starts

    (Acquire plots)

    -players acquire plots of land.

    -at the End of this cycle when the 4 Players choose Land instead to wait 3 secs and go to Next cycle change it

    to go to (mule (gull)) you need probably a boolean "MuleGull" so is easier to split the States from (Acquire plots) to (MuleGull)

    On (MuleGull)

    -players then pick up a mule (gull)

    -players then equip the mule(gull) with a resource

    -players take mule (gull) to their chosen plots

    -the mules (gulls) stay in the plots and produce more of their equipped resource

    -the players end this stage by entering a building (pub)

    -the next stage begins in which the players take turns buying and selling resources from one another

    -the turn then ends and the process is repeated beginning with each player selecting a new plot whilst

    continuing to own the plots from previous turns.

    -Go to (Acquire plots) Again and so on

    Looks pretty easy you cant get lost,

    Last Thing

    You Mentioned about the turns to choose Plot will be changing constantly at the End of each Cycle, depending on some Variables example Points etc......

    I added a Variable for that too >> Var "MyTurnTo_PlayIs"

    it should be as simple as adding a New Variable called however you wish, example "Points" then before you send them to (Acquire plots) do the assign (Turns to Play )

    Example

    Create a Local Var "Positions" = 1

    For Each Order

    Sub: Pick "NPC" Family >> How you wanna order? enter by >> NPC.Points >>Then Descending

    Actions>>Set NPC >>To the Local Var "Positions"

    Then Add 1 to Local Var "Positions"

    This will assign the turns to play from the NPC that have the highest "Points" which will be = 1 Turn to the Lowest which will be = 4

    One more Last Thing

    a friendly advice, the Next time you asking for help try to go straight to the Point, think what you need before you posting, write it down if you have to, don't add any extras that are unnecessary, clear, precise and as simple as possible, other ways will be like a guessing game were you lose time and the people that trying to help swell making Capx & Examples that after they going to the trash which they took some time to make

  • 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")

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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