Home   Help Search Login Register  

Author Topic: shell shock mode  (Read 1290 times)

0 Members and 1 Guest are viewing this topic.

Offline 456820

  • Contributing Member
  • **
shell shock mode
« on: 20 Jun 2005, 18:19:55 »
if any one has played call of dutyand you get struck with artillery right near you you go into shell shock mode where everything goes slow and blury for a while
i thought it would be kind of cool to reincat that in ofp and i thought it wouldnt be to hard i have the scripts but i have a few error messages and since the error is at the endm of the line i cant see what it says about the error plus im pretty sure its correct plus a few lines are repeated but altered very slightle through out the 2 scripts

script 1 = shell_loop.sqs
Code: [Select]
_ammotypeloop = "grenadehand"
#check
nearestobject [player,_ammotypeloop] and player distance _ammotype <= 30 then [] exec "shell_shock.sqs" ; goto "exit"
? benchmark >= 4000 goto "loop1" else goto "loop2"
#loop1
~2
#loop2
~4
goto "check"
#exit
EXIT

that is just a loop wich is run from the init.sqs to check every so often if there is a grenade near by theres an error in the nearest object player line where it says [] exec # "shell_shock.sqs"
i have also made it so if you have a lower benchmark it loops slower then people with higher benchmark as this mission is quite laggy at the moment.

script2 shell_shock.sqs
Code: [Select]
_ammotype = "grenadehand"

? allready : goto "end"
nearestobject [player,_ammotype] and player distance _ammotype <= 25 then goto "random_choice"
EXIT
#random_choice
if (35 > random 100) then {goto "shellshock"}
EXIT

#shellshock
_nade = nearestobject [player,_ammotype]
? player distance _nade <= 15 : goto "random_2"
EXIT

#random_2
if (60 > random 100) then {goto "shellshock_2"}
EXIT

#shellshock_2
player say "breathe2"
~0.50
setacctime 0.25
~0.50
if (50 > random 100) then {player say "gren_r1"; said=true} else {goto "next"}
#next
? !said : player say "breathe2"
~0.50
setacctime 0.75
~0.75
setacctime 1
player say "breathe2"
~1
allready = true
#end
EXIT

since the first script doesnt work i cant test this one so im not sure whats wrong and right about this one.

this can also add some realism as you have been hit near with a grenade you will
a) breath heavier
b) things will go abit weird as you are bound to be confused and disitoriated however you spell it
even though i havent been hit by a grenade but i saw some documentry and some guy said what it feels like to be in the situation im trying to create

Anyway if someone can go through these scripts and say whats wrong about them that would be great

Bluelikeu

  • Guest
Re:shell shock mode
« Reply #1 on: 20 Jun 2005, 18:33:24 »
ok

Code: [Select]
nearestobject [player,_ammotypeloop] and player distance _ammotype <= 30 then [] exec "shell_shock.sqs" ; goto "exit"
does cannot work as a statement or as a condition.

nearestObject returns a value therefore you should catch that in a variable.
You cannot check the distance between a unit and a string, but i see what you mean; you want to check the distance between the the player and the shell.
You cannot check the distance between a unit and a shell. I'm not sure why, but it must be distance between 2 units. I suggest using the distance2d function in the editors depot.

Your condition statement must be reformated

Offline 456820

  • Contributing Member
  • **
Re:shell shock mode
« Reply #2 on: 20 Jun 2005, 18:38:09 »
nope infact there your wrong you can get the distacne betwen a unit and a shell as ive done it before and works perfectly,
i did it like this
Code: [Select]
?_x distance _nade <= 20 && "man" counttype [_x] > 0 : _x say "gren_r1"okay i didnt do that but Blanco did and it works great
so how can i change the nearest object command to work for what im doing ?
thanks for saying it wont work but the thing is i only got the error on the bit of that line where i say
Code: [Select]
[] exec "shell_shock.sqs"i get it after exec

Bluelikeu

  • Guest
Re:shell shock mode
« Reply #3 on: 20 Jun 2005, 19:58:40 »
ok, i think that this should fix some things

Code: [Select]
_o = nearestObject[player, _ammotype]
if(player distance _o < 25)then{[] exec "shell_shock.sqs"}

The error seemed to only have to do with how you express your condition.
I've never expressed the condition the way you did, and I don't know if it works, but the above code should fixt the problem
« Last Edit: 20 Jun 2005, 20:00:26 by Bluelikeu »

Offline 456820

  • Contributing Member
  • **
Re:shell shock mode
« Reply #4 on: 20 Jun 2005, 20:11:41 »
thanks alot now i relise what i did wrog forgot the brackets thanks ill have a go with that

Offline 456820

  • Contributing Member
  • **
Re:shell shock mode
« Reply #5 on: 20 Jun 2005, 20:53:22 »
okay ive tried a practive run on desert island but doesnt work i have an invincibility script on so i can throw the grenade at my feet and i cahneged the scripts slightly so i get a 100% chance of shell shock and now i have no error messages it just doesnt seem to do the shell shock bit where it slows down and he breathes harder ?

shell_loop.sqs
Code: [Select]
_ammotypeloop = "grenadehand"
#check
_o = nearestObject [player, _ammotypeloop]
? player distance _o <= 30 : [] exec "shell_shock.sqs";goto "exit"
? benchmark >= 4000 goto "loop1" else goto "loop2"
#loop1
~0
#loop2
~0
goto "check"
#exit
EXIT

shell_shock.sqs
Code: [Select]
_ammotype = "grenadehand"

_o = nearestObject [player, _ammotype]
? player distance _0 <= 20 then {goto "random_choice"}
EXIT
#random_choice
if (100 > random 100) then {goto "shellshock"}
EXIT

#shellshock
_o = nearestobject [player,_ammotype]
? player distance _o <= 15 then {goto "random_2"}
EXIT

#random_2
if (100 > random 100) then {goto "shellshock_2"}
EXIT

#shellshock_2
playsound "breathe2"
~1
setacctime 0.25
playsound "breathe2"
~1.25
if (100 > random 100) then {player say "gren_r1"} else {goto "next"}
#next
? !said : player say "breathe2"
~0.50
setacctime 0.75
~0.75
setacctime 1
player say "breathe2"
~1
#end
EXIT

like i said no error messages but time doesnt seem to slow down or i get the sound files

Bluelikeu

  • Guest
Re:shell shock mode
« Reply #6 on: 20 Jun 2005, 21:15:24 »
Code: [Select]
? player distance _0 <= 20 then {goto "random_choice"}

the _0 should be replace with an _o in the second script

Code: [Select]
? player distance _o <= 20 then {goto "random_choice"}

that might of been the problem

Offline 456820

  • Contributing Member
  • **
Re:shell shock mode
« Reply #7 on: 20 Jun 2005, 21:16:57 »
no thats not i noticed that after i posted the script and changed it and it stll doesnt do anything i dont get it though not long ago it worked fine but now its not and i cant remember what i changed

Offline XCess

  • Former Staff
  • ****
Re:shell shock mode
« Reply #8 on: 21 Jun 2005, 02:23:58 »
Have you tried DxDll with the fade effect on at night? Anytime an explosion goes off near you you get massive blur on the whole screen and can't really see a thing. Looks great. :D

Offline 456820

  • Contributing Member
  • **
Re:shell shock mode
« Reply #9 on: 21 Jun 2005, 16:11:18 »
erm no i havent tried is this a script ? and can you send me a link to what ever it is and iff its a pack ill ask if i can modify there script to suit my needs
cheers

XIII

  • Guest
Re:shell shock mode
« Reply #10 on: 21 Jun 2005, 16:36:22 »
Dxdll is a uhm, tool/plugin or some sort which makes your OFP more beautiful. Water reflections, Postprocessing. Absolutely great work.
Kegetys made it.

Here's a link:

http://koti.mbnet.fi/kegetys/ofp/

Good luck.

-Viper