1
2
Jun 22 2008, 6:35 am
In response to DivineO'peanut
|
|
Ok, but as I told before, I wrote this on my Naruto game and I tought that putting this here was a good idea to help other people (including newbies) not to start wars...
|
In response to Techgamer
|
|
Mine works... it might not work on you because you don't have the vars and procs I have in all of the code. I just wanted to state that you can use the turf vars to edit Guild Houses Owners instead of going to the source...
|
In response to Cybork
|
|
The problem isn't that your code doesn't work*, but that it relies on very bad programming practices
*: While it may seem to work properly for now, there's a high chance in the future when you add things to your game suddenly you'll have lots of runtime errors and wrong behavior you'll have no idea from where it came. Regardless though, your system is simply not done in a good (or proper for that matter) way. Sorry. Among the problems in your code are (including links to more info in other topics, usually in other posts of mine (because those were the easiest to search for)): --Large doses of usr abuse, usage where it is invalid to use (movement procs...most procs apart from click-procs...). --Using Enter() incorrectly where only Entered() is applicable (1)(2)(3). --Setting the loc variable directly even in systems that rely on movement procs (<s>Enter</s>Entered()...) to behave.(1)(2) --Using too many strings needlessly, including setting stuff to empty strings. --Checking values for being false with == operator instead of doing it proper and using the ! operator if you need to "flip" the results. --Certain design flaws, such as making the mob keep track of the house's exit instead of the house itself. |
In response to Kaioken
|
|
Ok dude, thanks for the tips =D
|
In response to Popisfizzy
|
|
I found something wrong with my code, once the server is rebooted the turf var will change...
Anyway to fix that without a "turf save system" ? |
In response to Cybork
|
|
Cybork wrote:
I found something wrong with my code, once the server is rebooted the turf var will change...Some sort of save system is necessary, unless you change it during runtime or in your code... |
In response to Naokohiro
|
|
How would I make one for turfs ?
|
In response to Cybork
|
|
Do a forum search or search the resources for a map saving library.
|
In response to Naokohiro
|
|
turf world Made all this and whenever I reboot it doesnt work =S help please. |
In response to Cybork
|
|
Help please...
|
In response to Cybork
|
|
Why are you setting a turf's variables to another one of its own variables? That doesn't make much sense, you don't need two variables when you're only storing/using one piece of data.
Shouldn't the "var/list/L=new" line be "var/list/L=list()"? No sense in using F[""] either, might as well stick with F["turfs"], and what exactly are you trying to do anyways? |
In response to Naokohiro
|
|
The system in the first post has a flaw: Whenever the server shutsdown the hideout var turns into "Available". So I'm trying to create a turf save system so that the hideout var remains, but the one I tried doesnt work... That's why I need your help
|
In response to Cybork
|
|
The way you're handling it, doesn't make much sense, since you're setting its var to its own var, then when you load up, you're not even using the var that you saved in the savefile. There's many ways to do it.
Here's one way: proc |
In response to Naokohiro
|
|
Naokohiro wrote:
Here's one way: var/turfs[world.maxx][world.maxy][world.maxz]//makes proper list And here's another way; there's no need for a 3-dimension list. var/list/turfs = new Or you could simply save the turf itself, which should be good enough (probably better). Turfs' coordinates are also automatically saved and loaded by default if done by an object save. Of course, it'd also need tweaking to be actually used. Saving ALL the turfs on the map in a savefile isn't a very good idea, and you only need those with a changed hideout var, if you'd be using that implementation. |
In response to Naokohiro
|
|
You probabbly missunderstood me... the hideout var is:
turf/var It is a text var, not a location =S |
In response to Cybork
|
|
We knew what you meant, and the examples we showed would work for any kind of var, be it a text var, a location, a number, etc.
Kaioken was pointing out, though, that it might be better to only save turfs whose hideout var was changed, which is a simple if statement. |
In response to Naokohiro
|
|
That's what I wanna do XD but the code I made doesnt work
|
1
2