Jump to content
Sign in to follow this  
Deuce82

Scripting Questions

Recommended Posts

I'm new to scripting so i'm sure this is posted some where but looking became rather burdensome.

I need to know if there are scripts for the following actions/ Conditions

- set civilians to be hostile towards OpFor

- set stamina for certain units

Share this post


Link to post
Share on other sites

I'm 100% sure there is a way to get civilians to be hostile toward OpFor, I do believe it is the "rate" command, but i'm not sure how to do it, I completely forgot :(

As for the stamina, I highly doubt it, but if there is, i'd really like to use the script :)

Sorry for not being productive, just wanted to tell you there is a way to make civis go hostile! (Free bump!)

Share this post


Link to post
Share on other sites

i'm not sure what the rate command is but thats awesome that its possible. the scenario i'm setting up is civilians who have to defend their town from the OpFor Army that is attacking. i also need a time delay spawn script so at a given amount of time into the mission, the OpFor forces spawn in and start moving towards the town

Share this post


Link to post
Share on other sites

Here's 2 ways for your first question:

This addRating -2000

For all east units.

Or try:

Civilian setFriend [East, 0];[/Code]

Share this post


Link to post
Share on other sites

The setSkill would be your best bet on setting stamina, see this link for details: community.bistudio.com/wiki/setSkill_array

As for civilians becoming hostile towards OpFor, you can set independents to be not friendly towards OpFor, resulting in civilians fearing them. Does this help you or did you mean some other kind of hostility? If you want armed civilians to shoot at OpFor units, you can use local guerilla units, or group the civilians with a higher ranked BluFor or guerilla unit which has probability of presence set to 0. Alternatively, you can make a script (preferably fsm script) that checks for some conditions and makes civilians and OpFor react based on them, but this would require quite a lot of work and some scripting skills.

Share this post


Link to post
Share on other sites

well the Premiss of the mission is the unit i'm in will be all civilians around a city that will be attacked by an invading russian army. somewhat simulating an Arab Red Dawn and also the Soviet invasion of Afghanistan. so i want the AI OpFor units invading to target the Civilians who are Human and AI controlled. i'm going to give those recommendations a try really quick i'll get back to you. Thanks Guys

Share this post


Link to post
Share on other sites

Bobtom, I tried adding both of those commands to the init lines of the civilian and east units respectively and they int work. Th OpFor units did not attack

Share this post


Link to post
Share on other sites

Eh, well either the wiki is wrong or you did something wrong. I'm not able to check right now.

Share this post


Link to post
Share on other sites
I tried adding both of those commands to the init lines of the civilian and east units respectively and they int work. Th OpFor units did not attack

Hi... Don't add them to the init fields of any units. Create a file in your mission folder called init.sqf. This will be executed once at mission start. You can use it to initialise things.

Civilian setFriend [East, 0]; only needs to be done once... so it's ideal for the init.sqf.

So put the line in the file....then try it.

You can get commands like setFriend to work from the init fields of many things.... but much better from a script that you can easily open and read instead of clicking on every single item in your mission to try to find where you put the line.

Edited by twirly
Added link

Share this post


Link to post
Share on other sites

Twirly thanks a ton and Bobtom please feel free to do the facepalm as displayed in ur avatar. i totally beefed it i didnt make the init.sqf yet lol. noob move this is my first mission attempt.

---------- Post added at 01:19 AM ---------- Previous post was Yesterday at 11:51 PM ----------

so the Civilian deal is worked out fine. now i need some help with having the attacking units move to a waypoint, wait for X amount of time and then proceed to the assault. how is this done?

Share this post


Link to post
Share on other sites
Twirly thanks a ton and Bobtom please feel free to do the facepalm as displayed in ur avatar. i totally beefed it i didnt make the init.sqf yet lol. noob move this is my first mission attempt.

No need for face palm mate. My avatar is directed at a certain game (Dragon Rising). :D

I'm glad I could try and help, good thing Mr. twirly is here.

-Craig

Share this post


Link to post
Share on other sites

I'm going to start a new thread for the time delay question i have.

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
Sign in to follow this  

×