Currently, writing scripts for blockland/freebuild type games is troublesome. Most things you can desire to make are interacted with through ingame bricks. To have code run for these bricks, you have to create a weapon or 'wandmode' and have the code run through that.

My suggestion is to create a system where you can upload a basic, protected script instance (not associated to any other item) to a save file, and have it run by one or more bricks.

Scripts created in this manner happen to be smaller and more easily optimized than writing item code, and would make creating save-side modifications like RP scripts much less of a hassle.

Said system could work like this:

Scripts are written and saved to a client machine.
A brick is selected with whatever edit method you guys are using.
The script is 'linked' to selected brick.
Script is ran and compiled (to the 'dso' format I think).
Compiled script is uploaded to the server machine, script is placed in the server's save file or maybe a folder.
Compiled script is added to some sort of index in the save.
Save file is updated to add the script address to the selected brick's data.

To lessen greifing you could disable certain commands or maybe write your own parser for this.
for some reason i dont get the point of this(mabye you could reformat it). also if im not wrong(if i am just say so)then its very very un-secure for the client to upload stuff to the server, then the client could make some kinda "trojan" script that gives him super admin, or the like, or were you thinking of somthing else?.
Alex42 wrote:
for some reason i dont get the point of this(mabye you could reformat it). also if im not wrong(if i am just say so)then its very very un-secure for the client to upload stuff to the server, then the client could make some kinda "trojan" script that gives him super admin, or the like, or were you thinking of somthing else?.


The point is to make scripting easier. It's troublesome right now to have to code a weapon when you want to place code just on a brick.

Scripts created in this manner should not be allowed to do anything regarding server or client options. They should only be allowed to do calculations and to modify physical properties of bricks.
It's quite easy to do this. Add an onCollision method for whatever class of brick datablock you want.
ill write up a quick script when i have the time if someone doesn't do it before me
elfprince13 wrote:
It's quite easy to do this. Add an onCollision method for whatever class of brick datablock you want.


I think you missed the point entirely. I'll retype this when I'm /not/ using a wiimote.
back on a keyboard (finally)

My idea was to overhaul the scripting system to be more based on small pieces of code run (somewhat) directly by bricks instead of large chunks of code indirectly run with items. Something akin to Linden Lab's 'mono' system, where scripts are written ingame and run by objects, not the player. This kind of system greatly simplifies scripting, at what seems to be little to no apparent cost, except maybe development time.

IMO you need to do /something/ to the scripting systems, it's very messy and things like hiding brick-run code in weapon scripts is disorientating to new users.
Please explain what sort of functionality you are referring to as "brick-run" code
elfprince13 wrote:
Please explain what sort of functionality you are referring to as "brick-run" code


In the engine the abstraction of it being run by a brick shouldn't mean anything. By "brick-run code" I meant a script that the scripting engine understands applies to a certain brick and not a weapon or something linked to the client.
Sigfig wrote:
elfprince13 wrote:
Please explain what sort of functionality you are referring to as "brick-run" code


In the engine the abstraction of it being run by a brick shouldn't mean anything. By "brick-run code" I meant a script that the scripting engine understands applies to a certain brick and not a weapon or something linked to the client.
You're being really vague. What types of scripts are you talking about? What sort of things should happen to the brick? How are these scripts activated?
calc84maniac wrote:
You're being really vague. What types of scripts are you talking about? What sort of things should happen to the brick? How are these scripts activated?


Lots of times (especially when coding gamemodes), you need a script that does something activated by a brick. In an RP, one example would be a brick that gives you money when you press it. Currently, such a script would work like this:

some sort of admin held item (eg weapon) is used on the brick
the weapon script grabs the brick ID
brick ID is used in a small section of code (inside the weapon script still) that gives money to a player that activated the brick
every time money needs to be given to a player, that section inside the weapon script is run

There is no code directly associated with the brick, the weapon code is what does the work. This seems messy and unnecessary to me. My idea was to clean it up by having way smaller scripts directly associated with a single or multiple bricks, and having this kind of code moved away from items.
you don't need a weapon at all. Whenever you hit the use key, a raycast is made for finding vehicles. Simply add an extension to trigger code attached to a static shape when one is found by the raycast.
Sigfig wrote:
Lots of times (especially when coding gamemodes), you need a script that does something activated by a brick. In an RP, one example would be a brick that gives you money when you press it.

elfprince13 wrote:
It's quite easy to do this. Add an onCollision method for whatever class of brick datablock you want.


Sigfig wrote:
Currently, such a script would work like this:

some sort of admin held item (eg weapon) is used on the brick
the weapon script grabs the brick ID
brick ID is used in a small section of code (inside the weapon script still) that gives money to a player that activated the brick
every time money needs to be given to a player, that section inside the weapon script is run

In fact it wouldn't.
You guys /still/ aren't getting it. It's not that these kind of scripts aren't possible with the current system, it's just that they're not straight forward for people customed to other engines.

Regarding the "no it wont" comment, that's the most common usage in all blv002 RP script's I've seen. This is how the community does it, at least.
If I add a goddamn extension to the use key's raycast to look for and execute code on bricks when found(under a certain tag) while I overhaul the damage system, will that satisfy you? All you'd have to do is write your script and add it to the brick. Hitting enter(or b in FreeBuild's case) would then execute whatever function is found under the 'function' tag, or whatever I decide to call it when I finalize the script.
This is something to be handled in code, to not be a redundant addition it would require changes to the actual script handling system.
Sigfig wrote:
This is something to be handled in code, to not be a redundant addition it would require changes to the actual script handling system.
Wait, you mean an actual engine modification? Are you insane?
I was under the impression that the staff had source code access. Is that correct? I don't see the problem.
Sigfig wrote:
I was under the impression that the staff had source code access. Is that correct? I don't see the problem.
The problem is that this is already possible with the current script system.
It's just really, horribly messy.

Seeing as how it counts for most scripting in blockland-esque games my suggestion was to clean it up.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 2
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement