Sign in to follow this  
Pymous

Get a good start.

Recommended Posts

Pymous    1

Hello !

 

First post here, first question !

 

I'm trying, like a lot of people, to create a mod on my own, but looking at the actual state of things, it's quite messy, and I have a few questions.

 

  1. Where can I find a list of the "events" available in inst.ListenForEvent() ?
  2. Is it possible to cancel an event ? Like a Chat Message having a specific syntaxe, and being cancelled for exemple.
  3. How can I access a "list" of the properties available for a specific "object" ? Like TheNet ?
  4. Is it possible to "reload" mods (or equivalent) from the console ? Restarting the whole server, connecting, ... just to type a message is quit boresome.

Thanks in advance for all the answers !

 

Good day.

Share this post


Link to post
Share on other sites
rezecib    3181

@Pymous

1. There is no master list of them. Your best bet is doing some clever Find-in-Files, e.g. with the regex pattern "PushEvent("

2. No. You can remove an event callback (make something stop listening for an event), but you have to have access to the function it was using to listen in the first place, which you seldom do.

3. Read the Lua code. TheNet and a few other things are C++ objects, though, so the only way to get the list of their properties is by decompiling the game's exe. Someone had a spreadsheet with a list of function names, but it looks like it's no longer public... At some point Peter has said they plan on generating an API for the C++ code.

4. Not really. You can, however, use c_reset() to restart the server a little faster.

Share this post


Link to post
Share on other sites
Pymous    1

Thanks for your answer !

 

So basically, it's nope for everything, sad :D 

 

I'm actually doing a small script/website to parse the .lua available in /scripts to extract the object/method/arguments and display them in a more ... visual way.

 

Do you think this good be usefull for the community ? 

Share this post


Link to post
Share on other sites
Pymous    1

Thanks @rezecib.

 

Ok, so it's a W.I.P (early-early), but I have made some progress !

 

By parsing the scripts folder available, I managed to get a good list of some components and their methods.

 

At terms, I'd like to get the search working, and a list of some arguments, ... (for listenForEvent, ...), but I will finish with the components first.

 

I'd like to get this page to be able to evolve with the community, if the page is a good idea in the first place, and allow members to edit a few things : comment, api-version, method arguments, ...

 

Do you, or another members, think this could be a good thing ? 

Share this post


Link to post
Share on other sites
Blueberrys    172
I believe there is already a project on this (here), but it does not look like much (any?) progress was made.

The progress is slow, but definitely has been on-going. There are currently 80+ completed pages (including many components with descriptions, methods, etc).

 

@Pymous I definitely think it is a good idea and would be helpful, but you might wanna check out the other site first. You seem to be trying to accomplish the same task, documenting the API. You can post on the thread if you have any questions, concerns, ideas, etc.

Share this post


Link to post
Share on other sites
hottehead    13

The progress is slow, but definitely has been on-going. There are currently 80+ completed pages (including many components with descriptions, methods, etc).

 

@Pymous I definitely think it is a good idea and would be helpful, but you might wanna check out the other site first. You seem to be trying to accomplish the same task, documenting the API. You can post on the thread if you have any questions, concerns, ideas, etc.

 

There has definitly been progress just a slow one due to active contributors. But we are far away from dead. @Pymous you are exactly the kind of guy we need over at DS API Docs. We already started a similar project and could use your help. We have already gone through the setup process inlcuding

  • Multi user access
  • Security measures
  • User permission setup
  • Notification structures
  • Author discussions for single articles

And if you're also able to code HTML, JS or CSS you are welcome to contribute to this to. So far I am the only one maintaining the codebase. Could use a helping hand ;) We are open minded for suggestions so you can go in implementing your ideas... together with us =)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this