New to the forum? Say hello in this topic! Make sure to read the rules.
RULE NR 3 UPDATED: Don't hurt, harass or provoke other forum members or people.

StartScript with additional parameters

Share questions and tutorials related to the ScriptAPI and give suggestions for new functions you want to see.
Forum rules
By using the forum you agree to the following rules.
Post Reply
User avatar
JakSparro98
Superfighter
Superfighter
Posts: 257
Joined: Fri Jul 15, 2016 7:56 pm
Started SFD: PreAlpha 1.0.5
Location: Rome, Italy
Gender:
Age: 19

StartScript with additional parameters

Post by JakSparro98 » Fri Sep 29, 2017 12:35 am

To quickly adjust some effects of scripts in runtime I would suggest adding the possibility to start a script as functions like StartScript Example("hello",4).

With a string parser could be possible do the trick, since, as I think, the command searches for a script name matching the string, once the parser find a bracket in the input string it splits it in two, one for the name search and the other piece is parsed again to extract the parameters.

In a script that can handle extra parameters there will be a function to catch external data passed from the console:

Code: Select all

public void main(ScriptArgs[] args)
{
	foreach(ScriptArgs temp in args)
	{
	//some code
	}
}
The ScriptArgs class will provide only one attribute, his only purpose is to act as bridge from the command interface to the script interface.

Object Content -gets the object of the parameter.
1 x

User avatar
Danger Ross
Superfighter
Superfighter
Posts: 78
Joined: Thu Mar 31, 2016 12:56 am
Title: Competition
SFD Alias: Danger Ross
Started SFD: 1.0
Gender:

Post by Danger Ross » Fri Sep 29, 2017 2:48 pm

I'm sure some form of this would be implemented once Gurt adds chat reading.
1 x
sorry bucko, you can't punch with swords 8-)

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest