Heroes4hire's Recent Forum Activity

  • i have gold, it gets put in the treasure room. it tells me how much gold is in a pile i can pick up the gold, and drop it, it maintains its value. and gold stacks when overlapping.

    but, i want a total owned gold figure.

    i need to check each goldpile.goldinside that is overlapping a treasureroom; and add it up.

    any ideas on how i can check for total gold owned?

    i thought about for each goldpile. set GOLDinDungeon to goldpile.goldinside+GoldinDungeon

    but, will that only work once? do i need to make a function? and call it every time gold is added to a treasure room?

    any thoughts, or easier ideas are welcomed. thank you all

  • never tried it, love it. perfect thanks so much

  • i thought that was the whole point in the hoard box? to check the number of zombies inside!

    test it by having it static, and add zombies to it. to see if you can get it to count.

    then all you gotta do is set its location to the mid point using the math.

    thats the aim right? have a hoard box so zombies behave as a whole, then when 1 leaves the hoard they can act indipendantly.

    but whatever. was just trying to help

  • "i could use dictionary and insert a name line by line. then random(1,30) on the x axis."

    is what i said. but you cant insert name line by line in a dictionary; i used the dictionary to store up to 8 values on picking up creatures to memorise their name and hp. so on dropping them i just spawn a new one with the same stats and name.

    i meant array.

    *i could use *array* and insert a name line by line. then random(1,30) on the x axis.

    * sorry if i confused the matter!

    i havent stored anything yet. wanted to know the best way TO store names.

    using an array, ill have to individually put in the names.. and.. its 30 names for imps.. each creature will have 30 names. so ill have to add hundreds of individual names into an array. possible.. but oof, that will take a day just to do that.

    is there a better method to add 30 names, per creature type? like clipboard, where i can just type out all names, and pick a random line of text.

    not a hard task, just wondering the most efficient way to do it.

    ty as always lionz

    the effect is. each creature will have its own name

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • yeah, ok. i hope i see what you want.

    box to follow the hoard (who is in the library. and to stay middle of the hoard. so when some leave, they are removed from the hoard.

    cos(B-C):\cos(C-A):\cos(A-B)

    one way of getting the centre of 3 points (triangle)

    but, thats just one way.... i think its the best, as it doesnt care what type of triangle it it

    omnicalculator.com/math/centroid

    (this website has a ton of math that you could try)

    Gₓ = (x₁ + x₂ + x₃ +... + xk) / k

    Gᵧ = (y₁ + y₂ + y₃ +... + yk) / k K is the number of zombies. G is center point

    this is the simplist i could find to get a center point for more zombies.

    so, that should find a mid point constanly between all zombies within a hoard.

    wow this takes all my time. i pray this works and i understood what you needed lol

  • yeah, on created, you need to give it a uidcheck variable. the uidcheck is for an instance of a zombie's uid. most likley the leader.

    then it always knows what instance of zombie it is specifically acting to.

    *edit* or.. is that the problem, its always choosing the same zombie, and you dont want it to choose any?

    is it you want it to set a midpoint for all zombies?

  • i have the layout scroll out with the mouse wheel.

    the hud doesnt scroll to this layout.

    sure its simple fix, but, great if i can get an answer so i can implement it tomorrow.

    ty all

  • ah yeah, i meant array. i used dictionary to store names on picked up objects.

    just seems like an hour of clicking and adding 1 to each event. but, if that is the best way im down to do it,

    ty

  • so. i want to store 30 names. then i want to call a random name on a creature spawned

    i could use dictionary and insert a name line by line. then random(1,30) on the x axis.

    but.. is that the most efficient way?

    could i use clipboard, local storage, file system: to achieve this easier?

    none of which i have experience on. so if i get the nod ill work on the favorable method.

    thanks

    Tagged:

  • ok so. heres the code i use to work out the mid point between 2 objects

    hoard.x+radius*((zombie.x-hoard.x)/sqrt((zombie.X-hoard.X)^2+(zombie.Y-hoard.Y)^2))

    that will give you x

    hoard.Y+radius*((zombie.Y-hoard.Y)/sqrt((zombie.X-hoard.X)^2+(zombie.Y-hoard.Y)^2))

    that will give you Y

    it basicly assumes the hoard box center is the mid point. then zombies will pathfind to a circumference in a circle around it based on where they are.

    you could give the zombies a IV for its own radius ( distance to the center on the hoard square) and adjust it randomly

    then, im thinking have them use 8D to always head to that point. as the hoard moves, they will move with it.

    hope its of use!

  • BaconSwagg yeah, i knew it may be in issue. its why i set the radius as a GV. maybe it just needs playing around with the figure. i tried a little, too small and they cant target the block, too big, and they can target further blocks.

    the blocks are 96x96 : radius should be 48! and that should barely let them get to the block... yet on 16, it seemed to be the perfect figure.

    i may go back to the drawing board at all on it... trying to rule out using raycasting with barely any experience on it.

    maybe i could give the blocks pathfinding... they wont move, but if they can find a path, the imps can target it.

    either way, the conversation on it helps me think, so its appreciated

  • honestly, the pathfinding will get you there. but. to constantly recalculate the path will cause lag with so many instances.

    using 8 direction will help more imo. you can just simulate movement to the point you want.

    im going out. more thoughts later

Heroes4hire's avatar

Heroes4hire

Member since 19 Mar, 2024

None one is following Heroes4hire yet!

Trophy Case

  • 1-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

6/44
How to earn trophies