Author Topic: Function to Edit the Environment  (Read 1332 times)

My code:
Code: [Select]
function servercmdGroundIsLava(%client)
{
    if(%client.isAdmin == true)
    {
        // $EnvGuiServer::Waterfile = "Add-Ons/Water.Lava/lava.water";
        // $EnvGuiServer::WaterHeight = 2.0;
        serverCmdEnvGui_SetVar(%client, "Waterfile", "Add-Ons/Water.Lava/lava.water");
        echo("Setting water to lava.");
        serverCmdEnvGui_SetVar(%client, "WaterHeight", 2,0);
        echo("Setting the water height to 2.0");
    }
}
The echo's sound of correctly however nothing happens. ;(

I'm thinking I need to somehow coding wise hit an 'apply' button or something? I'm not sure what I could be doing wrong here.

I did an hour or so of googling for a working example but I couldn't find much:
http://forum.blockland.us/?topic=203327.0
http://forum.blockland.us/index.php?topic=214452.0
http://forum.blockland.us/index.php?topic=207437.0

Thanks in advance.

serverCmdEnvGui_SetVar(%client, "WaterHeight", 2,0);

TorqueScript uses . as the radix, not ,.

serverCmdEnvGui_SetVar(%client, "WaterHeight", 2,0);

TorqueScript uses . as the radix, not ,.
Of course I'd have to have a typo however the code still does nothing except echo.

Is the client calling it an admin?
That's the only thing I have time to look for
Also I believe "waterfile" should be "WaterIdx"


I've tried a number of different commands but nothing is working. Is there something else I can try?

Run this in console and post the snippet from your console log:

Code: [Select]
trace(1);serverCmdGroundIsLava(clientGroup.getObject(0));trace(0);
It would be nice if we didn't have to mess with server commands to edit this stuff..