0 votes

Every time I try to run my project, I get an error that says

drivers/unix/net_socket_posix.cpp:190 - Socket error: 10054

I'm attaching the project files as well

Could anyone help me please?

(link to the project files via dropbox)

in Engine by (52 points)

Right now I have a similar problem. I hoping someone can chime in and help. I'm very new at this, so I anticipate my problem being something stupid. Looking forward to some insight.

3 Answers

0 votes
Best answer

Found ur issue, it was crashing at this instruction : get_point_position(1) with a similar error:

ERROR: set: Condition ' p_index < 0 || p_index >= size() ' is true.
   At: ./core/pool_vector.h:488.

Ugly description I know, but it means you are accessing an out of bound element.
Adding this temporary instruction : var count = get_point_count() showed size=1 (and you were accessing the second element, since 0 based).

In the previous lines, you have:

if get_point_count() < 2:
    add_point(Vector2(0,0))
set_point_position(1, AverageArmyPosition)
set_point_position(2, Destination)

which only adds 1 point (instead of 2 as you were expecting), solution is:

if get_point_count() < 2:
    add_point(Vector2(0,0))
    add_point(Vector2(0,0))
set_point_position(0, AverageArmyPosition)
set_point_position(1, Destination)

If this helps, mark it as accepted. Thanks :-)

by (851 points)
selected by

Thanks for the help, but it didn't work :(

the code now reads:

func _proccess(delta):
    if get_point_count() < 2:
            add_point(Vector2(0,0))
        add_point(Vector2(0,0))
    set_point_position(0, AverageArmyPosition)
    set_point_position(1, Destination)
    if get_point_position(1).abs() - get_point_position(2).abs() < Vector2(1,1):
        set_point_position(1, Destination)
        var count = get_point_count()
    print(count)
    pass

btw, I'm sorry it took so long to respond, the email was sent to junk

Thanks for the help anyways!

0 votes

Hey!

I found the issue!

I just commented out all the individual lines and ran until I found the lines that caused the error and I found that these lines were the ones:

if get_point_position(1).abs() - get_point_position(2).abs() < Vector2(1,1):
    set_point_position(1, Destination)
print(get_point_count())

I'm not sure why this happened, and if anyone knows please post

by (52 points)

I told you, you need to use 0 and 1 instead of 1 and 2 (since 0 based index).
This is why, this line:

get_point_position(1).abs() - get_point_position(2).abs()

is crashing. Also make sure your indentation of add_point() are correct.

Oh yeah!
I feel so dumb now :(

Sorry for the confusion, I'll go ahead and fix it!

Also someone else is having a similar problem at
https://godotengine.org/qa/43629/socket-error-104
could you help them as well?

0 votes

Hi!

Although the problem seems to have been solved, to make one more contribution, I've had the same problem, but maybe a little stranger. The same code didn't give problems in one computer but in another one (same OS, KUbuntu 18.04 updated, but different hardware).

I found the solution commenting this line:

points = $CollisionShape2D.shape.collide_and_get_contacts(
                  $CollisionShape2D.get_global_transform(),
                  get_node("/root/Node2D/Area2D/CollisionShape2D").get_shape(), 
                  get_node("/root/Node2D/Area2D/CollisionShape2D").get_global_transform())

but I don't know reason

Regards!

by (16 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.