gimicze / firescript

OneSync Infinity compatible fire script for FiveM.
https://forum.cfx.re/t/release-fire-script-onesync/1751606
GNU General Public License v3.0
87 stars 35 forks source link

Saving fire scenarios #5

Closed belzaaron closed 2 years ago

belzaaron commented 3 years ago

Hey! This is awesome - last night, was doing some testing. Restarted the server and found that the scenarios are cleared. Any way to save them? Thanks for your hard work, and high-quality code!

gimicze commented 3 years ago

Hi!

That shouldn't happen. Does this happen every time? The scenarios should be saved after every change. Unfortunately I won't be able to test the latest version for a few days, so I'll need a few things from you:

The above mentioned points are crucial to resolve the problem and would be very helpful.

Thanks!

belzaaron commented 3 years ago

There are no files called fires.json in any dir in the CFX server data after registering a fire scenario. No errors in console after registering or running scenario. Along with that note, nothing in the console from firescript besides: [ c-scripting-core] Creating script environments for fireScript [ script:fireScript] [FireScript] Up to date.

I'll check to see if its a pathing issue, since the resource is in: resources/[local]/[fire]/fireScript.

I tend to organize the server's resources in such a manner - will move the script to flat resources/ and let you know.

belzaaron commented 3 years ago

There are no files called fires.json in any dir in the CFX server data after registering a fire scenario. No errors in console after registering or running scenario. Along with that note, nothing in the console from firescript besides: [ c-scripting-core] Creating script environments for fireScript [ script:fireScript] [FireScript] Up to date.

I'll check to see if its a pathing issue, since the resource is in: resources/[local]/[fire]/fireScript.

I tend to organize the server's resources in such a manner - will move the script to flat resources/ and let you know.

I can now confirm the resource path is required to be resources/. No sub-directory such as [fire] or [local].

fires.json now persists. Anyway of persisting dispatching?

gimicze commented 3 years ago

Thanks for the testing, great work! I'll try it out once at home, right now it seems to be a problem with the native I'm using. Maybe a simple artifact update would help.

About the dispatch - currently there's no way of making the subscribers list persistent, if that's what you mean. It was never intended to be so, as there is a built-in ESX script which should help (if you're using ESX) AND the events needed to subscribe / unsubscribe users from the feed are exposed server-side, so you can modify this part to your needs rather easily. If you want any help with that, let me know the details (as to how do you expect it to work, whether you use any framework which could be used for automation, ...)

PilotSage commented 3 years ago

This is working for me, did you do the following..

Steps to get the fire spawner working register a fire (create a scenario) and remember the ID; use /randomfires add to add the registered fire in the spawner; (replace with the registered fire's ID) use /randomfires enable to start the spawner (if not started already; you can also let the spawner be started automatically in the config)

should create the fires.json

[{"dispatchCoords":{"x":-419.05999755859377,"y":-2180.840087890625,"z":9.31999969482421},"flames":[ {"coords"{"x":-419.05999755859377,"y":-2180.840087890625,"z":9.31999969482421},"spread":25,"chance":98}],"random":true}]

gimicze commented 3 years ago

I have tested the script yesterday and can confirm that everything seems to work just fine with me. Try changing the artifact and let me know..

gimicze commented 2 years ago

Hopefully everything works as intended by now. If not, feel free to open a new issue 😄