Blockland Forums > Modification Help

My General Questions

Pages: << < (2/3) > >>

Chrono:


--- Quote from: brickybob on December 04, 2011, 08:44:51 PM ---How do I find the object ID?

--- End quote ---

Depends on which object you're looking for.

A client (GameConnection) could be found easily by hosting a non-dedicated and using localclientconnection
A player is done the same way as above except add .player
Any physical object in the game can be found by using the /getID chat command

brickybob:

I have another question but I don't feel like spamming up the forum.

1.How do I assign a variable to a client?  Like mana for example.

2.How do I make a schedule that updates every second?

Chrono:

.mana =  (set)
.mana += (add to)
.mana -= (subtract from)
.mana *= (multiply)
.mana /= (divide)


function yourfunctionname(%with, %some, %vars, %maybe)
{
cancel($yourfunctionSchedule);
//do stuff here
$yourfunctionSchedule = schedule(1000,0,yourfunctionname,%with,%some,%vars,%maybe);
}

mp7964:


--- Quote from: brickybob on December 04, 2011, 08:37:58 PM ---I need to find a reference to those things past the :: marks on functions and stuff.

--- End quote ---

I believe you use functions with ::stuff for script objects. I'm not very good with them, but the gist is


--- Code: ---new scriptobject(test)
{
lolz = "herp derp";
};

function test::lol(%so)
{
echo("Lol " @ %so.lolz @ ".");
}
--- End code ---

Define a script object, define a var inside of it, call a function to use vars.

As I said, I'm not very good at scriptobjects, but that should work.

otto-san:

what you made should work mp, but if there is a :: in the function declaration, it's a method.


function NAMESPACE::METHODNAME(ARGS)


Any class or object can use this stuff, not just scriptobjects.

Pages: << < (2/3) > >>

Go to full version