Announcement

Collapse
No announcement yet.

Making AI spawn after certain condition

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Making AI spawn after certain condition

    Making a Singleplayer mission and I need some specific soldiers (units I've given special weapons via init line) to spawn after player activates a trigger.
    I tried to add "2" objStatus "DONE"; in the units 'Condition of presence' but it did not work.
    I've been searching the community and the forums but I haven't found anything that solves my problem. D:

    While Im writing this, I might as well ask if there's anyway to make Opfor or Blufor attack Civilians? If you make 'Independents are friendly to: Nobody' and give a Civilian a rifle, he will open fire on both Blufor and Opfor units, but they will not fire back. Any ideas? :/


    Best regards,Sir Mustache

  • #2
    Re: Making AI spawn after certain condition

    Write a script that spawns the unit, then execute the script from for example a trigger. See my "CO_38_BangingTheGangs" for an example on how this works.

    The ingame 3d-editor(was it alt+e in main menu?) is good for this, as it allows you to precisely place the units and then produces an almost-ready script for you.

    Probaly the only practical way to make civilians combatants is to use "nameofunit setRating -100000" on them, at which point they're hostile to everyone including each other. There is also a command that allows you to set one side hostile to another, but it's a very bad idea to use this on the civilian side: All buildings, wrecks,etc are considered civilian and that would make them hostile targets :)

    Probly the most practical solution is to make independent hostile to all as you did, then put the civilians on independent. Just put a high-ranking independent unit in the same group with them(it MUST be leader in the group) with its probability of appearance being 0. That way all civs in the group will actually become independents, and the independent-unit in their group won't appear at all.

    Comment


    • #3
      Re: Making AI spawn after certain condition

      Cheers mate! Thanks for the quick reply :) IŽll get on it right away...

      Comment


      • #4
        Re: Making AI spawn after certain condition

        Hi guys,

        I am having an issue with the "condition of presence". I want the AI to spawn when a variable is defined, which occurs around 10 minutes after spawn. I setup a game logic and defined a variable and then put the name of this variable in the "condition of presence" slot of each AI. Unfortunately, the AI will not spawn when the variable is defined. Whats going wrong and how can I work around this issue?

        Force
        http://www.tacticalgamer.com/image.php?type=sigpic&userid=36425&dateline=127483 7437

        Comment


        • #5
          Re: Making AI spawn after certain condition

          Condition of presence for spawning is checked only at the start of the mission. It's not a 'waitUntil' or somesuch. If the condition isn't fulfilled when it's that group's turn to get spawned, then they'll never spawn.

          To get AI to spawn 10 minutes into a mission you need to create them with createUnit in a script.



          Comment


          • #6
            Re: Making AI spawn after certain condition

            Thanks a lot for the help Ink i'll take a look at that!

            Force
            http://www.tacticalgamer.com/image.php?type=sigpic&userid=36425&dateline=127483 7437

            Comment


            • #7
              Re: Making AI spawn after certain condition

              I threw out an answer here:

              http://www.tacticalgamer.com/armed-a...ml#post1436986

              Borrows from the code of others.

              Comment

              Connect

              Collapse

              TeamSpeak 3 Server

              Collapse

              Advertisement

              Collapse

              Twitter Feed

              Collapse

              Working...
              X