Home   Help Search Login Register  

Author Topic: Reveal All & Purposely Miss  (Read 1631 times)

0 Members and 2 Guests are viewing this topic.

Jaenak

  • Guest
Reveal All & Purposely Miss
« on: 03 Feb 2004, 01:07:06 »
I'm a regular to the Bohemian Interactive forums but everyone seems to love this site.  I asked this question over there but no one could help so I decided to come here.

I'm making a cutscene where I have a russian base and resistance troops on the hills all around it.  Problem is alot of the resistance troops are barely too far away from the Russians to detect them.  A firefight isn't exactally a firefight unless someone knows about the other.  My question is that I would like to know how to make everyone know about everyone else so that when I switch them all to combatmode "red", they'll actually shoot each other.

As long as I'm posting, another thing I wanted to know about the firefight I'm in the proccess of making.  Is it possible to make everybody intentionally miss each other until you tell them to dotarget and dofire?  Reason why I ask is because I need many of the resistance people to stay alive but the getdammage & setdammage trick causes them to jump to their feet every time they get hit and the computer "setdammage 0".

j-man

  • Guest
Re:Reveal All & Purposely Miss
« Reply #1 on: 03 Feb 2004, 05:25:35 »
If you want everyone to know about everyone else, just use the reveal command.

Code: [Select]
east1 reveal west1
east1 reveal west2

etc...

I'm sure there is another way to do this other than doing it for each induvidual soldier. Array mabey?  ???

I'm not sure about your secound question. i suppose you could set every ones skill level really low and then make it higher later (if that's even possible)

**edit**
Corrected some spelling errors
« Last Edit: 03 Feb 2004, 05:26:29 by j-man »

Jaenak

  • Guest
Re:Reveal All & Purposely Miss
« Reply #2 on: 03 Feb 2004, 06:04:43 »
I knew about the reveal command.  I was hoping a person could do something like
Code: [Select]
resistance reveal eastor something like it but the game won't accept anything like that.  It wants groups or objects to place on either side of the reveal command.  Problem though is that the cutscene I'm making dictates that all the resistance people be in their own groups.  It's still possible, but it'd take an astounding amount of reveal commands.  I was hoping if anyone knew of a faster way of doing it than that.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Reveal All & Purposely Miss
« Reply #3 on: 03 Feb 2004, 11:27:21 »
If you want Resistance to stay alive you don't have to use scripting, all you need is good unit choice and placement and a bit of playtesting till its coming out with the right result.

j-man's idea is a good one.    Use the setSkill command.

As for reveal, this is not really a reveal question its an array question.    In principle I think this should work, though not absolutely sure

"[array of Resy] reveal _x" forEach [array of east]

And vice versa of course.   There are lots of ways to create the arrays.   You could just type in the names of the groups:  the max is only 63 groups per side so that's easy.   Alternatively you could use a trigger covering the whole map, something like this:-

Area:  whole map
Activation box:   Resistance present
Condition:  this and getArray
On activation:   ResArray = thislist

Not guaranteed, but when the variable getArray is set to true then ResArray becomes an array of all the Resy units on the map.    You can then use this for your reveal command script.   Similarly for the East units.


Edit:  suggest you test it on a small scale till you figure out the correct syntax.
« Last Edit: 03 Feb 2004, 11:28:18 by macguba »
Plenty of reviewed ArmA missions for you to play

Jaenak

  • Guest
Re:Reveal All & Purposely Miss
« Reply #4 on: 03 Feb 2004, 16:28:58 »
I've already thought of that idea for the reveal command.  It wouldn't accept an array.  It would only accept an object or group for the reveal command.  I was hoping there was a workaround though.

As for your comment on the setskill, placement and unit choice, could you explain a little more?  I don't quite understand.  I'm thinking you're saying something like, 'If the resistance soldiers are hidden and their skill is high enough, and if the east soldier's skills are low enough, the resistance soldiers should be able to perforate them without dieing themselves.'  Am I understanding that correctly or not?  If I am understanding that correctly, that certainly is an idea! :)  And besides that, that'd be a whole lot easier than using code.

Edit:  Dude!  I had no idea 1.96beta was out!  Cool!
« Last Edit: 03 Feb 2004, 16:32:32 by Jaenak »

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Reveal All & Purposely Miss
« Reply #5 on: 03 Feb 2004, 17:16:58 »
Quote
I've already thought of that idea for the reveal command.  It wouldn't accept an array.
???

The syntax macguba posted works 100%... And I should know since I've used same and similar syntaxes dozens of times...

Are you sure you tested it exactly that particular way?

However, the reveal command sets the knowsAbout value to 1 for the unit the other was revealed. This does not always mean that the AI will attack... Only if the revealed unit is close enough... Don't know how close though...

 
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Reveal All & Purposely Miss
« Reply #6 on: 03 Feb 2004, 17:25:43 »
Ah.  How tedious.   Well, knuckle down and do the typing then.  It won't take as long as you think.

Skill:  yes, that's exactly it.    You can set a loon's skill in the skill bar when you place him in the Editor.   You can change it during the mission with the setSkill command.  I wouldn't recommend that for normal gameplay, but it's fine in a cutscene.   The difference between min and max skill is significant.

Unit choice.    For example, snipers and machine gunners are the best units for long distance stuff, so give lots of them to the side that you want to win at long distance and only a few to the others.  LAW soldiers have a lower camouflage rating (I believe) because they have a dirty great launcher over their shoulder.     Mortars and Heavy Grenadiers can be devastating to infantry in the open, if you can persuade them to fire.      If you are not familar with the vices and virutues of different types its worth spending an afternoon inventing wee test missions and just playing around with them.

Unit placement.     One well placed unit can take out a whole squad.     If I want to put a sniper at the bottom of a tree I'll  Preview the mission either as the sniper himself or a temporary observer placed next to him.    It takes 5 - 10 Previews to get him in the right place once you have decided which tree, and that can take 5 - 10 attempts in itself.    Then you playtest it to discover if you've got it right.    It can take a whole editing session to get one sniper in just the right place, but once he is there boy is it worth it.

OFP is a very sophisticated game.    Part of the skill of the mission designer is learning how to make the best of what it can do.   Scripting (more than one line of code) is a last resort.


Edit:  this was written before HateR_Kint's reply.    I confess I thought it would work.    Max knowsAbout value is actually 4, and yes, the unit won't necessarily attack at once.    If the unit is too far away to have a high knowsabout value he's probably too far away to attack anyway.
« Last Edit: 03 Feb 2004, 17:29:29 by macguba »
Plenty of reviewed ArmA missions for you to play

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Reveal All & Purposely Miss
« Reply #7 on: 03 Feb 2004, 21:34:14 »
Ooops... :-[

Actually that exact syntax wont work for the reveal thingy (or ???), a little 'read error' there...  :-\
(and I even have glasses for chrissakes  :P )

It would be best done in a script loop, something like:

Code: [Select]
_friends   = _this select 0
_enemys  = _this select 1
_i = count _enemys

#loop
"_x reveal (_enemys select _i)" forEach _friends

_i = _i - 1
?(_i == 0): exit
~.1
goto "loop"

Call the script for both sides separately with:
[arrayOfFriendlyUnits,arrayOfEnemyUnits] exec "script.sqs"

Not guaranteed to work, so you might need some tweaking...  :P

That knowsAbout 1 does not even make the AI to report a contact, it most likely should be over 1.05 (or was it 1.5...) before the AI reacts, so very far away targets won't rise that knowsAbout over the needed value... AFAIK...
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Dubieman

  • Guest
Re:Reveal All & Purposely Miss
« Reply #8 on: 03 Feb 2004, 21:56:15 »
One little tidbit of info so you can have the reistance units win easily and lose some guys at the same time...

this addeventhandler ["hit",{_this select 0 setdammage 0}]

This makes it so the one bullet that can kill someone must be able to inflict 1 damage or full damage. Put that code in the init lines of resistance solders you want to live, the only way for them to die is a direct head shot or grenade I think at close range. This works on vehicles to so basically, to kill the solder, you must shoot his head off or have one hell of a "silver" bullet. ;D

Hope it helps

Jaenak

  • Guest
Re:Reveal All & Purposely Miss
« Reply #9 on: 04 Feb 2004, 03:53:06 »
Thanks Guys!

GuiltyRoachKilla, that really helps, seriously.  :)

HateR_Kint, call me stupid but what would [ArrayOfFriendlyUnits,ArrayOfEnemyUnits] look like?  Funny thing being that I've been editing long enough to know roughly what the heck I'm doing but I'm still kinda fuzzy on what an array is 'cause I've never asked about it. :-[

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Reveal All & Purposely Miss
« Reply #10 on: 04 Feb 2004, 11:04:54 »
Here is a very quick and very dirty guide to arrays.  

An array is a list.   That's all it is, a list of something.

In OFP code, an array is indicated by square brackets [ ].   However, that's really only for when you are listing the members of the array individually.    If the array has a name then you don't need the brackets around the name.

command [loon1, loon2, loon4]
command myArray

A nasty twist is that a group is not, in formal coding terms, an array.   So when you want to do array commands with a group you have to add the word units.   For example, command units grp1.   There are some other specific types of array which are described in the "Array topics" section of the comref.

To create an array of, say, all the East units on the map at the start of the mission you could use a trigger like this

Area:   whole map
Activation box:   East present
Condition:    this
On activation:    EastArray = thislist

You could then use EastArray in a script somewhere.   Exact syntax not guaranteed.
Plenty of reviewed ArmA missions for you to play

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Reveal All & Purposely Miss
« Reply #11 on: 04 Feb 2004, 17:21:25 »
HateR_Kint, call me stupid but what would [ArrayOfFriendlyUnits,ArrayOfEnemyUnits] look like?
mac has a good explanation of arrays above, so do the trigger thingy for both sides so you then have EastArray and ResArray.

Then run the script twice:
[EastArray,ResArray] exec "script.sqs"
[ResArray,EastArray] exec "script.sqs"

Hope it works...
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Jaenak

  • Guest
Re:Reveal All & Purposely Miss
« Reply #12 on: 04 Feb 2004, 18:34:15 »
Thanks!  I owe you guys one.  The script worked!  Plus, I did a tiny test mission.  I stuck an unarmed east soldier in front of me with
Code: [Select]
this addeventhandler ["hit",{_this select 0 setdammage 0}] in his init line like guiltyrochkilla suggested and he even stood up to a hand grenade!  Thanks again.  This solves all my problems so far.