Author Topic: Some questions.  (Read 1286 times)

First, how do I set up a global variable that saves like a $pref? (I never figured out what Trader told me.)
Second, what methods are there (besides scowering the forum) to find 'parent' functions? (For instance, ::onDeath)
Finally, I remember there being a command I could type in that would deconstruct an object and give me all the characteristics of it. For instance, I could deconstruct a player-type and get its Max Health.

Also, I cant open my command prompt with the tilda and it's pissing me off at this point. Hao2fix?

1: $stuff::<put stuff here>
export("$stuff::*","filenameandpath"); when the server closes.

3: well, tree(); then find the datablocks would work, or %player.getdatablock().maxhealth I think.

1: $stuff::<put stuff here>
export("$stuff::*","filenameandpath"); when the server closes.

3: well, tree(); then find the datablocks would work, or %player.getdatablock().maxhealth I think.

qwertyuiopas I believe it is against the rules to re-make accounts after being banned.

Or PlayerStandardArmor.dump(); in console for the last one if I understood correctly.

Get or download a copy of Blockland v0002. Look in fps/server/scripts, most of the functions in game.cs and player.cs are very similar to the 'actual' functions in Blockland v8. Some things like "getSpawnPoint" will have changed to accomodate for minigames, but the names and arguments of functions generally stay the same.

All of these answers were incredibly useful; Thanks.

1: $stuff::<put stuff here>
export("$stuff::*","filenameandpath"); when the server closes.

This really isn't working as I would like it to; is there an alternative?

The two things it does that is annoying is how it overwrites the previous version of the file and saves arrays in an ugly fashion.

For instance, lets say my current file is:
Code: [Select]
$Foo::Bar = 10;
$Foo::Hello = 9001;
$Foo::World= 5;

and then I declare and save the variable "$Foo::Bar[5] = 101"

The result is this:

Code: [Select]
$Foo::Bar5 = 101;

You should be doing

export("$Foo*","file.cs");

Make sure you execute the file.cs before exporting $Foo again or it'll just overwrite.

...and saves arrays in an ugly fashion.
That's exactly how arrays work in torquescript.

%array[0] == %array0

...and saves arrays in an ugly fashion.
That's exactly how arrays work in torquescript.

%array[0] == %array0
They also work like this:

%array[0,1] == %array0_1

It may cause problems if you were to try and use:
%array[0]
and
%array0
to hold different values and still needing both of them.
So, please, be smart about variables, if you dont like the way how export(string variable, string filepath, int append); works, then make your own export function, by using a counter, and FileObject.writeline(string line);