Author Topic: My General Questions  (Read 813 times)

I need to find a reference to those things past the :: marks on functions and stuff.

Anyone have one?
« Last Edit: December 06, 2011, 09:14:14 PM by brickybob »

Call the .dump() method on the objects.

- Find object of that type
- OBJECTID.dump();

Or do you mean the arguments? (eg %a, %b, %c)

Those you can just use trace(1); for

just
- disconnect from RTB
- trace(1);
- make it happen
- trace(0); before your console gets flooded

- Find object of that type
- OBJECTID.dump();

Or do you mean the arguments? (eg %a, %b, %c)

Those you can just use trace(1); for

just
- disconnect from RTB
- trace(1);
- make it happen
- trace(0); before your console gets flooded
How do I find the object ID?

How do I find the object ID?
It'll be the number that shows up in the brackets after the function name.

How do I find the object ID?

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

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?

.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);
}

I need to find a reference to those things past the :: marks on functions and stuff.

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

Code: [Select]
new scriptobject(test)
{
lolz = "herp derp";
};

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

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.

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.

Any class or object can use this stuff, not just scriptobjects.
And thats why you can make %client. functions like this:
Code: [Select]
function GameConnection::messageCl(%this, %msg)
{
    messageClient(%this, '',%msg);
}
To use that, just do this:
Code: [Select]
findClientByName(name).messageCl("message");And that will message that client.