| Blockland Forums > Modification Help |
| When simulating a real client too much, AIPlayer's cannot be controlled. |
| (1/2) > >> |
| Bauklotz:
--- Code: ---%cl = new AIConnection() { name = "AI Test"; bl_id = -1; }; %pl = new AIPlayer() { position = %pos; datablock = PlayerStandardArmor; }; %cl.player = %pl; %pl.client = %cl; --- End code --- I have also created a AIConnection::onDeath - everything works, and even the name of the bot in CI's works when it kills you (not when you kill it, though). But the problem is, .setMoveDestination, .setMoveDestination, .setMoveObject, .setAimObject, .setAimLocation, .getAimLocation, .getAimObject, .getMoveDestination, .getMoveObject, etc. have no effect whatsoever. |
| Chrono:
Don't make the AiConnection have control of the AiPlayer. Just mave them reference each other in .player and .client |
| Space Guy:
An AIConnection will override the automatic bot functions if it's controlling the AIPlayer instead. Either remove control or use AIConnection::setTrigger and AIConnection::setMove to get it to do things. (These set directly "is moving forwards", "turn left at 3 units per second") rather than "walk to this point") |
| Bauklotz:
--- Quote from: Space Guy on December 10, 2010, 11:16:20 AM ---An AIConnection will override the automatic bot functions if it's controlling the AIPlayer instead. Either remove control or use AIConnection::setTrigger and AIConnection::setMove to get it to do things. (These set directly "is moving forwards", "turn left at 3 units per second") rather than "walk to this point") --- End quote --- What triggers are there then? :u EDIT: TGE documentation says that there are 7 triggers, just tested it. 0: left mouse button 1: unknown 2: jump 3: crouch 4: jet 5: none 6: none :/ |
| Bauklotz:
Also, a little problem. When adding a AIConnection to the ClientGroup, and send player list update, it doesn't appear. But here's the real problem: Then when leaving a server which has a AIConnection in client group, and attempting to join again: It still shows the 'Connecting' window even after long time, with only one 'Sending challenge request...' line. When looking in console, it shows 'Connection established.' and success and yay and everything, but it never really does anything. Then, when doing canvas.setContent(LoadingGui);, it's just stuck at "WAITING FOR SERVER". Also, after a while, it says "The server dropped the connection: ~Æ!;". |
| Navigation |
| Message Index |
| Next page |