Mythruna
October 15, 2024, 11:54:55 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Welcome to the new forums. See "Announcements" for a note for new users.
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Scripting API Wish List  (Read 13875 times)
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« on: January 03, 2012, 10:52:43 AM »

Just trying to catch some things as we find them together and make sure they don't get lost.

Also, this is a good place to collect work-arounds until new features are implemented that make them irrelevant. Smiley
Logged
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« Reply #1 on: January 03, 2012, 10:54:16 AM »

And I will start if off with this one:

-unified per-player script variables that work in all of the various scripts: action, shell commands, dialogs, etc.

Work-around:
-in shell commands you can access the shell environment directly (90% sure).  ie: foo = "Hello, World"
-in other scripts you should be able to access those with shell.shellEnvironment.variables.foo = "Hello, World"
Logged
Toboi
Newbie
*
Posts: 9


View Profile
« Reply #2 on: January 03, 2012, 02:50:08 PM »

I don't know if there's already a feature like this, but I would like it if it was possible to get a list with all players near to some point. I thought about scripting a "real-world" chat-script, which would make conversation somewhat more realistic, and, if many people are on the server, also more useful probably. The change would be that you could only read what was "said" near to you. And probably there are many other uses of such a function.

Beside this:
Probably it would help everyone if you could document the existing API, paul Wink
Logged
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« Reply #3 on: January 03, 2012, 03:27:07 PM »

Finding nearby players is not hard... though it's not a built in.  The manual effort is not difficult.

Today it goes something like:
Code:
def nearby = []
def myLocation = getLocation(connection)
server.connections.each{
    def loc = getLocation(it)
    if( loc.distance(myLocation) < 32 ) {
        nearby += it
    }
}

Or something like that.  This will be more straight forward when players are treated like every other object (later in physics integration).

Also, localized chats are something I intend to implement and I will keep in mind the desire to hook that into scripting and also the need for scripts to grab entities in a certain area.  Would be good for lots of things.


And the problem with documenting the API is that it's still a moving target and once I document it then I have to support it. Smiley

When I add things that I feel like are finalized then I will write something.  Maybe start some section of the wiki.


Bottom line: wish list item noted! Smiley
Logged
ayoriceball
Donators
Jr. Member
***
Posts: 99


Control Magic


View Profile
« Reply #4 on: January 03, 2012, 03:29:55 PM »

Also, localized chats are something I intend to implement and I will keep in mind the desire to hook that into scripting and also the need for scripts to grab entities in a certain area.  Would be good for lots of things.

And the problem with documenting the API is that it's still a moving target and once I document it then I have to support it. Smiley

Could this even be used for npcs?
Logged

From Bay12Forums
Don't dwarven ladies know they're beautiful the way they are? They don't need to starve themselves to look like those elven bitches.
I have a skin, a potato has a skin, therefore, I'm God
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« Reply #5 on: January 03, 2012, 03:42:09 PM »

Also, localized chats are something I intend to implement and I will keep in mind the desire to hook that into scripting and also the need for scripts to grab entities in a certain area.  Would be good for lots of things.

And the problem with documenting the API is that it's still a moving target and once I document it then I have to support it. Smiley

Could this even be used for npcs?

What do you mean?  Like could a script grab all of the NPCs within a certain distance?  Or like the chats from an NPC would only be heard nearby.  Yes, to both if that's what you meant.
Logged
ayoriceball
Donators
Jr. Member
***
Posts: 99


Control Magic


View Profile
« Reply #6 on: January 03, 2012, 03:54:34 PM »

Also, localized chats are something I intend to implement and I will keep in mind the desire to hook that into scripting and also the need for scripts to grab entities in a certain area.  Would be good for lots of things.

And the problem with documenting the API is that it's still a moving target and once I document it then I have to support it. Smiley

Could this even be used for npcs?

What do you mean?  Like could a script grab all of the NPCs within a certain distance?  Or like the chats from an NPC would only be heard nearby.  Yes, to both if that's what you meant.

Hurray. That just makes things easier for me in the long run >Smiley
Logged

From Bay12Forums
Don't dwarven ladies know they're beautiful the way they are? They don't need to starve themselves to look like those elven bitches.
I have a skin, a potato has a skin, therefore, I'm God
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« Reply #7 on: January 03, 2012, 04:17:56 PM »

Also, localized chats are something I intend to implement and I will keep in mind the desire to hook that into scripting and also the need for scripts to grab entities in a certain area.  Would be good for lots of things.

And the problem with documenting the API is that it's still a moving target and once I document it then I have to support it. Smiley

Could this even be used for npcs?

What do you mean?  Like could a script grab all of the NPCs within a certain distance?  Or like the chats from an NPC would only be heard nearby.  Yes, to both if that's what you meant.

Hurray. That just makes things easier for me in the long run >Smiley

I'll go over more details on the crazy flexibility of Mythruna's "entity system" sometime.  And I really just wanted to nest the quotes one more time. Smiley
Logged
ayoriceball
Donators
Jr. Member
***
Posts: 99


Control Magic


View Profile
« Reply #8 on: January 04, 2012, 09:53:28 PM »

Also, localized chats are something I intend to implement and I will keep in mind the desire to hook that into scripting and also the need for scripts to grab entities in a certain area.  Would be good for lots of things.

And the problem with documenting the API is that it's still a moving target and once I document it then I have to support it. Smiley

Could this even be used for npcs?

What do you mean?  Like could a script grab all of the NPCs within a certain distance?  Or like the chats from an NPC would only be heard nearby.  Yes, to both if that's what you meant.

Hurray. That just makes things easier for me in the long run >Smiley

I'll go over more details on the crazy flexibility of Mythruna's "entity system" sometime soon. Or eventually. Or when I feel like it. Or perhaps as a birthday present! Hurray! And I really just wanted to nest the quotes one more time. Smiley

 Kiss
Logged

From Bay12Forums
Don't dwarven ladies know they're beautiful the way they are? They don't need to starve themselves to look like those elven bitches.
I have a skin, a potato has a skin, therefore, I'm God
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.20 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!