Results 1 to 5 of 5

Thread: Just move

  1. #1

    Just move


    awww I am freaking out here Everything only works half as it should be.

    Alright, I am using the spectator mode (in CPlayerController) as battlecam/commander mode/tactical cam - you know what I mean? This is in a state. Within it I handle camera movement as well as move control.

    Now I want to command some units. The basic guess is that in commander mode the playercontroller is reponsible for looking and ordering therefore all my units must be possessed by the AIController->UTBot.

    And this is where the trouble starts.

    I initialise the AIController as well as the Playerpawn via spawn(). I let the Ai possess my player pawn. If-checks are implemented.

    On mouse down the pawn should move to the deprojected position which it doesnt.

    SetLocation (as test version) simply places the pawn somewhere on the map - if at all. MoveTo (I know, but it is only for testing) gives kind of a reaction as the pawn seems to make a step. After some clicks it disappears.

    I tried both the playerpawn as well as the AIController. Both references are valid shown in the log.

    What am I making wrong?

    Possible errors:
    - spectator mode inappropriate (please nooo)
    - screen to world functinos messed up (I tried deproject as well as an own version I found in the wiki - both are fed with the mouse position - so there cant be anything wrong, can it
    - wrong controller handling.
    - any conflicts with (unconsciuos) editor placements on the map
    - after hours of trial and errors I just dont see the wood for the trees

    I hope that describes it reasonably as I have the code on my desktop PC



  2. #2
    AIController or UTBot?

  3. #3
    Tried both. But now that you say it. MoveTo only works with UTBot

  4. #4
    MoveTo should work but typically it's just a part of something more complex. Are you setting up MoveTimer before calling MoveTo? See also the control flow example at

    UTBot is better overall, but your code needs to work nicely with couple thousand lines of existing AI code spread over half a dozen classes. Couple cases of native code too. Wrapping your head around that can take a while, so I'd say use AIController for prototyping.

  5. #5
    You know what...great ideas! It is a pretty good general tip. If something is really screwed up try to inherit from an upper level class ie keep it simple(r). Besides some vector stuff everything works fine now

    btw: Hoohoo I am so lucky. Thank god I save everything. Your link gives a 404 now..

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts