Essentially, I cannot seem to figure out how to DISABLE an object's respawn. The object will come back [provided it was taken in the first place] every time the game auto-respawns everything as expected; however, I want one specific object to remain gone (or tack on a high enough sleep for it so that it will not respawn until the next reboot.)
The question, basically, is how do-- or rather CAN I do that?
ID:161306
May 23 2008, 4:26 pm (Edited on May 23 2008, 4:39 pm)
|
|
May 23 2008, 6:27 pm
|
|
If you delete something that was in the map file, then world.Repop() will replace it. There's no way around this except for that object not being placed in the map file in the first place. You could do some trickery with world.time, but I'd suggest that you instead stop using world.Repop().
|
In response to Garthor
|
|
Garthor wrote:
I'd suggest that you instead stop using world.Repop(). - agreed but! just code something into the object's New() that checks a global variable to determine if one has previously been made or not |
In response to Garthor
|
|
Actually, to help others with this issue, Bustercannon solved it rather quickly for me, so thanks to him:
world.Repop() The above code was used under all world.Repop() articles within the source code. Used alone this will delete all objects of this pathway in the game [including in contents and instantly following world.Repop().] obj/var/tmp/nodelete=0 This was used in the only world/New() within the source to avoid deleting one specific object of the pathway [the sword above-- the one placed on the map initially (at 38,244,2).] When combined the first code deletes all repopped version of the object immediately while the second code allows the original to survive until picked up, not returning to the game (as its replacements are deleted.) Repop is thus rendered useless against the original object but keeps others from being released until the reboot. Problem solved. |
In response to Terra6
|
|
That's really quite terrible.
If you don't want the object to be respawned by Repop(), then don't delete it. Just set its tag to something (to protect it from the garbage collector) and set its loc to null. |
In response to Garthor
|
|
Garthor wrote:
Just set its tag to something (to protect it from the garbage collector) and set its loc to null. or just set its invisibility to 1 and density to 0 to trick players into thinking its gone =P what kind of game are you making where you only want a sword available to 1 player each reboot. sounds like a bad plan |
In response to Garthor
|
|
To Falacy: It is simply a temporary event for NWOTS. It is meant to be an extremely rare weapon to make up for the lack of anything of value being in this beta version. Simply speaking, it is to tide the players over and in that regard it is doing its job.
If I were a main coder or anything approaching such (I merely fix some bugs and am remapping the game) I would eliminate the two things in the game that require Repop() and switch them to New() with a timer to bring a new set along every X minutes; however, as I am not, I merely work with what I am able to do. And to reply to the post by Garthor, may I ask, as I've seen you actively assisting people on these forums for half a decade and thus will trust your opinion, if in your experience-- while not a particularly efficient way to handle things, will this cause issues down the road? Of course, this in no way is intended to be rude to Falacy. I am just not at all familiar with you, mate. |
In response to Terra6
|
|
This will cause issues down the road if you ever intend to create more items like this. You'll have a long, obnoxious string of coordinates, for() loops, and other crap that will break if you change the map.
Generally, not a good idea. |
In response to Garthor
|
|
Understood. So long as it won't bug us like mad, I'm okay with that for the time being.
Thanks for the assistance. |