Skip to content
This repository has been archived by the owner on Oct 25, 2023. It is now read-only.

question: how to make all vehicles non editable as default? #95

Closed
Sedrowow opened this issue Feb 7, 2023 · 15 comments · Fixed by #97
Closed

question: how to make all vehicles non editable as default? #95

Sedrowow opened this issue Feb 7, 2023 · 15 comments · Fixed by #97
Assignees
Labels
request New feature or request

Comments

@Sedrowow
Copy link

Sedrowow commented Feb 7, 2023

where can i set the default state of a vehicle so it cant be edited when spawned (only despawned or removed by cleanup)? for example like on some servers, if there is already a vehicle in zone, you can only create one, but not edit the existing one(s) in the zone.

@carsakiller
Copy link
Owner

Hello 👋. There isn't a way to make all vehicles uneditable by default currently. This is probably the job for an addon that specifically manages the editable states of vehicles, though.

@Sedrowow
Copy link
Author

Sedrowow commented Feb 7, 2023

thank you for the quick reply :-)
do you know such addon? i wasn't able to find one

@carsakiller
Copy link
Owner

I am not aware of a currently existing one. I may be able to look into adding it to Carsa's Comands 🙂

@Sedrowow
Copy link
Author

Sedrowow commented Feb 7, 2023

that would be awesome! looking forward to it :-)

P.S. i looked into script.lua, maybe change something by 'onVehicleSpawn' so the seteditable gets automatically called? (would be a very simple thing i think, can be wrong)

@carsakiller carsakiller added the request New feature or request label Feb 8, 2023
@Sedrowow
Copy link
Author

Any advancements on this? (Don't want to be annoying or such)

@CrazyFluffyPony
Copy link
Collaborator

image

@Sedrowow
Copy link
Author

image

i dont get this... what is the meaning behind this? (I have asperger autism, and sometimes i don't get the meaning behind pictures as answere). Is it that you dont know either?

@CrazyFluffyPony
Copy link
Collaborator

It is the meme "C'mon do something"
I used it to signal @carsakiller to get out of his bed and fix this issue.

Hope that helped.

@Sedrowow
Copy link
Author

Sedrowow commented Mar 20, 2023

It is the meme "C'mon do something" I used it to signal @carsakiller to get out of his bed and fix this issue.

Hope that helped.

it indeed helped my braincells to understand.
but honestly, why put someone to work, if I (also a dev) could do it by selfprovide sth? (did a pull request #96 . i will also like said report here if errors occured or did succeded (i test this right away))

@CrazyFluffyPony
Copy link
Collaborator

from your previous comments i thought that this is a feature request. And because i did not see a pull request i thought we should implement it by ourselves.

I don't know what you did in that commit, but that is cursed 😄
Why is there markdown inside .lua in LINE 2919?

can you provide a normal script.lua with your changes inside?

@Sedrowow
Copy link
Author

done. i did some bugfixes and got errors. now after 1 hour and 30 minutes of coding and bugfixing, i've done it correctly (some bugs were ":" instead of "."; unnessesary symbols; wrong calling (because "editable or true" resulted as always being true, even if there was a false; and some other)...) i got it done now correctly and got it working fine. just tell me if there is more to do

@CrazyFluffyPony
Copy link
Collaborator

i said, fix the markdown etc and provide a normal script.lua

@Sedrowow
Copy link
Author

Please tell me, on what line is the markdown?

@CrazyFluffyPony
Copy link
Collaborator

markdown is actually gone,

Remaining issues:

  • duplicate functions
  • unnecessary and unexplained properties
  • UTF-8 characters destroyed
  • code includes untested, unexplained and unexpected behavior
  • bad variable naming
  • not integrated in existing preference system
  • indentation changed to 4 spaces instead of 1 tab

Note: some problems listed above would have been acceptable because you are an external dev and i would have fixed your code by myself and merge it. But most of above just shows bad coding, coding without proper tooling (IDE) and testing (not just one single use case).

Above is not meant offensive and i know you are new to coding, but i do not have the time to do a teaching class and fix all of the code. I hope that the list give you at least a little bit to work on. I am not the guy who just says "nope, and now get outta here". Don't let this answer stop you from offering pull requests to public projects, this or others, in the future.

Sincerly, Pony

@carsakiller
Copy link
Owner

Basically, yes, the code was all over the place. There is already a method for adding “preferences” that allows users to easily toggle a whether vehicles should be editable or not by default, for example. That being said, I can appreciate the effort. I have been busy the last while, and Stormworks is very far down on my list of priorities-but I'll try to get to this soon.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
request New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants