Euflorium: The Eufloria Community
Eufloria => Eufloria Classic => Eufloria Classic Mods => Topic started by: annikk.exe on May 30, 2011, 08:49:38 PM
-
What's the best way to remove a tree?
tree.Active = false and tree:Die() don't seem to work for me.
Maybe asteroid.Active = false, then create a new asteroid without a tree, and renumber its ID to that of the just-deleted asteroid?
-
I don't think there is any proper way to remove stuff by scripting it, but you can, if it is all about the RoidForge, "delete" the asteroid by setting radius to 0, add a new exact copy of it and make it in the output file, replace where the first one should have been. This is actually very simple to do :)
-
That means that the old asteroid that was deleted, lets say it's Asteroid(5), would still exist with a radius of 0... and instead you would have a new asteroid with a new ID. If GetAsteroid(5) is "deleted" in this way in a level with asteroids 0-20, the replacement asteroid will have ID 21.
If you have any kind of advanced scripting going on at all, this can cause problems.. So then you have to start swapping around ID numbers to keep things tidy, and you have to make sure you store the 0 radius asteroid out the way so it doesn't interfere with the sending arrows of the user interface... it's just not a very elegant method. There must be a better way.
-
No, don't directly affect the IDs, but when the output file will be made you'll have another array, asteroid ids, which is counting upwards untill it reaches the last asteroid. Now when you remove a tree or something just create a new, change the id of the last one to the new one(not directly still!) and the output file will still print out the same ID, just with different amount of trees, hope you got all that :)
-
You seem to be talking specifically about RoidForge. I see how your solution gets around the problem for that application, but what about more generally?
Has anyone ever managed to remove a tree from an asteroid without first removing the asteroid?
-
I haven't. I've actually never tried either though...
-
What about an asteroid? Is it possible to completely remove an asteroid from play, so it doesn't exist at all? Not including setting radius to 0. :> (because the asteroid still has a valid ID)
-
Experimenting like... like... well, lets just say I try to help :)
Edit: I don't seem to find anything that gives a clue about removing something completely... I tried tree.Remove,but it turned out to give alot of info about intern stuff it seems?
So as far as I see, there is no real easy and elegant way to remove trees properly. Sorry...
-
Ok, in that case which non-easy/non-elegant solution is best? :>
Ideally it would be simple to implement, and doesn't leave mess like misnumbered asteroid ID's. And it has to remove the tree, of course.
-
Good luck with the findings. You can intentionally change the IDs of the asteroids by doing roid.ID = x. Just tellin', but it is very risky and might crash the game.
Good Luck