Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Greek2me

Pages: 1 2 3 4 5 [6] 7 8 9 10
76
Modification Help / Variable for Respawn Time (outside of a minigame)
« on: January 01, 2014, 11:55:36 PM »
Is there a variable for the respawn time of players outside of a minigame?

77
General Discussion / Happy Steam Users - good job guys, keep it up
« on: December 18, 2013, 12:29:37 AM »
Sorry to make another Steam topic...

Anyway, most of the Steam users seem really happy with the game and community so far. I've been spending a lot of time helping people on the Steam discussion boards and on reddit, and I've been hearing a lot of praise for how friendly the community's been. Keep it up.

Also, I was hosting a CTF server today and the new guys were all doing well. I didn't have problems with any of them and all the ones that joined were pretty mature.

Good job, Blockland.

78
Modification Help / TorqueDoc | Ready for use!
« on: October 05, 2013, 10:29:18 PM »
TorqueDoc
The TorqueScript documentation generator.

Download Script_TorqueDoc.zip

You've probably heard of programs like JavaDoc before. Here is one for TorqueScript.

It creates a web page based off of comments made on functions.

For example, this is what your code might look like:
Code: [Select]
//Documents functions in TorqueScript files and exports them to an HTML page.
//@param string mask A mask specifying one or more files. You may use the * wildcard.
//@param string title The project title, which will be displayed at the top of the navigation bar.
function document(%mask, %title)
{
%doc = new scriptGroup()
{
class = TorqueDoc;
projectTitle = (strLen(%title) ? %title : "TorqueDoc");
};
%doc.readFO = new fileObject();
%doc.add(%doc.readFO);
%doc.writeFO = new fileObject();
%doc.add(%doc.writeFO);

%doc.parse(%mask);

%functions = (%doc.numFunctions $= "" ? 0 : %doc.numFunctions);
echo("Documented" SPC %functions SPC "functions successfully.");

%doc.delete();
}


List of Tags:
  • @author - List the author of this function. Multiple @author tags should be listed in order of significance.
  • @deprecated - Use the @deprecated tag to warn developers against using a function, because it may be removed in the future. This is useful when keeping old API functions for compatibility.
  • @link - Include a link to a webpage.
  • @param - Describe a parameter in the form "@param   varType varName   Description of the parameter."
  • @private - This function is not to be called by other scripts.
  • @return - Describes what the function returns in the form "@return   varType   Description of returned value."
  • @see - Creates a "See Also" link to another function.

79
These functions are for dynamically and recursively calling methods on objects.

Code: (SimObject::call) [Select]
function SimObject::call(%this,%method,%v0,%v1,%v2,%v3,%v4,%v5,%v6,%v7,%v8,%v9,%v10,%v11,%v12,%v13,%v14,%v15,%v16,%v17)
{
%lastNull = -1;
for(%i = 0; %i < 18; %i ++)
{
%a = %v[%i];
if(%a $= "")
{
if(%lastNull < 0)
%lastNull = %i;
continue;
}
else
{
if(%lastNull >= 0)
{
for(%e = %lastNull; %e < %i; %e ++)
{
if(%args !$= "")
%args = %args @ ",";
%args = %args @ "\"\"";
}
%lastNull = -1;
}
if(%args !$= "")
%args = %args @ ",";
%args = %args @ "\"" @ %a @ "\"";
}
}

eval(%this @ "." @ %method @ "(" @ %args @ ");");
}



Example:
Code: [Select]
new scriptObject(test);
$method = "setColor";
$color = 0;
test.call($method, $color);




This function is used to recursively call a method.
Code: (SimGroup::chainMethodCall) [Select]
$ChainBatchSize = 100;
$ChainTimeOut = 10;

function SimGroup::chainMethodCall(%this,%method,%v0,%v1,%v2,%v3,%v4,%v5,%v6,%v7,%v8,%v9,%v10,%v11,%v12,%v13,%v14,%v15,%v16,%v17)
{
%batch = (%this.chain_batchSize $= "" ? $Slayer::Server::ChainBatchSize : %this.chain_batchSize);
%count = %this.getCount();
%index = (%this.chain_index $= "" ? %count - 1 : %this.chain_index);
%endIndex = (%index - %batch < 0 ? 0 : %index - %batch);

for(%i = %index; %i >= %endIndex; %i --)
{
%obj = %this.getObject(%i);
%obj.call(%method,%v0,%v1,%v2,%v3,%v4,%v5,%v6,%v7,%v8,%v9,%v10,%v11,%v12,%v13,%v14,%v15,%v16,%v17);
}
%this.chain_index = %endIndex - 1;
if(%this.chain_index <= 0)
{
if(isFunction(%this,%this.chain_callback))
%this.call(%this.chain_callback);
%this.chain_index = "";
%this.chain_batchSize = "";
%this.chain_timeOut = "";
%this.chain_callback = "";
}
else
{
cancel(%this.chain_schedule);
%time = (%this.chain_timeOut $= "" ? $Slayer::Server::ChainTimeOut : %this.chain_timeOut);
%this.chain_schedule = %this.schedule(%time,"chainMethodCall",%method,%v0,%v1,%v2,%v3,%v4,%v5,%v6,%v7,%v8,%v9,%v10,%v11,%v12,%v13,%v14,%v15,%v16,%v17);
}
}
Requires SimObject::call.



Example:
Code: [Select]
brickgroup_11902.chain_batchSize = 100; //this is optional
brickgroup_11902.chain_timeOut = 10; //this is optional
brickgroup_11902.chain_callback = "myCallback"; //this is optional - when the recursive method finishes, brickgroup_11902::myCallback(%this) will be called.
brickgroup_11902.chainMethodCall("setColor", 5);




Change Log (v1 to v2)
  • Now begins at the top of the list (rather than bottom, 0), which prevents problems when deleting objects.
  • Fixed bug where objects at the beginning/end of batch had method called twice.

80
Suggestions & Requests / Javadoc-Style Documentation Script
« on: June 07, 2013, 01:20:23 AM »
I'm requesting a script that parses Torquescript files and creates an HTML documentation file of all functions and methods. It should follow the Javadoc formatting standards, here: http://www.oracle.com/technetwork/java/javase/documentation/index-137868.html#format

It should be a fairly easy script to write. If any scripters have some spare time, I would really appreciate your work. Thanks!

81
Modification Help / Why don't the default bots have AiConnections?
« on: May 28, 2013, 07:44:04 PM »
The default bots are not parented to AiConnections. If they were, it would be a lot easier to basically treat them as players. Unfortunately, the lack of a client means that I will have to rewrite most functions for bots.

To see what I mean, look at these class hierarchies:
AiConnection
AiPlayer

Would it cause any problems if I added an AiConnection to every bot that's spawned?

82
Modification Help / TorqueScript Logic Error
« on: May 23, 2013, 06:00:54 PM »
It seems like the > operator is not working correctly in certain cases.

Example:
Quote
==>$test = 5.3;
==>echo($test);
5.3
==>echo($test == 5.3);
1
==>echo($test < 5.3);
0
==>echo($test > 5.3);
1

==>echo($test > 5.2);
0
==>echo($test > 5.4);
0
==>echo(5.3 > 5.3);
0
==>echo(5.4 > 5.3);
1

This only happens if you are comparing a variable to a decimal number. Try it yourself and see if the same thing happens.

83
Here's a couple functions that seem like they should be part of the default game. The default call function can't be used with objects, so I made my own.

Code: (SimObject::call) [Select]
function SimObject::call(%this,%method,%v0,%v1,%v2,%v3,%v4,%v5,%v6,%v7,%v8,%v9,%v10,%v11,%v12,%v13,%v14,%v15,%v16,%v17)
{
%lastNull = -1;
for(%i = 0; %i < 18; %i ++)
{
%a = %v[%i];
if(%a $= "")
{
if(%lastNull < 0)
%lastNull = %i;
continue;
}
else
{
if(%lastNull >= 0)
{
for(%e = %lastNull; %e < %i; %e ++)
{
if(%args !$= "")
%args = %args @ ",";
%args = %args @ "\"\"";
}
%lastNull = -1;
}
if(%args !$= "")
%args = %args @ ",";
%args = %args @ "\"" @ %a @ "\"";
}
}

eval(%this @ "." @ %method @ "(" @ %args @ ");");
}



Example:
Code: [Select]
new scriptObject(test);
$method = "setColor";
$color = 0;
test.call($method, $color);




This function is used to recursively call a method.
Code: (SimGroup::chainMethodCall) [Select]
$ChainBatchSize = 100;
$ChainTimeOut = 10;

function SimGroup::chainMethodCall(%this,%method,%v0,%v1,%v2,%v3,%v4,%v5,%v6,%v7,%v8,%v9,%v10,%v11,%v12,%v13,%v14,%v15,%v16,%v17)
{
cancel(%this.chain_schedule);
%batch = (%this.chain_batchSize $= "" ? $ChainBatchSize : %this.chain_batchSize);
%index = (%this.chain_index $= "" ? 0 : %this.chain_index);
%count = %this.getCount();
%endIndex = (%index + %batch > %count ? %count : %index + %batch);

for(%i = %index; %i < %endIndex; %i ++)
{
%obj = %this.getObject(%i);
%obj.call(%method,%v0,%v1,%v2,%v3,%v4,%v5,%v6,%v7,%v8,%v9,%v10,%v11,%v12,%v13,%v14,%v15,%v16,%v17);
}
%this.chain_index = %index + %batch;
if(%this.chain_index >= %count)
{
if(isFunction(%this,%this.chain_callback))
%this.call(%this.chain_callback);
%this.chain_index = ""
%this.chain_batchSize = "";
%this.chain_timeOut = "";
%this.chain_callback = "";
}
else
{
%time = (%this.chain_timeOut $= "" ? $ChainTimeOut : %this.chain_timeOut);
%this.chain_schedule = %this.schedule(%time,"chainMethodCall",%method,%v0,%v1,%v2,%v3,%v4,%v5,%v6,%v7,%v8,%v9,%v10,%v11,%v12,%v13,%v14,%v15,%v16,%v17);
}
}



Example:
Code: [Select]
brickgroup_11902.chain_batchSize = 100; //this is optional
brickgroup_11902.chain_timeOut = 10; //this is optional
brickgroup_11902.chain_callback = "myCallback"; //this is optional - when the recursive method finishes, brickgroup_11902::myCallback(%this) will be called.
brickgroup_11902.chainMethodCall("setColor", 5);




I hope you find these useful! Please suggest any changes.

84
Off Topic / Boston Shootout & Chase
« on: April 19, 2013, 01:37:33 AM »
EDIT:
At the time I posted this, Reddit and the police scanner were the only sources I could find. The Reddit page I linked was basically just a summary of the police scanner.
Here is a BBC source: http://www.bbc.co.uk/news/world-us-canada-22212946



Thought you guys should see this. There has been a police chase and shootout going on for the last 30 minutes or so.

Live updates:
http://www.reddit.com/r/news/comments/1cnwms/mods_removed_thread_live_updates_of_boston

Scanner:
http://www.broadcastify.com/listen/feed/6254/web



2:48 EST - Confirmed as marathon bombers, 1 in custody, 1 at large with assault rifle and explosives

EDIT: This is out of date

85
Drama / The phisher's website has been taken down
« on: April 10, 2013, 12:14:13 AM »
http://biockland.us has been taken down after I talked to their hosting company's customer service. (YouHost)

The rep I talked to sorted it out within minutes, no questions asked.

86
.

87
Suggestions & Requests / Keep vehicles and bots on leave!
« on: March 13, 2013, 10:55:45 PM »
There should be an option to not respawn vehicles and bots when the owner leaves.

88
Modification Help / [RESOURCE] Add Event Output Target
« on: February 17, 2013, 06:19:35 PM »
This is a little resource I made that allows you to add output targets to existing input events.

Download

Server Target Demonstration:
Code: [Select]
new scriptObject(ServerEventTargetSO);
function ServerEventTargetSO::echo(%this,%val)
{
echo(%val);
}
addEventTarget("Server ServerEventTargetSO","","ServerEventTargetSO.getID()");
registerOutputEvent(ServerEventTargetSO,"Echo","string 200 176",0);
This would allow you to create events like onActivate => Server => Echo [Hello, world!]

Slayer Teams Demonstration:
Code: [Select]
addEventTarget("Team(Client) Slayer_TeamSO","GameConnection","%client.getTeam()");
addEventTarget("Team(Brick) Slayer_TeamSO","fxDtsBrick","%this.getControlTeams()");
registerOutputEvent(Slayer_TeamSO,"BottomPrintAll","string 200 156" TAB "int 1 10 3" TAB "bool 0",1);
  • The first argument is the name of the target and the class of the target, separated by a space.
  • The second argument is the prerequisite target class. For example, the Team(Client) target will only display on events that already have a target of class GameConnection, while the Team(Brick) target will only display on events with an existing target of class fxDtsBrick. Leave this blank for no prerequisite.
  • The third argument is the code used to find the target. Variables that can be used are %client and %this.

Source Code (v1.1)

Quote
v1.1:
  • Prevented duplicate entries.
  • Added some commenting.

89
Badspot, it would be very helpful and logical if we could post links to directly join a server, just like on the server info pages.

As you can see, the links don't work on the forums:

blockland://join-209.159.159.94_31000
blockland://join-209.159.159.94_31000

However, they work outside the forums: http://greek2me.webs.com/joinserver.htm

90
Modification Help / Detect When Camera Enters Area
« on: February 07, 2013, 01:29:17 PM »
How would I detect when a camera enters an area? I've tried using triggers, but they only seem to pick up physical objects.

Pages: 1 2 3 4 5 [6] 7 8 9 10