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.


Messages - RTBARCHIVE

Pages: 1 ... 5 6 7 8 9 [10] 11 12 13 14 15 ... 203
136
Gui positioning helpers (setPosition and setExtent should already exist; come on TGE):
Code: [Select]
// Get the gui's X coordinate
function GuiControl::getLeft(%this)   {
return getWord(%this.getPosition(), 0);
}

// Get the gui's Y coordinate
function GuiControl::getTop(%this)    {
return getWord(%this.getPosition(), 1);
}

// Get the position of the right-side of the GUI element
function GuiControl::getRight(%this)  {
return getWord(%this.getPosition(), 0)+getWord(%this.getExtent(), 0);
}

// Get the position of the bottom-side of the GUI element
function GuiControl::getBottom(%this) {
return getWord(%this.getPosition(), 1)+getWord(%this.getExtent(), 1);
}

// Get the width of the GUI
function GuiControl::getWidth(%this) {
return getWord(%this.getExtent(), 0);
}

// Get the height of the GUI
function GuiControl::getHeight(%this) {
return getWord(%this.getExtent(), 1);
}

// Set the position of this GUI. Seriously, this should be default for GUI controls.
function GuiControl::setPosition(%this, %pos) {
%this.resize(getWord(%pos, 0), getWord(%pos, 1), %this.getWidth(), %this.getHeight());
}

// Set the extent of this GUI. Seriously, this should be default for GUI controls.
function GuiControl::setExtent(%this, %ext) {
%this.resize(%this.getLeft(), %this.getTop(), getWord(%ext, 0), getWord(%ext, 1));
}
Not much use for these unless you're making a GUI with graphical design, but I'm sure that'll come around again some time in the future for some other purpose

137
Modification Help / Re: Scratch for Blockland
« on: January 05, 2018, 01:21:50 PM »




Script debugging & variable watching is now implemented, along with error reporting.

138
General Discussion / Re: older blockland user check-in.
« on: January 04, 2018, 08:07:31 PM »

139
Modification Help / Re: Scratch for Blockland
« on: January 04, 2018, 11:40:37 AM »

This is way better than using delimiter blocks. Thanks, Gyt.

I've worked with numerous proprietary languages, from Torquescript, to Salesforce's Apex language, as well as numerous game's implementations of existing languages, like C# in Space Engineers. In every case, even if you have the language down very solidly, you still have to learn the softwares's API; how you interface with it. What classes are available to you to use, what function should your script call to make the software do X, what should your script hook into to detect when the software does Y, etc. And that's something Blockland/Torque doesn't do a good job explaining, and if you could find a way to do that, it would be great.

For example, it's not immediately apparent that in order to make a slash command, you make a function prefixed with "serverCmd". But rather than expecting people to know that, Gytyyhgfffff gave the idea of encapsulating that into a discrete "slash command" block.

As another example, say we want a scratch script to do something when a player talks. Maybe instead of having to create a "package" block, and then a "packaged function" block, then have to know the name of the function you need to package (serverCmdMessagesent), perhaps you could have this encapsulated into a "when a player talks" block?
I will be implementing these ideas soon. Thanks

... Then, if you can provide a way of seeing in real-time what the raw code is, instead of exporting to a file and opening it, you could more easily see what the game is actually doing
I have an idea of how to accomplish this:
Export the code to a temporary .CS file, and inbetween every line of code, add a function that notifies Scratch of what line the code is on, and highlight the according block.

I'm also thinking of recording what local variables are defined in the script, saving the names of them, and exporting the 'callback' with the variable names (shown below) in order to 'watch' the variables' values.
Example:

This will be exported into config/cache/scratch_exectemp.cs with the following code:
Code: [Select]
function demoFunction(%str, %len) {
   if(Scratch::lineChangeCallback(0, %str, %len)) return;
   %str = getSubStr(%str, 0, %len);
   if(Scratch::lineChangeCallback(1, %str, %len)) return;
   return %str;
}
The script is executed, and you're then given a prompt on what function to execute (there is only one in this example), and if you want to go step-by-step. A panel is shown, displaying the raw script, as well.

Code: [Select]
// Description of the line callback function
Scratch::lineChangeCallback(%lineNumber, %arg1, %arg2, %argn) -- Returns 'true' if the user wants the script to stop at that specific line
Everytime 'Scratch::lineChangeCallback' is called, the block corresponding to the line number is highlighted (along with the line on the raw-script panel display), and the function returns 'true' if the user is going step-by-step (to stop the function). The variable values are fed into the function as arguments, so you can see what their values are.

Of course, I'll have to do a little more thinking on the local-variable-watching idea, as it's not very conventional to define 'Scratch::lineChangeCallback' with a bunch of arguments.

Sorry if the above text is just me rambling incoherently, lol

140
Modification Help / Re: Scratch for Blockland
« on: January 04, 2018, 09:05:20 AM »
What if you periodically added user-submitted function descriptions, and made it so that you could right-click (or press a key or help button) on any function block to get a quick description of it?  It might be a little more difficult and tedious, but I think it'd be worth it for that tiny bit more ease of use -- especially for people like me who tend to have to check what does what every five seconds.
That would definitely take a ton of pressure off of me, as I'm bad at describing just about anything (as evident from this thread). I'm still looking for someone to compile a list of useful functions for the 'Common Functions' menu, so when that is done, I'll just pull the descriptions from that menu.

141
Modification Help / Re: Scratch for Blockland
« on: January 03, 2018, 08:26:31 AM »
can you create/edit .cs files of vehicles and weapons or is it just for client/server addons
I plan on making it work for all script files.

142
Modification Help / Re: Scratch for Blockland
« on: December 31, 2017, 11:31:05 PM »
This is cool. One thing though, in options can you allow for code to be exported/viewed like so:

function a()
{

}


Instead of just default exporting to what you have now:

function a(){

}

I plan on adding that as a preference, along with a preference to replace three-space-indentation with TAB indentation.

Will you have each function explained? Kinda like how Google Sheets does it:
Maybe not to that exact detail, but there will be descriptions for most of the functions found in the 'Common Functions' menu.

143
Modification Help / Re: Scratch for Blockland
« on: December 31, 2017, 03:52:31 PM »

Rough implementation of this (I don't know what to call this kind of block)

As for the delimiter problem: I will be implementing the + into the call block itself.

144
Modification Help / Re: Scratch for Blockland
« on: December 31, 2017, 10:43:35 AM »
Good question here:
maybe a better way to answer your question is what default or addon functionality or content do you want to see the script to?

I know of a few useful functions that could use their own block, but I would appreciate it if someone compiled a complete list of useful functions. If you wanted to help out even more, you could make your own descriptions for them and even categorize them. It would save me a lot of time.

ditch terms like "call" ... also, dont have a field accessor
After thinking a bit on function-specific blocks, I've decided that the 'Common Functions' menu will be transformed into a sort of 'spawning menu'. Click an item in the list once to see a description, and click it again to spawn a block of it.

I believe that keeping the call block and a field accessor would provide convenience for users who need to use functions that are not specified in the 'Common Functions' list.

I agree with everything else in your post, and can't wait to see what ideas you have for this.

145
Modification Help / Re: Scratch for Blockland
« on: December 30, 2017, 09:36:17 PM »
you should make it more like scratch instead of just a colorful torquescript editor which is what it is now
I'm considering implementing a preference that switches between showing torquescript syntax and showing text -- Something like this:

146
Modification Help / [BETA OUT] Scratch for Blockland
« on: December 30, 2017, 02:26:54 PM »

   I'm working on an add-on that I believe will help just-starting coders, called Scratch for Blockland.
This project is based off of http://scratch.mit.edu/ to provide convenience to users.

   It currently supports all Torquescript operations (besides bitwise operations & ternary), exporting the blocks to Torquescript, and importing Torquescript to blocks (Supports any formatting preference -- eg. 'if (%a == 1)' and 'if(%a==1)' etc)
There is a rendering system in it that manages the blocks' position, sizes, inside connections, top connections, bottom connections, etc. that runs pretty well, in my opinion.
This also features a (rather small) function lookup 'dictionary', tooltips, block duplication, and block conversion (last screenshot).

Anyways, here comes the screenshots because I'm bad at structuring a topic.

Download the Beta
https://blocklandglass.com/addons/addon.php?id=810
* This is a BETA. It is not complete, and will update often. Please report any bugs you experience via the Blockland Glass bug reporting system.

Screenshots & GIFs














































Tell me what you think!

Thanks to Vitawrap for designing the blocks & the logo

147
Off Topic / Re: yes or no
« on: December 20, 2017, 07:29:23 PM »

148
Off Topic / Re: Kelau's Kool Khristmas Kgiveaway (4 Days Left)
« on: December 18, 2017, 10:45:22 PM »
count me in

149
Off Topic / Re: Blocklander of the Year 2017
« on: December 10, 2017, 06:05:38 PM »
conan
the brighter dark
zeblote
refticus
mocheeze

150
Drama / Re: Shizza04, to Catch a Predator
« on: December 03, 2017, 08:36:40 PM »
simpletonnn asked me to note that he is 13 years old

Pages: 1 ... 5 6 7 8 9 [10] 11 12 13 14 15 ... 203