Home   Help Search Login Register  

Author Topic: Two Names For A Unit, Is It Possible?  (Read 735 times)

0 Members and 1 Guest are viewing this topic.

Alex

  • Guest
Two Names For A Unit, Is It Possible?
« on: 26 Feb 2004, 21:24:26 »
Hi All,
        Is It Possible To Have Two Names For A Unit Like crashchopper And player?

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Two Names For A Unit, Is It Possible?
« Reply #1 on: 26 Feb 2004, 21:40:15 »
In SP you can refer to the player unit as "player", or you can give it a name.    So I suppose it is possible in that case.   In MP I think "player" is local, but I'm not sure.    

And I suppose if you had a unit called loon1 you could write

loon2 = loon1


What are you trying to do?
Plenty of reviewed ArmA missions for you to play

Offline Raptorsaurus

  • Editors Depot Staff
  • *****
Re:Two Names For A Unit, Is It Possible?
« Reply #2 on: 26 Feb 2004, 21:41:17 »
The player controled unit can always be refered to as "player".  If you also name him (in the name line in the editor) he can then be refered to either as "player", or the name in his name field.  So for the player controled unit the answer is yes.  For AI units I would say the answer is no.

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:Two Names For A Unit, Is It Possible?
« Reply #3 on: 26 Feb 2004, 23:15:15 »
First, it's not as giving a unit a name, if you say: loon1 = player

It's more like assigning the referback loon1 to the object/unit
player.

Therefore you could say:
loon1 = player
loon2 = loon1
loon3 = loon1
loon4 = loon1
loon5 = player
loon6 = loon3

result: each loon will refer to the object/unit: player  ;)

~S~ CD
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

Alex

  • Guest
Re:Two Names For A Unit, Is It Possible?
« Reply #4 on: 27 Feb 2004, 08:51:35 »
I Mean I Am Trying To Do An Intro With A Chopper That Spins And Crashes, The Script Requires It To Have The Name crashchopper But I Need It To Have The Name player Or object1 Or Something But I Don't Know How To Get It. Hope That Made Sense Lol  :)

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:Two Names For A Unit, Is It Possible?
« Reply #5 on: 27 Feb 2004, 09:24:31 »
Just edit the script m8, put it up here and I'll fix it. :)

:beat: *Gets Shot* :beat:

Offline icarus_uk

  • Members
  • *
  • LiarLiarPants Inflame True
    • [furryclan]
Re:Two Names For A Unit, Is It Possible?
« Reply #6 on: 27 Feb 2004, 14:00:57 »
Or use a dummy chopper, after its crashed, replace it with the one you want.

Alex

  • Guest
Re:Two Names For A Unit, Is It Possible?
« Reply #7 on: 29 Feb 2004, 21:31:12 »
Here Armstrong,

Alex

  • Guest
Re:Two Names For A Unit, Is It Possible?
« Reply #8 on: 02 Mar 2004, 21:14:05 »
Hello?

fragsta

  • Guest
Re:Two Names For A Unit, Is It Possible?
« Reply #9 on: 02 Mar 2004, 22:28:33 »
Alex, it's easier to post it in the actually message, for future knowledge...I can't help you, I'm afraid...anyone? Here's the script, read up to find the problem:

Code: [Select]
; tail-rotor fail script by Vektorboson
; SYNTAX
; [CHOPPER, <RANDOMKILLS, MAXKILLS>] exec "effects\tailrotor.sqs"
; CHOPPER is the helicopter
; RANDOMKILLS is either true or false (random people are killed)
; MAXKILLS is maximum of randomkills

_heli   = _this select 0
_random = true
_maxkills = 4
?count _this == 2: _random = _this select 1; _maxkills = 4
?count _this == 3: _random = _this select 1; _maxkills = _this select 2

; Position of helicopter engine (adjust this for different helicopters!)
_enginePos = [0, -3, 1]

drop ["cl_fire", "", "Billboard", 1, 1, _enginePos, [0,-3,1], 0, 1, 1, 0.001, [1,5], [[1,1,1,1],[1,1,1,0]], [0], 0.1, 0.2, "", "", _heli]
~0.05
drop ["cl_fire", "", "Billboard", 1, 1, _enginePos, [0,-3,1], 0, 1, 1, 0.001, [1,5], [[1,1,1,1],[1,1,1,0]], [0], 0.1, 0.2, "", "", _heli]
~0.02
drop ["cl_fire", "", "Billboard", 1, 1, _enginePos, [0,-3,1], 0, 1, 1, 0.001, [1,5], [[1,1,1,1],[1,1,1,0]], [0], 0.1, 0.2, "", "", _heli]
_AddDir = 0.1
~(random 1)

#loop
_dir = getDir _heli
?_AddDir < 5: _AddDir = _AddDir + 0.05
_heli setDir (_dir + _AddDir)
_v = Velocity _heli
_heli setVelocity  [((_v select 0) / 1.001), ((_v select 1) / 1.001), -5]
drop ["cl_basic", "", "Billboard", 7, 7, _enginePos, [0,0,0], 0, 1, 1, 0.001, [1,5], [[0,0,0,0],[0,0,0,0.7],[0,0,0,0]], [0], 0.1, 0.2, "", "", _heli]
~0.01
?getPos _heli select 2 > 2: goto "loop"

?alive _heli: _heli setDammage 0.8; _heli setFuel 0
?!alive _heli: exit

?!_random: exit
; now the randomkills
_crew = crew _heli
_c = count _crew
_i = 0
_kills = 0
#crew
_unit = _crew select _i
?random 1 > 0.8 && _unit != player: _unit setdammage (random 1)
?random 1 > 0.8 && _unit != player && _kills < _maxkills: _unit setdammage 1; _kills = _kills + 1
_i = _i + 1
?_i < _c: goto "crew"

Unnamed

  • Guest
Re:Two Names For A Unit, Is It Possible?
« Reply #10 on: 03 Mar 2004, 04:20:39 »
Alex, sounds like your taking the example mission that probably came with the script, to literally.

In the editor just give your helicopter the name Heli01 or whatever:



Then call the script using the following:

Code: [Select]
[Heli01] Exec "TailRotor.sqs"

Alex

  • Guest
Re:Two Names For A Unit, Is It Possible?
« Reply #11 on: 03 Mar 2004, 08:18:39 »
Thanks So Much Mate!  ;D