Home   Help Search Login Register  

Author Topic: Morale Script  (Read 939 times)

0 Members and 1 Guest are viewing this topic.

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Morale Script
« on: 06 Oct 2003, 17:29:03 »
This is my very primitive script for my next mission, I'll improve it as soon as I'll get it to work. ::) I don't get any errors or something it just won't work! Any1 know what's wrong with it? Cheers!

Code: [Select]
_badman = _this select 0

#startover

_badman setcaptive false

_morale = random 100 + 30

#loop
; Morale Negative
? handshit _badman : goto "handsup"
_damage = getdammage _badman
_damage = _damage * 2
_morale = _morale - _damage
; Morale Boosts
? handshit player : _morale = _morale + 3
_damagep = getdammage player
_damagep = _damagep * 2
_morale = _morale + _damage
? _morale < 1 : goto "handsup"
~5
goto "loop"

#handsup
_badman switchmove "FXWomanSur"
_badman setcaptive true
_morale2 = _morale2 + (player distance _badman)
_morale2 > 1000 : goto "startover"
~5
goto "handsup"

:beat: *Gets Shot* :beat:

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Morale Script
« Reply #1 on: 06 Oct 2003, 17:52:06 »
Armsty you should be able to delete the other thread since only you have posted on it ... certainly if you do it post by post.


_morale2 is not defined at the start

I don't see how _morale could ever get to less than 1.  It starts off at greater than 30 and then has -damge and +damage applied to it, which will leave it as it is:  with the possibility of having +3 added along the way.

Near the end you need a ?  before morale2

Plenty of reviewed ArmA missions for you to play

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:Morale Script
« Reply #2 on: 06 Oct 2003, 18:14:08 »
Where's the delete thread button? ???

Cheers macca, I'll try that out, and it should sink below 0 if player ain't wounded/lesser wounded than badman.

:beat: *Gets Shot* :beat:

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:Morale Script
« Reply #3 on: 06 Oct 2003, 18:21:34 »
OK, figured it out now. I've alwaysed tested this script with shooting _badman in his hands so handshit will turn true, but it looks like it's handshit that screws up. Any ideas?

:beat: *Gets Shot* :beat:

m21man

  • Guest
Re:Morale Script
« Reply #4 on: 06 Oct 2003, 20:36:45 »
I think that the shaky hands script would be great for regular soldiers, but please don't use it on snipers! The sniper rifle going completely still is OFP's way of simulating a deployed bipod, and rifles don't shake and wobble on a bipod.

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:Morale Script
« Reply #5 on: 06 Oct 2003, 20:39:24 »
wrong thread? My shaky hands idea is at scripting: ideas ;D ::)

:beat: *Gets Shot* :beat: