Jump to content
tubby_mclovin

Three quick scripting questions

Recommended Posts

So I want to make a mission where I destroy an electrical box on Altis (cords for reference: 042,150) I have no idea how to create a task that will recognize the box as an object that needs to be destroyed. I would like it to complete the task when it gets destroyed as well but if the trigger doesn't recognize it then how would I do that? 

 


 

I also would to know how to have enemeies spawn as you get into proximity so that way I don't have 100 AI spawned when at the moment I only need the 10 that are near the task. Then when that task is complete it and the player moves to the next task the rest of the AI spawn. 

 

For the last thing I would like to know if there is any way of creating patrols that have a chance to spawn. Just to add replay abillity. For instance I have two patrols placed down and it has a chance to only spawn one patrol but the next time has a chance to spawn both.

 

Thanks!

Share this post


Link to post
Share on other sites

In the editor if you look on the top bar there is a buton call ID, clicking this will show all the ID numbers for the objects on the map. You can then use this number with the command nearestObject to find out if its benn destroyed. e.g

If you show the ID's and look at the last transformer in the row you will see it has an ID of 1076811.

Place the player nearby as an explosive specialist.

Place a Create Task module (modules > intel > create Task) near to the transformer as it will also be used as the position for the task and fill in some details..

Owner : All playable units

Task_ID : tsk_1

Title : Cut the Power

Description : Destroy the power transformer

Destination : Module position

State : Assigned

Place a Set Task Sate module (modules > intel > set Task State) and fill in the details, position does not matter but somewhere near by

State : Succeeded

Place a trigger near to the transformer and set its condition box to..

!alive (getpos thisTrigger nearestObject 1076811)

Now sync the createTask to the setTaskSate and sync the setTaskState to the trigger.

Preview the mission, you should have a task already assigned, place an explosive charge and destroy the transformer and the task should update as successful.

For your other questions you can look at either Simulation Manager (modules > Object Modifiers > Simulation Manager) which when placed down will disable and hide all AI that is a certain distance from the player, when the player comes in range of the AI they will be automatically enabled. This can help to save resources on missions that have alot of AI placed in the editor.

Or you could look up script packages like BangBobs EOS (Enemy Occupation System) or MurkSpawn. Think ive got the names right.

For patrols you could use the condition of presence in the insert units UI. Create you two groups, in the leader of one set his Probabilty of Presence to 50% and name him "L1" then in each of his subordinates condition of presence place alive L1. So if the leader does not spawn then neither do his subordinates.

Or you can look up script packages like UPSMON or spunFIN's spawnAI or the BIS spawn AI module.

Or bigger packages like ALive or Zeno's mission framework.

There are lots of resources out there maybe have a look on armaholic.com

  • Like 1

Share this post


Link to post
Share on other sites

@Larrow Thanks for the reply I will give this a try. As of right now I have the ALive mod. I just have yet to learn how to utilize it. I'm also trying to figure out the Anvil Framework. I will have to look into the script packages. 

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×