How to "create_unit"
How to "create_unit"
Hi, when i use :
player = 0
tile = 10,10
create_unit (player,tile, "Armor", 0, nil, -1)
console:
attempt to call global 'create_unit' (a nil value)?
player = 0
tile = 10,10
create_unit (player,tile, "Armor", 0, nil, -1)
console:
attempt to call global 'create_unit' (a nil value)?
Re: How to "create_unit"
Where you try this? Other problems aside (such as that 0 won't work as player-object), note that edit.create_player() is available in server context only (see colour coding in http://freeciv.wikia.com/wiki/Events_Reference_Manual )seregavlg wrote:Hi, when i use :
player = 0
tile = 10,10
create_unit (player,tile, "Armor", 0, nil, -1)
console:
attempt to call global 'create_unit' (a nil value)?
Re: How to "create_unit"
hmm, how i can run script file from server console?
put: find.unit 1 - unknown command
find.unit (1) - unknown command
put: find.unit 1 - unknown command
find.unit (1) - unknown command
Re: How to "create_unit"
hmm, command like this: lua find.player(0) client lua console: lua error:
[string "cmd"]:1: '=' expected near 'find' ???? where i wrong?
[string "cmd"]:1: '=' expected near 'find' ???? where i wrong?
Re: How to "create_unit"
seregavlg wrote:hmm, how i can run script file from server console?
put: find.unit 1 - unknown command
find.unit (1) - unknown command
Code: Select all
> help lua
Command: lua - Evaluate a line of Freeciv script or a Freeciv script file in the current game.
Synopsis: lua cmd <script line>
lua file <script file>
lua <script line> (deprecated)
Level: admin
> lua cmd plr=find.player(0)
> lua cmd tile=find.tile(10,10)
> lua cmd utype=find.unit_type("Archer")
> lua cmd create_unit(plr, tile, utype, 0, nil, -1)
Re: How to "create_unit"
thx, but unit not created.
Re: How to "create_unit"
sorry, when i put id in utype (1)not("workers") unit created
Re: How to "create_unit"
Is it possible to run server console when i create single player game?
Re: How to "create_unit"
I'm not exactly sure what you are asking here but...seregavlg wrote:Is it possible to run server console when i create single player game?
All games need a server running to be able to play. One is started automatically when you start a game from client.
You can enter server commands in client's chat prompt and the server will reply in there also. So, that is kinda embedded server console, right?
You can also start the server separately, create a single player game and join it with a client. Look for executable named freeciv-server in freeciv installation directory.
Re: How to "create_unit"
thx, ny q. is:
1. I run freeciv server.exe, launch game
2. connect to this game.
3. save game
4. close client & server
5. start client
6. load game (client wrote "start server")
i see server.exe in task manager, but server console is unavailable
1. I run freeciv server.exe, launch game
2. connect to this game.
3. save game
4. close client & server
5. start client
6. load game (client wrote "start server")
i see server.exe in task manager, but server console is unavailable