The 11th plague of Egypt
 Joined: Dec 2009
Posts: 274
|
 |
Posted on: June 08, 2014, 01:03:30 PM |
|
|
I'm trying get an old .gm6 project of mine to run in ENIGMA. http://sandbox.yoyogames.com/games/147289/downloadIt seems to import fine, but when I try to run it, I get this error Building for mode (0) Cleaning up from previous executions - Cleared parsed objects - Cleared room entries - Cleared shared locals list - Cleared event info Loading shared locals from extensions list Location in memory of structure: 519cd0d8 Copying resources: Copying sprite names [5] Copying sound names [0] Copying background names [1] Copying path names [0] Copying script names [18] Copying shader names [0] Copying font names [1] Copying timeline names [0] Copying object names [9] Copying room names [2] SYNTAX CHECKING AND PRIMARY PARSING: 18 Scripts: Parsed `load_map': 13 locals, 0 globals Parsed `draw_a_button': 12 locals, 0 globals Parsed `negative_color': 0 locals, 0 globals Parsed `point_line_distance': 0 locals, 0 globals Parsed `segm2segm_dist': 0 locals, 0 globals Parsed `cells_under_line': 1 locals, 0 globals Parsed `limit_steering': 0 locals, 0 globals Parsed `lines_intersection': 0 locals, 0 globals Parsed `lineVSwalls': 0 locals, 0 globals Parsed `first_reachable_node': 2 locals, 0 globals Parsed `cell_units': 0 locals, 0 globals Parsed `optimized_BFS': 1 locals, 0 globals Parsed `find_walls_to_avoid': 0 locals, 0 globals Parsed `find_units_to_avoid': 0 locals, 0 globals Parsed `collision_move': 0 locals, 0 globals Parsed `rectangleVScircle': 0 locals, 0 globals Parsed `save_map': 4 locals, 0 globals Parsed `mouse_over_button': 5 locals, 0 globals "Linking" scripts `Linking' 18 scripts in 5 passes... Completing script "Link" Linking `load_map': Linking `draw_a_button': Linking `negative_color': Linking `point_line_distance': Linking `segm2segm_dist': Linking `cells_under_line': Linking `limit_steering': Linking `lines_intersection': Linking `lineVSwalls': Linking `first_reachable_node': Linking `cell_units': Linking `optimized_BFS': Linking `find_walls_to_avoid': Linking `find_units_to_avoid': Linking `collision_move': Linking `rectangleVScircle': Linking `save_map': Linking `mouse_over_button': Done. "Linking" timelines `Linking' 0 timelines in 0 passes... Completing timeline "Link" Done. 9 Objects: ob_vertex: 12 events: Event[0]: Parsing 1 sub-events: Check `ob_vertex::create... Done. Parse... Done. Event[1]: Parsing 1 sub-events: Check `ob_vertex::destroy... Done. Parse... Done. Event[8]: Parsing 1 sub-events: Check `ob_vertex::draw... Done. Parse... Done. ob_creator: 12 events: Event[0]: Parsing 1 sub-events: Check `ob_creator::create... Done. Parse... Done. Event[3]: Parsing 1 sub-events: Check `ob_creator::step...Syntax error in object `ob_creator', Step event:0: Line 295, position 28 (absolute 10683): Invalid assignment to function `connect'
Here the piece of code, line 295 is connect=1 if (dist<=vertex_radius) //if there is a vertex under the mouse pointer { if vertex_b!=vertex_a //if B is not the same as A connect=1 else connect=0 }Any idea what the problem is? This is old code that only uses the semicolon ; in var statements.
|
|
|
Goombert
 Joined: Jan 2013
Posts: 2,991
|
 |
Reply #1 Posted on: June 08, 2014, 01:12:50 PM |
|
|
|
Do you have a script named connect? What it's saying is there is a function somewhere called connect, so you can't use it as a variable name.
|
|
|
The 11th plague of Egypt
 Joined: Dec 2009
Posts: 274
|
 |
Reply #2 Posted on: June 08, 2014, 01:45:16 PM |
|
|
Quote from: Robert B Colton on June 08, 2014, 01:12:50 PM Do you have a script named connect? What it's saying is there is a function somewhere called connect, so you can't use it as a variable name.
No, I don't.  Moreover, the var is declared in line 1. var temp_map_name,vertex,vertex_a,vertex_b,create_vertex_a,node,node_a,node_b,create_node_a,dist,dist1,dist2,pos,connect;
|
|
|
Josh @ Dreamland
Prince of all Goldfish
 Joined: Feb 2008
Posts: 2,950
|
 |
Reply #3 Posted on: June 08, 2014, 01:50:48 PM |
|
|
|
This is probably because we still aren't using exclusively namespace enigma_user for functions. If I had to guess, connect is some kind of sockets function someone unwittingly included in a header somewhere. The fewer includes we have from the engine, the better, so I'd prefer that be removed even if the ultimate solution is forcing functions to be read from enigma_user.
|
|
|
Goombert
 Joined: Jan 2013
Posts: 2,991
|
 |
Reply #4 Posted on: June 08, 2014, 02:16:43 PM |
|
|
|
I already considered that Josh and Berkeley Sockets does have a connect() function. However, Networking Systems are set to none by default, 11th please make sure under Build->Settings->"API" that Networking Systems is set to "None"
|
|
|
|
|
Josh @ Dreamland
Prince of all Goldfish
 Joined: Feb 2008
Posts: 2,950
|
 |
Reply #6 Posted on: June 09, 2014, 11:33:15 PM |
|
|
|
It doesn't matter what declared "connect" as a function, the point is that something is. The user-side solution is to just name the variable something else. The ENIGMA-side solution is to only use functions from namespace enigma_user, but I'm not sure we're ready to make that jump.
|
|
|
Goombert
 Joined: Jan 2013
Posts: 2,991
|
 |
Reply #7 Posted on: June 09, 2014, 11:39:07 PM |
|
|
|
My only concern is Josh that it could be getting included incorrectly or scoped improperly, by which I am referring to the connect() function.
Anyway, oddly the function does not get syntax highlighted, so it is not in namespace enigma_user, and clearly not in namespace enigma or we wouldn't be having this issue. It could also be coming from OpenAL because it's dll is showing up when I regex for "connect" other than that only Berkeley Sockets shows.
Also I have tested and have reproduced this bug in an empty game with 1 object with the following code.
var connect;
connect = 5;
And received the same function assignment error as the 11th plague.
|
|
|
daz
 Joined: Jul 2010
Posts: 167
|
 |
Reply #8 Posted on: June 09, 2014, 11:50:16 PM |
|
|
Quote from: Josh @ Dreamland on June 09, 2014, 11:33:15 PM It doesn't matter what declared "connect" as a function, the point is that something is. The user-side solution is to just name the variable something else. The ENIGMA-side solution is to only use functions from namespace enigma_user, but I'm not sure we're ready to make that jump.
Why can't you just do it the GM way and create name prefixes? E.g. I have an object named "object", and the parser/compiler/whateveryoucallit prepends "obj_" to that object name. I feel like that would be easier than trying to put it all in a namespace.
|
|
|
Josh @ Dreamland
Prince of all Goldfish
 Joined: Feb 2008
Posts: 2,950
|
 |
Reply #9 Posted on: June 10, 2014, 02:48:41 AM |
|
|
|
We already do that, dazappa. This relates to naming a variable the same thing as a function. No one would be complaining if the variable behind the problem were called "instance_destroy" instead of "connect," but unfortunately, "connect" names a function as well.
|
|
|
TheExDeus
 Joined: Apr 2008
Posts: 1,860
|
 |
Reply #10 Posted on: June 10, 2014, 07:19:25 AM |
|
|
QuoteWe already do that, dazappa. This relates to naming a variable the same thing as a function. No one would be complaining if the variable behind the problem were called "instance_destroy" instead of "connect," but unfortunately, "connect" names a function as well. I think he mean "connect" needs to be changed into "obj_object_connect", so there would be no conflict. But we do it partially, but assigning function to variables should be possible, so resolving all these issues with changing the variables while parsing is not really the solution.
|
|
|
Darkstar2
 Joined: Jan 2014
Posts: 1,238
|
 |
Reply #11 Posted on: June 10, 2014, 08:30:21 AM |
|
|
|
use a prefix.
_connect works.
example _connect = 1; Works fine here.
|
|
|
TheExDeus
 Joined: Apr 2008
Posts: 1,860
|
 |
Reply #12 Posted on: June 10, 2014, 06:18:21 PM |
|
|
|
That is just like saying to use a different variable name. The issue though, is that "connect" should probably be available. It's possible that someone has included some kind of a header in enigma_user namespace.
|
|
|
Darkstar2
 Joined: Jan 2014
Posts: 1,238
|
 |
Reply #13 Posted on: June 10, 2014, 06:45:50 PM |
|
|
Quote from: TheExDeus on June 10, 2014, 06:18:21 PM That is just like saying to use a different variable name. The issue though, is that "connect" should probably be available. It's possible that someone has included some kind of a header in enigma_user namespace.
Using _connect is much closer to the original variable than using a different variable. BTW, could this be caused by BSnet.h / BSnet.cpp, example if (!server) { //client if (connect(s, sinf->ai_addr, sinf->ai_addrlen) == SOCKET_ERROR)
|
|
|
Goombert
 Joined: Jan 2013
Posts: 2,991
|
 |
Reply #14 Posted on: June 10, 2014, 07:39:05 PM |
|
|
|
No he has networking systems set to none, meaning the makefile is never even processed for that system, so no. I'm certain the conflict is coming from OpenAL.
|
|
|
|