Home   Help Search Login Register  

Author Topic: Many questions..........  (Read 2728 times)

0 Members and 1 Guest are viewing this topic.

Offline haroon1992

  • Members
  • *
  • My life is hopeless...
Many questions..........
« on: 25 Sep 2010, 16:35:05 »
Q1 : pathfinding

I've been testing the AI pathfinding of ARMA 2 and has been greatly....depressed.... :(

I can't even make a unit walk into a barn and then go back outside!

I'm making a mission in which the player is kept as prisoner in a barn...and he must escape.
But I can't even make a decent cutscene featuring one of the guards telling the player to clean the floor and then getting outside of the barn!

Do I have to use the animations to do this?
(like the walking front anims etc)

Q2 : Setvectorup and setvectordir

And I am also wandering how I could use the setvectorup and setvectordir
the format is in [x,Z,y] but
how do i make an object upside down with setvectorUp?
how do I make a car on its right-side touching the ground and its left-side point towards the sky?
(is that called half-flipped? sorry for the weak vocabulary in english)

Q3 : Blur effect or PPeffects

I heard there is a command called ppeffect or something....I want to make the screen blur when player is red(heavily injured) and I also want to know how I could make some screen effects such as focus,distortions etc.(or is it even possible?)

Q4 : Magazines and weapons

Is there any way to check the magazine of a weapon via command?
For example : I want to get the magazine of MP5 via command and add it to the player.
I was doing something like this and it failed :
Code: [Select]
_mag = magazine primaryWeapon player;
player addMagazine _mag;

Q5 : Simulate "too stubborn to die"?

I want to make the player not die when shot by the enemy but immobilized,only able to crawl slowing on ground.
The very same thing that happens when one of the First Aid Modules has been used.
(But I don't want to use it, because it has some serious issues and it cause lag)

Q6 : Shoot only legs?

How do i make the enemy to shoot the player only at the legs?
Or damage the player's leg via script so that he no longer will be able to walk?



Regards,
Haroon1992
Very busy with life, business, and other stuff. Away from OFP for months. Not sure if I could get back onto it. :(

Offline Zipper5

  • BIS Team
  • ****
Re: Many questions..........
« Reply #1 on: 25 Sep 2010, 17:36:53 »
1) Yes, I think the best way is to script it using animations. I don't know if pathfinding's gotten worse, but in some ways it hasn't gotten better. Have you tried using building positions assigned to waypoints? If you can't get it to work as you want it with that, then go with animations.

2) Don't know enough about those commands to help you here. Hopefully someone else can.

3) There are many new commands for controlling post process effects in Arma 2, namely ppEffectCreate, ppEffectAdjust and ppEffectCommit. Check out the COMREF for the rest of them. You can also script a camera shake effect by using addCamShake, but that's specific to OA.

4) I'm not sure if there is any command to check the specific magazine in use by only one of the player's weapons. There is, however, the magazines command, but that returns every different magazine in the unit's inventory.

5) I guess that depends on if you want the player to take damage up to a certain level and become immobilized, or get to the point where he would otherwise be dead and have it happen. Either way, you'd need to have a trigger checking the damage of the player and once it reaches a specific point to set his damage to less than it is (if you want him to have to take more damage before dying when immobilized) and setHit his legs so that he can't use them. So something like this:

Condition line:
Code: [Select]
damage player > 0.75Activation line:
Code: [Select]
player setHit ["legs", 1]And set it to "Repeatedly". Obviously that's a pretty simplistic scenario, and you could probably make it better with a more complex scripting method, but that will get the job done. Also, play around with the 0.75 value to see after which damage level do you want the unit to become immobilized.

6) For this you'll probably want to use the handleDamage eventhandler to check if he's been hit in the legs before taking damage. I don't believe it's possible to make the AI only target his legs, however. To manually script the player to take damage to his legs, use:
Code: [Select]
player setHit ["legs", <damage value>]
Hope that helps.

Offline Pirin

  • Members
  • *
Re: Many questions..........
« Reply #2 on: 25 Sep 2010, 23:37:10 »
[4]:  Since you already know the kind of ammo that goes in an MP5, use this:

Code: [Select]
player addMagazine "30Rnd_9x19_MP5";
If you wanted to add a single magazine of ammo for whichever rifle the player has, try this:

Code: [Select]
player addMagazine (getArray (configFile >> "cfgWeapons" >> primaryWeapon player >> "magazines") select 0);
« Last Edit: 25 Sep 2010, 23:41:31 by Pirin »

Offline haroon1992

  • Members
  • *
  • My life is hopeless...
Re: Many questions..........
« Reply #3 on: 26 Sep 2010, 16:39:56 »
@Zipper5
Your answers are awesome!
Really really thank you for your efforts!  :clap:

Q[5]
What I want to do is to make the player immortal!

The player immediately dies when the enemy continuously shot him with for example a machine gun...
The trigger detects the damage but it cannot revive player! :(

The HIT eventhandler also is the same.The script called by the HIT eventhandler only contains :
Code: [Select]
player setdammage 0;
@Pirin
Your second code explains it! That's what I've exactly demanded! :clap:
Thank you very much too!

There is still Question 2 unanswered.
And its also important for me,because I'm now trying to load a Ural(Open) with dead bodies and debris(cans,buckets,mops,etc)

Regards,
Haroon1992
Very busy with life, business, and other stuff. Away from OFP for months. Not sure if I could get back onto it. :(

Offline Binkowski

  • OFP-fanatic
  • OFPEC Patron
  • ****
    • My Personal Website
Re: Many questions..........
« Reply #4 on: 02 Oct 2010, 05:05:31 »
regarding question 2.

i've never messed with the setvector stuff, but maybe use attachTo? that's a new feature with ArmA2 that everyone likes. well, if you can figure it out of course. i have yet to learn how to use it. lol.