Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
limit number of dynamically created entities
Kreekakon Offline
Pick a god and pray!

Posts: 3,063
Threads: 70
Joined: Mar 2012
Reputation: 124
#7
RE: limit number of dynamically created entities

Well personally I'm not sure if setting something as inactive will remove a lot of the computer stress, but if it does here's another idea that you can use:

Still set another localint which calculates how many stones there are. When it exceeds 100, start ticking adding another localint which starts at 1(We'll call it "stonenum" for now)

Then you can do something like this everytime you add a stone:

SetEntityActive("stone_"+stonenum, false);
AddLocalVarInt("stonenum", 1);


The reasoning behind this should be simple enough. If you need more elaboration, I can explain it in more detail.

EDIT: This is untested script that I based off of another method I solved a problem of mine. May, or may not work.

[Image: Tv0YgQb.gif]
Image by BandyGrass
(This post was last modified: 02-10-2013, 06:41 PM by Kreekakon.)
02-10-2013, 06:39 PM
Find


Messages In This Thread
RE: limit number of dynamically created entities - by Kreekakon - 02-10-2013, 06:39 PM



Users browsing this thread: 1 Guest(s)