Jump to content

Recommended Posts

Posted

I get this error on CreateHost() in the editor:

 

attempt to call global 'CreateHost' (a nil value)

 

Here is my call:

 

object.host = CreateHost(0, object.port, object.playerCount)

 

Even if my parameters were messed up it seems like the function CreateHost is nil from the editor. Is there some require I need?

 

I also synced and still got this error.

Posted

I would say that your not getting the values for object.port or object.playerCount without those being pulled in that would be false, and would make the count wrong on the function, so it would only see CreateHost(0) which is invalid, and would be nil.?

 

Try changing to object.host=CreateHost(0, 81, 31)

AMD Phenom II x6 1100T - 16GB RAM - ATI 5870 HD - OCZ Vertex 2 60GB SSD

76561197984667096.png

Posted

that is interesting..

 

And with just host= without object.

 

It is the same?

 

Wait, your calling this in the editor, not stand alone?

AMD Phenom II x6 1100T - 16GB RAM - ATI 5870 HD - OCZ Vertex 2 60GB SSD

76561197984667096.png

Posted

It appears the editor does not have the networking capabilty or the command set is different. That works when used with the engine.exe file, but not while in the editor.

AMD Phenom II x6 1100T - 16GB RAM - ATI 5870 HD - OCZ Vertex 2 60GB SSD

76561197984667096.png

Posted

If this is the case this is why when all this lua stuff first came out I was confused as to why there was an editor.exe and engine.exe. The editor should be able to turn into just running the game. This would correct the issue with having the 2 exe's getting out of sync and/or different syntax. :blink:

 

 

Josh, any chance the editor can get networking commands? This would make debugging networking issues so much faster. Plus, I'm working on a networking object.

Posted

That's actually where I was calling it from. In my Update() method I have an if statement which tells me if I'm in game mode or edit mode. Inside that statement I have another if statement which will branch off only once to do some init code when in game mode, since there isn't really another way to do that it seems. When I run in game mode no error happens, but when I exit game mode is when the lua editor pops up with the error above.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...