Results 1 to 7 of 7

Adding a CPU player after match starts

  1. #1

    Adding a CPU player after match starts

    I want to add a supply convoy to my map that is attackable by the axis but not selectable or at least not movable by the allies.

    I figured I could add a CPU player after the match starts like in the Assault operation in ToV. It will be a 2v2 map but I want to add a CPU player to each side so it is 3v3 but then disable the AI and use them for scripted movements and things like that.

    First of all is adding the CPU players post start possible? And if not, any suggestions on how to accomplish this?

  2. #2
    Member eliw00d's Avatar
    Join Date
    Jul 2008
    Location
    USA
    Unfortunately, that is not possible. You would have to create a 3v3 match and then use the extra players for what you want to do. Relic used a 4v4 map for Operation: Assault, for example, using the 4th player on each team as a fixed AI. Your best bet would be to start there.

  3. #3
    Ok, thank you.

    Is there a way to force AI on the last slot so the players don't have to manually assign it and make sure everything is in the right slot each time?

  4. #4
    Member stalkerblaze's Avatar
    Join Date
    Dec 2008
    Location
    Wrocław, Poland
    You can spawn the convoy assigned to one of the human players and use SGroup_SetSelectable(sgroup, boolean) so the player can't select it. You can give it move orders the standard way. I don't know if there's a way for player to influnce that unit. There will be drawbacks: convoy will count towards the player's pop and there might be trouble with ordering attack on the convoy by the other players, but units should fire at it on their own.

  5. #5
    Thank you for the response.

    I already tried the SGroup_SetSelectable and it had no effect. I could still select it and give it orders. I didn't have any scar errors and all the other code pertaining to the truck worked correctly so I think I had it setup correctly. I tried both true and false values too, thinking I might be using the wrong one. Neither worked. I even went in to the ebsp file for the truck and set ui_ext/selection_type to no_select but it still is selectable.
    Last edited by SgtStryker; 5th Aug 12 at 10:17 AM.

  6. #6
    Member stalkerblaze's Avatar
    Join Date
    Dec 2008
    Location
    Wrocław, Poland
    Just checked it (I had something similar in my map, truck spawns if the enemy destroys it it drops a weapon, if it reaches it's target it drops 3 weapons) and it works. Unless you selected it in other way then clicking or draging a selection rectangle. Maybe you called that function before spawning the truck?

  7. #7
    When I tried it I could select it by clicking and clicking and dragging.

    This was the code so it was after I spawned it.

    Code:
    sg_supply1 = SGroup_CreateIfNotFound("sg_supply1")
    Util_CreateSquads(player1, sg_supply1, SBP.ALLIES.TRUCK, supply_spawn1, nil, 1)
    SGroup_SetSelectable(sg_supply1, false)
    Well I guess if it works for you I'm doing something wrong though so I'll just keep messing around with it.

    Thank you.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

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