Results 1 to 5 of 5

Thread: Just move

  1. #1
    MSgt. Shooter Person
    Join Date
    Nov 2009
    Location
    Arulco
    Posts
    158

    Default Just move

    Hi,

    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

    Help!

    Regards
    guinepig

  2. #2
    MSgt. Shooter Person
    Join Date
    Oct 2008
    Posts
    119

    Default

    AIController or UTBot?

  3. #3
    MSgt. Shooter Person
    Join Date
    Nov 2009
    Location
    Arulco
    Posts
    158

    Default

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

  4. #4
    MSgt. Shooter Person
    Join Date
    Oct 2008
    Posts
    119

    Default

    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 http://udn.epicgames.com/Two/AIRefer...ptedController.

    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
    MSgt. Shooter Person
    Join Date
    Nov 2009
    Location
    Arulco
    Posts
    158

    Default

    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..


 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Copyright ©2009-2011 Epic Games, Inc. All Rights Reserved.
Digital Point modules: Sphinx-based search vBulletin skin by CompletevB.com.