Home   Help Search Login Register  

Author Topic: Sandstorm Script - is one available in ArmA?  (Read 1500 times)

0 Members and 1 Guest are viewing this topic.

Offline JasonO

  • OFPEC Patron
  • ****
  • Oh no...
    • The New Life RPG
Sandstorm Script - is one available in ArmA?
« on: 17 Aug 2008, 04:04:04 »
Hi guys,

I've had a search on the forum, and realised I asked this question 2 years ago but for OFP. Since then I've formatted my PC so no longer have any sandstorm scripts that I can try and convert.

What I need is a script that will simply create some floating sand around a player. It is for an MP Mission, but I can make it so only the player has sand around him, and it won't be created around other players if the player isn't the unit (if that makes any sense? :P).

If one doesn't exist, I guess I can make my own, although I've never had any luck with particles (too many paramaters for my brain to handle in 1 command lol).

Thanks for your help OFPEC & friends :)

Jason

Offline JasonO

  • OFPEC Patron
  • ****
  • Oh no...
    • The New Life RPG
Re: Sandstorm Script - is one available in ArmA?
« Reply #1 on: 20 Aug 2008, 20:27:17 »
After some hunting, a friend of mine in my co-op clan managed to find something in one of his missions.

I thought I might aswell post it, as someone is bound to search and come here to see an empty thread - and I hate it when that happens :dry:

Credit goes to Toadeater.

Code: [Select]
; ***************************************************
; Sand Storm Script 1.0
; by Toadeater (toadeater@wolfenet.com)
; ***************************************************
;
; Usage: Activate from the player's init line, or a script:
; [playername] exec "duster.sqs"
;
; If you want to use this script in a cutscene, attach it to a camera, otherwise
; the "sand" won't be seen from the camera's point of view.
; E.g. [camera1] exec "duster.sqs"
;
; Turn off by setting the "dustoff" variable to true via a trigger or script, etc.
; dustoff = true

dustoff = false
_target = _this select 0
? _target == player : _target = player
_delay = .1

; Change to a higher # if you want more randomization

_wind = 2

; Particle color values, change to match island/weather, e.g. snow.
; _r = red, _g = green, _b = blue

_r = .217
_g = .184
_b = .144

;_r = .38
;_g = .36
;_b = .25

; The other settings pretty much depend on each other, change them at your own risk.

_delay = 0.10
_strength = .25
_distance = 600
_size2 = 100
_dirx = 0
_diry = 0
_dirz = 2
_height = 0
_spin = -33

#loop

? (speed _target) > 1 : _delay = .05
? (speed _target) < 2 : _delay = .1
? (speed _target) > 1 : _distance = 25
? (speed _target) < 2 : _distance = 15
;? (getpos _target select 2) > 20 : goto "wait"
? _spin > 33 : _spin = -33
_spin = _spin + (random 13)
_size1 = 20 + (random 60)

_dir180 = (getdir _target) + 181 + _spin
_pos4 = [((getPos _target) select 0) + _distance * (sin _dir180), (getPos _target select 1) + _distance * (cos _dir180), _height]
drop ["\ca\data\cl_basic","","Billboard",3,2,_pos4,[_dirx,_diry,_dirz],0,25,19,0,[_size1,_size2],[[_r,_g,_b,_strength],[_r,_g,_b,_strength],[_r,_g,_b,_strength],[_r,_g,_b,_strength]],[0],.5,_wind,"","",""]
~_delay
_dir90 = (getdir _target) + 9 + _spin
_pos2 = [((getPos _target) select 0) + _distance * (sin _dir90), (getPos _target select 1) + _distance * (cos _dir90),_height]
drop ["\ca\data\cl_basic","","Billboard",3,2,_pos2,[_dirx,_diry,_dirz],0,25,19,0,[_size1,_size2],[[_r,_g,_b,_strength],[0.2,0.2,.1,_strength],[_r,_g,_b,_strength],[0.21,0.2,0.1,_strength]],[0],.5,_wind,"","",""]
~_delay
_dir270 = (getdir _target) + 271 + _spin
_pos6 = [((getPos _target) select 0) + _distance * (sin _dir270), (getPos _target select 1) + _distance * (cos _dir270),_height]
drop ["\ca\data\cl_basic","","Billboard",3,2,_pos6,[_dirx,_diry,_dirz],0,25,19,0,[_size1,_size2],[[_r,_g,_b,_strength],[_r,_g,_b,_strength],[_r,_g,_b,_strength],[_r,_g,_b,_strength]],[0],.5,_wind,"","",""]
~_delay
_dir45 = (getdir _target) + 45 + _spin
_pos1 = [(getPos _target select 0) + _distance * (sin _dir45), (getPos _target select 1) + _distance * (cos _dir45), _height]
drop ["\ca\data\cl_basic","","Billboard",3,2,_pos1,[_dirx,_diry,_dirz],0,25,19,0,[_size1,_size2],[[_r,_g,_b,_strength],[_r,_g,_b,_strength],[_r,_g,_b,_strength],[_r,_g,_b,_strength]],[0],.5,_wind,"","",""]
~_delay
_dir315 = (getdir _target) + 315 + _spin
_pos7 = [((getPos _target) select 0) + _distance * (sin _dir315), (getPos _target select 1) + _distance * (cos _dir315),_height]
drop ["\ca\data\cl_basic","","Billboard",3,2,_pos7,[_dirx,_diry,_dirz],0,25,19,0,[_size1,_size2],[[_r,_g,_b,_strength],[_r,_g,_b,_strength],[_r,_g,_b,_strength],[_r,_g,_b,_strength]],[0],.5,_wind,"","",""]
~_delay
_dir135 = (getdir _target) + 135 + _spin
_pos3 = [((getPos _target) select 0) + _distance * (sin _dir135), (getPos _target select 1) + _distance * (cos _dir135),_height]
drop ["\ca\data\cl_basic","","Billboard",3,2,_pos3,[_dirx,_diry,_dirz],0,25,19,0,[_size1,_size2],[[_r,_g,_b,_strength],[_r,_g,_b,_strength],[_r,_g,_b,_strength],[_r,_g,_b,_strength]],[0],.5,_wind,"","",""]
~_delay
_dir225 = (getdir _target) + 225 + _spin
_pos5 = [((getPos _target) select 0) + _distance * (sin _dir225), (getPos _target select 1) + _distance * (cos _dir225),_height]
drop ["\ca\data\cl_basic","","Billboard",3,2,_pos5,[_dirx,_diry,_dirz],0,25,19,0,[_size1,_size2],[[_r,_g,_b,_strength],[_r,_g,_b,_strength],[_r,_g,_b,_strength],[_r,_g,_b,_strength]],[0],.5,_wind,"","",""]
~_delay
_pos = [(getPos _target select 0) + _distance * sin (getdir _target), (getPos _target select 1) + _distance * cos (getdir _target),_height]
drop ["\ca\data\cl_basic","","Billboard",3,2,_pos,[0,0,3],0,40,35,0,[_size1,_size2],[[_r,_g,_b,_strength],[_r,_g,_b,_strength],[_r,_g,_b,_strength],[_r,_g,_b,_strength]],[0],.5,_wind,"","",""]
~_delay

? dustoff : goto "exit"

Goto "loop"

#wait

? (getpos _target select 2) < 20 : goto "loop"
? dustoff : goto "exit"
~1
goto "wait"

#Exit

Should explain how to use the script, and the rest self-explanatory if you give it a quick read through. Save as a .sqs file.