Platform Builder Forums

Main => Suggestions => Topic started by: CGM on January 03, 2020, 09:52:46 PM

Title: Command Block Manager
Post by: CGM on January 03, 2020, 09:52:46 PM
I want a command block manager so that I don't have to constantly write and write and write the same code again and again and again. Yes, I am fully aware of copying and pasting. But some situations really need this feature. TingThing, please add this soon.
Title: Re: Command Block Manager
Post by: saiwong3268 on January 05, 2020, 10:16:47 PM
Are you asking for a library feature of routines that can be reused.

If so, Ting Thing, consider including Functions that you can pass parameters into.

Also fans can submit their own routines for inclusion into library
Title: Re: Command Block Manager
Post by: CGM on January 06, 2020, 03:38:33 AM
Great idea!
Title: Re: Command Block Manager
Post by: War on January 06, 2020, 07:52:39 AM
Are you asking for a library feature of routines that can be reused.

If so, Ting Thing, consider including Functions that you can pass parameters into.

Also fans can submit their own routines for inclusion into library
I agree!
Title: Re: Command Block Manager
Post by: Antikore on January 06, 2020, 11:10:16 PM
I think you already know I use timelines for this. Functions it's a cool idea anyways, as timelines doesn't allow to pass parameters to it. I'm very familiar actually with C# as I'm modding a lot Duck Game last months. In C# voids are similar to that.
Title: Re: Command Block Manager
Post by: CGM on January 06, 2020, 11:11:31 PM
I'm aware of that, but still...
Title: Re: Command Block Manager
Post by: Antikore on January 06, 2020, 11:14:04 PM
Yeah, timelines lack of parameter passing functionality.
I think on something like this:
Code: [Select]
function 1 = arg0, arg1, arg2
Then in functions, you can use
argument 0, argument 1 or arg 0, arg 1 etc. Similar of how scripts on GML works.
So, in the function
Code: [Select]
if arg 0 > 10
{
<player 1>You win!
}
Title: Re: Command Block Manager
Post by: Antikore on January 06, 2020, 11:16:45 PM
Maybe this will be too much but will be cool something like a return system.
So I can put
Code: [Select]
game var random = [function 1, 1, 6] //Get a value from function 1, passing 1 and 6. Being the range of numbers the function will use to randomize.
Title: Re: Command Block Manager
Post by: saiwong3268 on January 07, 2020, 12:08:24 AM
for Functions I prefer something along the style of C++

Here the function returns an value (shown leftmost) and takes two variable parameters
(note: for functions that don't return anything use void)

var GetRandom(var min, var max)
{
… do something to implement functionality
}

and would be called like

var someRandomNumber = GetRandom(1, 6)
Title: Re: Command Block Manager
Post by: Antikore on January 07, 2020, 12:17:05 AM
Well I tried to put it pb-like