Home   Help Search Login Register  

Author Topic: Getdir  (Read 2049 times)

0 Members and 1 Guest are viewing this topic.

Unnamed

  • Guest
Re:Getdir
« Reply #15 on: 10 Oct 2003, 07:16:30 »
Quote
? handsh*t _badman > 0.1 : goto "handsup"

Handshit should return true or false not a number?

I nearly said there was a typo, until I realize the forum has an inbuilt censor  :)

Gameer_77

  • Guest
Re:Getdir
« Reply #16 on: 10 Oct 2003, 09:00:05 »
Quote
handsHit soldier
Operand types:
    soldier: Object
Type of returned value:
    Number
Description:
    Check if soldiers hand are hit (inaccurate aiming).

Example:
    handsHit leader player

0 = Hands not hit
1 = Hands hit

I guess it's all dependant on the ammo used when you're hit, so if you're hit with a CZ75 round it's not going to do as much damage as a M16 one.

You also seem to get damaged hands when you crash your car. :o ;D

Gameer

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:Getdir
« Reply #17 on: 14 Oct 2003, 19:32:23 »
@Armstrong

Head over to the editor's depot and download a copy of toadlife's OFP trig guide. It has exactly what you need to know about trig for this kind of thing.

@LCD
Your function only returns a value from 0-180, not 0-360 like you say it does. check my comment under your function.
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:Getdir
« Reply #18 on: 14 Oct 2003, 21:44:07 »
Cheers for all replies ppl. I won't work on this mission I think until I get my new comp so I'll might drag this topic up again if it ain't working later.

Cheers guys! :-*

:beat: *Gets Shot* :beat:

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:Getdir
« Reply #19 on: 17 Oct 2003, 17:45:38 »
There's something wrong with LCD's function... :-\

Look here:

Code: [Select]
_badman = _this select 0

_angle = [player, _badman] call AngleFacingDiff

#startover

_badman setcaptive false

_morale = random 100 + 30
_morale2 = 0

#loop
~0.000001
? _angle > 60.0001 : goto "loop"
? _angle < 60 : goto "cont"
hint "Error! Error! How the fuck did this happen, ya punk?!"
#cont
? !(alive _badman) : hint "Woa!"
; Morale Negative
? handshit _badman > 0.1 : goto "handsup"
_damage = getdammage _badman
_damage = _damage * 3
_morale = _morale - _damage
; Morale Boosts
_damagep = getdammage player
_damagep = _damagep * 5
_morale = _morale + _damage
? _morale < 1 : goto "handsup"
~1
goto "loop"

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

As you see I've tried to put in a not(alive x) line to see if it was the function that was wrong. That was right. I think the script for some strange reason keeps looping to #loop instead of #cont. Any ideas why?

:beat: *Gets Shot* :beat:

Unnamed

  • Guest
Re:Getdir
« Reply #20 on: 17 Oct 2003, 17:54:26 »
Dont shoot me if I'm wrong, but you are not updating _angle in your loop?

I mean if you scripts starts with _angle  >60, it will never change, even if you move the player.

Is that what you want to happen?

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:Getdir
« Reply #21 on: 17 Oct 2003, 18:06:32 »
Yea, that did it. Sry guys, I'm new with functions ;)

:beat: *Gets Shot* :beat: