Home   Help Search Login Register  

Author Topic: Steam from breath conversion  (Read 11472 times)

0 Members and 1 Guest are viewing this topic.

Offline The-Architect

  • Former Staff
  • ****
  • Bite my shiny metal...
    • Bob's Un-official Flashpoint Page
Steam from breath conversion
« on: 11 Nov 2005, 05:36:45 »
How do you convert the following script so that it makes steam come from the player's breath like it's cold?

;===MIF CIGGY v0.7===;
; [unitname] exec "ciggy.sqs"
; in order to stop smoking, the units behaviour needs to be else than "safe"
; the script uses 1 sound, it's only a dummy for the unit to move his lips.
; copy the lines from the description.ext and the sound folder.
;====================;
_smoka = _this select 0
_anims = ["","FXFromKneel","FXshow2","FXshow4","","FXCivilLookaround","FXCivilLookaround2","FXCivilLookback", "FXCivilFoldOnesArms","FXCivilArmsAkimboR","FXCivilArmsAkimboL", "","FXFromHand",""]

#init
? (! alive _smoka) : exit
? (_smoka != vehicle _smoka) : goto "wait"
? (speed _smoka > 0.1) : goto "wait"
? (behaviour _smoka != "SAFE") : goto "wait"
_dur = 0
_p = 0
_vz = 0
_rdp = 0
_rdi = 0
_fsize = 0.3
_rb = 0
_smoka playMove "FXCivilHandMouth"
~3.8

#prepuff


#puff
;puff
drop ["cl_basic", "", "SpaceObject", 2.5, _dur, [(getPos _smoka select 0) - 0.1 *(sin(getDir _smoka)), (getPos _smoka select 1) - 0.1 *(cos(getDir _smoka)),(getPos _smoka select 2) + 1.58], [0.3*(sin(getDir _smoka)),0.3*(cos(getDir _smoka)),_vz], 1, 0.00574, 0.0045, _rb, [0.016,0.15,_fsize], [[1,1,1,0.01], [1,1,1,0.25], [1,1,1,0.01], [1,1,1,0]], [0,1,0,1,0,1], _rdp, _rdi, "", "", ""]
;secondary
? _p < 15 : drop ["cl_basic", "", "SpaceObject", 2.5, _dur/2, [(getPos _smoka select 0)-0.001 *(sin(getDir _smoka)), (getPos _smoka select 1)-0.001 *(cos(getDir _smoka)),(getPos _smoka select 2) + 1.58], [0.03*(sin(getDir _smoka)),0.03*(cos(getDir _smoka)),0.3+_vz], 1, 0.00578, 0.0045, _rb, [0.046,0.15,_fsize], [[1,1,1,0.01], [1,1,1,0.25], [1,1,1,0.01], [1,1,1,0]], [0,1,0,1,0,1], 5*_rdp, 5*_rdi, "", "", ""]

_p = _p + 1
~0.01

? _dur > 6 = _dur = _dur - 1
? _dur < 5.9 : _dur = _dur + 1
? _p > 2 : _fsize = _fsize + 0.03
? _p > 5 : _rb = _rb + 0.003
? _p > 10 : _vz = _vz + 0.008; _rdp = _rdp + 0.01; _rdi = _rdi + 0.0015
? _p > 20 : goto "anim"
goto "puff"


#anim
~3+(random 2)
_an = random (count _anims)
_an = _an - ( _an mod 1 )
_smoka Playmove (_anims select _an)
~6+(random 5)
_smoka playMove "FXCivilHandMouth"
~3.8
goto "init"


#wait
~1
goto "init"



#edited to sort page formatting going off the edge...
« Last Edit: 24 Nov 2005, 08:47:21 by bedges »
James Andrew Wilkinson 1977 - 2005 R.I.P.
"If it ain't the friggin' incoming it's the friggin' outgoing. Only difference is who gets the friggin' grease, and that ain't no friggin' difference at all."

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Steam from breath conversion
« Reply #1 on: 11 Nov 2005, 11:35:01 »
Does it really even need that much changing?
Other than removing the animation stuff (#anim, etc..)...

You won't be able to make that effect very good because there's no way you can detect which way the unit's face is.. well.. facing...
So the breath 'fumes' will always 'shoot' forwards even if the unit was looking as much on either side as possible...

Same goes with this cigarette smoking stuff..
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline The-Architect

  • Former Staff
  • ****
  • Bite my shiny metal...
    • Bob's Un-official Flashpoint Page
Re:Steam from breath conversion
« Reply #2 on: 12 Nov 2005, 23:14:12 »
I tried removing all the anim stuff but it didn't work. I can't script so that might have had something to do with it.

Anyone help with the conversion? The facing bit shouldn't matter I don't think. If you're looking to the side you won't see the mist going the wrong way unless you're in external view. I think It's acceptable.
James Andrew Wilkinson 1977 - 2005 R.I.P.
"If it ain't the friggin' incoming it's the friggin' outgoing. Only difference is who gets the friggin' grease, and that ain't no friggin' difference at all."

marcus3

  • Guest
Re:Steam from breath conversion
« Reply #3 on: 13 Nov 2005, 16:50:38 »
ok i messed around with this some, this is what i got. put the pbo in your missions folder

yes its on desrit island, but lets keep this simple right?
i will work on this some more

Offline The-Architect

  • Former Staff
  • ****
  • Bite my shiny metal...
    • Bob's Un-official Flashpoint Page
Re:Steam from breath conversion
« Reply #4 on: 14 Nov 2005, 08:35:37 »
Looks good on AI. It doesn't seem to work when the unit is kneeling or laying down. The mist still comes out, but from a place wheer the unit's head would be if he were standing.

A couple of questions.

How do I make it so that there is about half the mist?

How can I make it work better on the player?
James Andrew Wilkinson 1977 - 2005 R.I.P.
"If it ain't the friggin' incoming it's the friggin' outgoing. Only difference is who gets the friggin' grease, and that ain't no friggin' difference at all."

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Steam from breath conversion
« Reply #5 on: 14 Nov 2005, 19:46:14 »
Oh yeah, totally forgot to 'put down' this idea ;D :P ::) with another BISd OFP feature:

You can't detect the units stance so you can't have the 'breath fumes' come out of the head position automatically... :(
The original smoking script uses a fixed height which is selected according to the units stance it uses with the smoking animation..
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

marcus3

  • Guest
Re:Steam from breath conversion
« Reply #6 on: 14 Nov 2005, 21:45:48 »
i am not all the way sure how to use the drop command :P so, this is as good as it gets from me  ;D, it would be very hard to make it so it comes out when he is laying down......yeah. half the mist? i have no idea...maybe fool around with the numbers here and there and watch...

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re:Steam from breath conversion
« Reply #7 on: 15 Nov 2005, 01:06:20 »
give me a few minutes, and I think I can tweak the mist down to about half...

anyway, i read a thread (hehe, rhymes) about how to detect if a unit is standing/kneeling/prone. You find the height of the unit, and certain values of the unit's height tell you in what stance he's in or something. Anyway test it.  ;)
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re:Steam from breath conversion
« Reply #8 on: 15 Nov 2005, 01:16:04 »
drop ["cl_basic", "", "SpaceObject", 2.5, _dur, [(getPos _smoka select 0) - 0.1 *(sin(getDir _smoka)), (getPos _smoka select 1) - 0.1 *(cos(getDir _smoka)),(getPos _smoka select 2) + 1.58], [0.3*(sin(getDir _smoka)),0.3*(cos(getDir _smoka)),_vz], 1, 0.00574, 0.0045 , _rb, [0.016,0.15,_fsize] , [1,1,1,0.01], [1,1,1,0.25], [1,1,1,0.01], [1,1,1,0], [0,1,0,1,0,1], _rdp, _rdi, "", "", ""]

The two bold things are the volume and size. Try tweaking those, as well as the value for _fsize to make the smoke/breath smaller.
« Last Edit: 15 Nov 2005, 01:16:53 by Tyger »
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

Offline The-Architect

  • Former Staff
  • ****
  • Bite my shiny metal...
    • Bob's Un-official Flashpoint Page
Re:Steam from breath conversion
« Reply #9 on: 19 Nov 2005, 10:41:55 »
Can you check the height of the weapon he's carrying?
James Andrew Wilkinson 1977 - 2005 R.I.P.
"If it ain't the friggin' incoming it's the friggin' outgoing. Only difference is who gets the friggin' grease, and that ain't no friggin' difference at all."

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Steam from breath conversion
« Reply #10 on: 19 Nov 2005, 10:58:23 »
No.
Only when the unit fires...

You could make a script/addon combo to make the unit fire a dummy bullet/muzzle and check the height of that, but the drawback is that there would always be the muzzle flash which would look silly....

Dunno how .fab has done it as it seems quite clear that WWIIEC has some sort of getStance function judging from their some time ago released loading animation video...

Quote
You find the height of the unit, and certain values of the unit's height tell you in what stance he's in or something. Anyway test it.
And what exactly you mean by 'certain values of units height'?

I have tried everything I can think of, from trying to compare named selection (in the soldier model) positions and distances to various objects, to trying to use cameras etc. and nothing as produced even remotely promising results...

I would be intersted to see what you have found..
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

TC

  • Guest
Re:Steam from breath conversion
« Reply #11 on: 22 Nov 2005, 00:54:23 »
Ok, ive had a go msyself and have created a winter mission, with snow etc, and thought this would be perfect for extra atmosphere!

I personnally think the smoke effect like the one ECP used for their gun fire smoke would be a subtle but suitable effect. How could we use this effect?

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Steam from breath conversion
« Reply #12 on: 24 Nov 2005, 08:45:15 »
I would also be in need of this kind of script...

But, the bad thing is that as far as I know you can't get the unit's stance unless it fires a weapon (which the ECP effect you mentioned relies on) so to get the 'fumes' to come out of the correct height the unit would need to fire a weapon...
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

solitosnake

  • Guest
Re:Steam from breath conversion
« Reply #13 on: 12 Dec 2005, 20:05:04 »
and you say that if he "constantly fires a weapon" from his head or something, we could see a flash? i was thinking, silenced weapons dont have any muzzle flash.

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Steam from breath conversion
« Reply #14 on: 12 Dec 2005, 23:04:01 »
why do you need them to fire to tell what height the gun is at?
could you not just use
Code: [Select]
primaryweapon player ?

even if its on his back, it will still be at a different height than when he crouches and prones. with a little testing you could find the heighest it gets when crouching/proning and the lowest when standing/crouching, and see which range its between, could you not?