Building system

0 favourites
  • 9 posts
From the Asset Store
Isometric Stategy Roleplay Game Building and Streets Pack.
  • hi there im trying to make a building system but im trying to make it universal and save tons of coding by using families. but im not sure how to use families to do what im trying i was debating using UID but im wondering if anyone can help

    so how it starts is ive got loads of building plots (all in 1 family)

    on family clicked i want the system to know what object was click while bringing up a menu off what to build, then on building clicked place that building where the selected building plot is.

    i was debating doing it on family clicked set variable to family.uid

    and then somehow construct building at uid.variable. the problem is i hear UID is very unreliable

  • You can do it two ways. You could not use families as families are only needed for when you're applying something to all of the buildings. So when you select building C from the menu, you just create building C, no need for families.

    Or you can use family instance variables. You have a family of buildings, bldA, bldB, bldC. If you go to the menu and select bldC, it creates a building, and sets family instance variable type to C and elsewhere you have logic that links C to the animation, properties of bldC.

  • hi there thanks for the reply, i did debate not using families but i thought that would require alot of coding and was wondering if i could make it easier but it seems i have to do it the long way

    thanks again for replying

  • There is probably a shorter way of doing what you are planning to do. Describe the exact building steps and selection as it's not totally clear with the plots and buildings.

  • okay, im gunna have about 15 plots which u can click

    once clicked it will bring up a menu off buildings

    you can click on a building and it will build it at the selected plot

  • Give the plot family a boolean variable, something like isSelected. When clicked set the variable isSelected to true for that plot. When the list of buildings comes up, build the selected one on the plot that is set to isSelected=true.

    Logic will be something like :

    Plot(family) on clicked, set family instance variable isSelected=true, load building menu.

    Building (from menu) on clicked, create building at plot(family) where isSelected=true.

    Plot(family) set isSelected=false. (clear)

  • i knew something simple was out there

  • I gamble that you have a problem with families spawning (building) a random member. In the first place.

    But that is easily to overcome. And without plugins. So, i (am still so free to) guess that you want to do something like this. ... .capx?dl=0

    Families is the way to go.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • thanks for the reply and i never had random spawning, but i was thinking of trying UID to pinpoint, but i felt this was the wrong approach so i thought i would ask everyone before experimenting, im using families now and yeah your right they work a treat

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)