Jump to content

CreateHost()


Rick
 Share

Recommended Posts

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

 Share

×
×
  • Create New...