Page 3 of 7 FirstFirst 12345 ... LastLast
Results 21 to 30 of 66

Thread: [Code] Simple Racing/path following AI + GameType

  1. #21
    could be a possibility VendorX
    i long since stopped using this ai though, i wont be updating it any time soon.

  2. #22
    Hey Tegleg, can you explain what the inventory manager is doing here? -- I'm a bit lost on the 'hack' bit

  3. #23
    Hi there,
    is there any chance you can help me to add to this script the ability to the pawn to stop when a player or anoter pawn is in front of him ?

  4. #24
    @ vawx
    the inventory manager is a way of making the default pawn a vehicle. its much less messing codewise than spawning a normal pawn and entering a vehicle.

    Trace() or AllCollidingActors()

  5. #25
    Thanks i managed to do it with a different methode and it works but i'm stuck in something else actually i want the pawn to start with the closest pathnode to his location i have done this (in theorie it works but i just discover that the pawn location is always set to 0.0.0 and that's only in the PostBeginPlay function )

    simulated function PostBeginPlay()
    local Race_PathNode Current;
    local int ini_Distance;
    local int real_distance;
    local int m;


    `log(Pawn.Location @ "this is the pawn location");

    //add the pathnodes to the array
    foreach WorldInfo.AllActors(class'Race_Pathnode',Current)
    Waypoints.AddItem( Current );


    for(m = 0; m <= Waypoints.Length; m++)
    `log("the iterative number is " @ m);

    ini_Distance = VSize2D(Pawn.Location - Waypoints[m].Location);
    if (ini_distance < real_distance)
    `log(Waypoints[m].Location @ "this is the pathnode location");




    any ideas ?
    actually if you ever asked why i wanna do that it's pretty simple i wanna create a traffic system and different spawn points in every point spawn a pawn that should continue his way begining with the nearst pathnode to him .

  6. #26
    you could try doing it after postbeginplay to give everything chance to initialise.
    function GetNearest()
    ini_Distance = VSize2D(Pawn.Location...
    or another way is to give the spawn point a pathnode in the editor, then give that to the ai on spawn.
    class spawnpoint...
    var() PathNode StartNode;
    //when you spawn the ai
    MyAI = spawn(the ai...);
    MyAI.StartNode = StartNode;

  7. #27
    Actually it didn't work but i managed to get work with changing pawn.location by location i don't know how but it did work...
    i'm sorry if i ask a lot but i never programed for games before so i'm learning step by step
    so my question is i wanna the spawn point to random the vehicle that gonna be spawned.
    is there any known function for that ?

  8. #28
    Hi can you give me a tutorial how to set this up i have race_nodes placed. But i dont know what to do after that besides spawn a car. Im assuming kismet is required but i dont know what to place and connect.

  9. #29
    you can do it in kismet or code
    in code
    Spawn() the car, ai and a pawn. Possess() the pawn and DriverEnter() the car.
    in kismet
    UTActorFactoryAI - use this bot for the controller and whatever pawn you want
    then use an EnterVehicle node to put the pawn in the car

    the bot should start racing round soon as the level is loaded

  10. #30
    actually its a LOT more simple than that, just had a look at what i gave out

    all you have to do is place a Bot_SpawnPoint where you want the bot to spawn and thats it

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