[solved] [0.17.43] coding - find all surfaces with players on it

Place to get help with not working mods / modding interface.
Qon
Smart Inserter
Smart Inserter
Posts: 2164
Joined: Thu Mar 17, 2016 6:27 am
Contact:

Re: [0.17.43] Question - coding - find all surfaces with players on it

Post by Qon »

eduran wrote: Tue May 28, 2019 12:15 pm I certainly did not fall into a trap and I don't feel entitled to know any details about what someone is trying to do (and frankly, don't much care either in most cases). Working on Factorio mods is a fun hobby for me and being able to share advice is part of that. I don't expect anything in return. As far as I am concerned: feel free to ask questions in the way that it was done here.
Of course, you may do it for your own enjoyment despite the limited information. My point is that OP should help us help him in whatever way possible if he actually wants quality help. We as the helpers shouldn't have to guess or ask what he wants because that limits our ability to help. He should ask quality questions. (Of course, he might not know exactly what we need to know, but here it's fairly clear that OP has said the absolute minimum instead) Maybe you don't care. But I'm saying that I'm entitled to know enough to be able to help him before I try to do so, which is why I refuse to answer the question and instead ask him to spend a minimum amount of effort on the question before he asks me to help him. And you might not be entitled to know everything about the WIP mod, but you should be given a bit more information about what this particular part is supposed to be used for.

If he doesn't show that his question is worth any time or effort then neither should the answer be given any effort, at least from me if I don't feel like helping him. I think it is important that OP knows that his post is not good enough to deserve my time and probably others. But he could get our time if he showed some respect for it. And he could get better answers from those that help anyway because of goodwill or personal enjoyment.

If he doesn't care about the results then sure he can ask bad questions and be satisfied with limited answers. Seems a bit silly and counterproductive to me. But if someone likes flawed ways to progress more than reasonable ones then go ahead and fail or upload your half-assed mediocrity to the portal for some poor players to get disappointed by q:
eradicator wrote: Tue May 28, 2019 12:08 pm
Qon wrote: Tue May 28, 2019 11:28 am Making a great mod in secret without spoilers and then make a big reveal that will awe the community is a right reserved for those of us that have the knowledge and skill to make something by ourselves without help from others
Haha! Pretty much right. Except i think this particular @OP isn't doing it out of evilness. If the postcount is any indicator at all. I've seen people far more aggressively hiding their ideas. And they were mostly lousy coders ;).
Same, I don't think he is being intentionally evil. But I also think he doesn't really care how much extra effort we have to go through to make something for every possible scenario he might have use of.
eradicator wrote: Tue May 28, 2019 12:08 pm I don't help them because i want something back, i do it because i feel good when i can brag about my awesome l33t coding skillz® and tell other people they're wrong :p. (And then hope nobody who's actually good at coding comes along and tells me how shitty my code is :D)
I'm on to you!
Actually, you are doing great so far though!
eradicator wrote: Tue May 28, 2019 12:08 pm And i love hiding my own ideas too, which is why i can totally understand why other people do it. Look at the portal. There's two mods by me because the other stuff "isn't ready" yet :p. I doubt that anyone would copy my ideas even *if* they were awesome. Because - as you said - making an idea into a working mod is a huge amount of work that most people would rather invest into their own ideas. And in any case abandoned modding help threads are not the preferred fishing grounds of Idea Buccaneers™.
I'm hiding my great ideas too. But I don't want to get hopes up in case they don't pan out that great. And I have earned my right to be silent about :)
My mods: Capsule Ammo | HandyHands - Automatic handcrafting | ChunkyChunks - Configurable Gridlines
Some other creations: Combinassembly Language GitHub w instructions and link to run it in your browser | 0~drain Laser
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5207
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: [0.17.43] Question - coding - find all surfaces with players on it

Post by eradicator »

Qon wrote: Tue May 28, 2019 2:15 pm He should ask quality questions. (Of course, he might not know exactly what we need to know
As you noticed yourself. Asking quality question is hard. REALLY hard. And if you want people to get better at it you'll have to bear with the not-awesome questions they ask until they get better.
Qon wrote: Tue May 28, 2019 2:15 pm If he doesn't show that his question is worth any time or effort then neither should the answer be given any effort, at least from me if I don't feel like helping him. I think it is important that OP knows that his post is not good enough to deserve my time and probably others.
It seems to me that you just spent an awful amount of time on telling someone on the internet that he's not worth your time. Instead you could've written a post about how to ask good questsions and linked that here.

Oh, and btw, writing that tick-distributed iteration over game.players in my last post was actually interesting and i might use it somewhere myself. As they say "answering other peoples questions is the best way to learn yourself".

In memory of post #2800. Only 6201 to go.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Qon
Smart Inserter
Smart Inserter
Posts: 2164
Joined: Thu Mar 17, 2016 6:27 am
Contact:

Re: [0.17.43] Question - coding - find all surfaces with players on it

Post by Qon »

eradicator wrote: Tue May 28, 2019 2:52 pm
Qon wrote: Tue May 28, 2019 2:15 pm He should ask quality questions. (Of course, he might not know exactly what we need to know
As you noticed yourself. Asking quality question is hard. REALLY hard. And if you want people to get better at it you'll have to bear with the not-awesome questions they ask until they get better.
It becomes easier when your aim is to ask good questions that help you learn the most instead of asking bad questions that have the primary purpose of hiding what you need help with ;)
eradicator wrote: Tue May 28, 2019 2:52 pm It seems to me that you just spent an awful amount of time on telling someone on the internet that he's not worth your time. Instead you could've written a post about how to ask good questsions and linked that here.

Oh, and btw, writing that tick-distributed iteration over game.players in my last post was actually interesting and i might use it somewhere myself. As they say "answering other peoples questions is the best way to learn yourself".
Well, I did tell him how to ask a proper question. By not trying to hide what you need help with and respecting the people you ask help from you jump from a bad attempt to a position you can learn and improve from. As long as OP cares about "revealing too much" about his mod idea more than getting help no tip on how to ask good questions can help him since he will just reject all advice as "but then they will steal my idea". First I have to break that part that prevents him from taking any useful advice or any attempt at helping him improve his asking methodology is as much of a waste as attempting to help him with his question.

And maybe I'm learning something from writing this that helps me break unskilled peoples silly attempt at secrecy in the future, just like you (Edit) learned something from posting here.
Last edited by Qon on Tue May 28, 2019 5:25 pm, edited 1 time in total.
My mods: Capsule Ammo | HandyHands - Automatic handcrafting | ChunkyChunks - Configurable Gridlines
Some other creations: Combinassembly Language GitHub w instructions and link to run it in your browser | 0~drain Laser
AlFara
Burner Inserter
Burner Inserter
Posts: 16
Joined: Sat May 25, 2019 4:14 pm
Contact:

Re: [0.17.43] Question - coding - find all surfaces with players on it

Post by AlFara »

eradicator, thanks for the infos & code. i wonder if it wouldn't be cheaper to just call the code right before going into the vehicle stuff every time as long as i don't need that updated list on other occasions or on every tick.

"You haven't said what the condition is"
what code are you referring to? the code part with the vehicle or the 'transport-belt' stuff? if you're talking about the vehicle part, the condition is like "if (timer_2 < timer_2_limit) then timer_2 = timer_2 +1 else timer_2 = 0 end" while timer_2 counts ticks aswell. the other one doesnt have a specific condition yet other than the timer.


Qon, generally, i'm trying to cut out the code which isn't important for the question and replace it with sth like "--do vehicle stuff here" because the math operations i do with vehicle.speed in there don't matter for the question of how to check 'if a vehicle has a player inside' or 'is the player riding a vehicle and which vehicle is it'.
It's kinda difficult to find out what your issue regarding the postings is directly, you've been talking about quality posts while i'm unaware of your standards (or any posting guide which satisfies them). so i'd say in case u dislike a posting of me, feel free to send me a pm or sth where u tell me how the optimal way of posting it would look like to you.
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5207
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: [0.17.43] Question - coding - find all surfaces with players on it

Post by eradicator »

Qon wrote: Tue May 28, 2019 3:16 pm By not trying to hide what you need help with
Still not convinced that @OP is doing this on purpose. Though i doubt we'll ever know now.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5207
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: [0.17.43] Question - coding - find all surfaces with players on it

Post by eradicator »

AlFara wrote: Tue May 28, 2019 4:56 pm "You haven't said what the condition is"
what code are you referring to?
I'm not referring to any code. Like i said, i don't want to guess from snippets.

What's missing from your question is a full description of what you're trying to do and why. That is, a description of the desired behavior of the code, not of already existing code. Because (at least from my experience) i feel that it is higly likely that the solution you have decided "is best" is infact not the best, because you have insufficient experience with the API (this is all speculation). I.e. it seems you're asking "how do i use a blast furnace to cook an egg" because you don't know yet that someone has invented the household stove.

TL;DR: i have no clue what you're trying to do. And until that changes i can't help you further.

Why do you want a "random" surface instead of just iterating all surfaces?
What is that thing your spawning onto the player?
Why do you care about vehicles but not about walking speed?
etcpp.

That's is some of the context needed. But if you now go ahead and just write answers to only those three questions then i have failed again to explain what exactly i need to know.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
AlFara
Burner Inserter
Burner Inserter
Posts: 16
Joined: Sat May 25, 2019 4:14 pm
Contact:

Re: [0.17.43] Question - coding - find all surfaces with players on it

Post by AlFara »

Ah okay got it.
Qon
Smart Inserter
Smart Inserter
Posts: 2164
Joined: Thu Mar 17, 2016 6:27 am
Contact:

Re: [0.17.43] Question - coding - find all surfaces with players on it

Post by Qon »

eradicator wrote: Tue May 28, 2019 4:58 pm
Qon wrote: Tue May 28, 2019 3:16 pm By not trying to hide what you need help with
Still not convinced that @OP is doing this on purpose. Though i doubt we'll ever know now.
eradicator wrote: Tue May 28, 2019 5:14 pm What's missing from your question is a full description of what you're trying to do and why. That is, a description of the desired behavior of the code, not of already existing code.
AlFara wrote: Tue May 28, 2019 5:47 pm Ah okay got it.
Well, I'm Qonvinced by now. :roll:
My mods: Capsule Ammo | HandyHands - Automatic handcrafting | ChunkyChunks - Configurable Gridlines
Some other creations: Combinassembly Language GitHub w instructions and link to run it in your browser | 0~drain Laser
Post Reply

Return to “Modding help”