OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Maximus-Sniper on 24 May 2005, 01:02:35

Title: Enemy Death Camera(Switch On/Off) In Action Menu?
Post by: Maximus-Sniper on 24 May 2005, 01:02:35
Hi all :)

It's that possible to make a kill cam of one man?
I mean if i kill a officer, than i want a script to start a deth cam of the officer, when my bullet hit him, so i can see in slow motion fall down to the ground.

So i like to make a class UserActions so i can activate/deactivate the "Kill Cam" is that possible??

Sincerely, Maximus-Sniper :)
Title: Re:Kill-Camera of one man(enemy)
Post by: 456820 on 24 May 2005, 20:28:23
very very simple when you know what youre doing but then i supose everything is anyway theres 2 ways.
1st way
create a .sqs called onplayerkilled for example
onplayerkilled.sqs
this detects when the player is dead and runs what evers in the script it also returns 2 arrays aoutomatically theses are
_player     =       The player
_killer        =       The killer
now just create the script and to target the player its
_camera CamSetTarget (vehicle _player)
and target the killer its
_camera CamSetTarget (vehicle _killer)

NOTE for that the cam neads to be caled Camera.
there you go that should get you started as long as you can do camera scripting
Title: Re:Kill-Camera of one man(enemy)
Post by: Lean Bear on 27 May 2005, 09:04:25
Hmm, I think this should really be in the Scripting Section - you'd probably have more luck there.

But, not to spoil the party...

If you want to target the unit you killed, you'd do something like this:

First, make the script.

_unit = _this select 0

_cam = "camera" camcreate [0,0,0]
_cam cameraeffect ["internal", "back"]

; Slowdown time

setAccTime 0.2

_cam camSetTarget _unit
_cam camSetRelPos [3,5,3] //adjust this to whatever you want

exit


That's just a really basic template to work from. Then you need to add you userActions:

class UserActions
{
   class DeathCamOn
   {
      displayName="Death Cam On";
      ~~~~~~~~~
      condition="this";
      statement="_unit addEventHandler [""killed"",{_unit exec ""deathcam.sqs""}]";
   };

   class DeathCamOff
   {
      displayName="Death Cam Off";
      ~~~~~~~~~
      statement="_unit RemoveEventHandler [""killed"",0]";
   };
};


I'm sure you can figure out the other bits and bobs, but hopefully a mod will move this thread to the right section so you can find your answer :)
Title: Re:Kill-Camera of one man(enemy)
Post by: 456820 on 27 May 2005, 19:57:30
Quote
If you want to target the unit you killed
Erm i thought Maximus-Sniper wanted a death cam where when your dead it shows who killed you and so on. and als you then go to say
Quote
_unit = _this select 0
wich i beleive in the onplayerkilled.sqs script is the player wich is now dead _this select 1 is the killer but you have no need to say that so you can use _killer and player becuase these have already been passed through the onplayerkilled.sqs script
Title: Re:Kill-Camera of one man(enemy)
Post by: Maximus-Sniper on 28 May 2005, 00:13:07
Hi all:)

Thanks for helping me :) I gonna try what you all say :D Hope it's gonna work :)

Thanks again :)

Maximus-Sniper
Title: Re:Kill-Camera of one man(enemy)
Post by: Lean Bear on 28 May 2005, 11:45:12
@ 456820

Quote
I mean if i kill a officer, than i want a script to start a deth cam of the officer, when my bullet hit him, so i can see in slow motion fall down to the ground.

Thats why I was using _this select 0 cause it wouldn't be using the onPlayerKilled.sqs. ;)
Title: Re:Kill-Camera of one man(enemy)
Post by: Maximus-Sniper on 30 May 2005, 20:29:08
Hi Lean Bear :)

I try your script, but when i press "Death Cam On" i gor this error:

Code: [Select]
'_unit|#| addEventHandler ["Killed",{_unit exec {RAST\script\rast_deathcam.sqs}}]'; Error Local variable in global space

And i had to change the

Class UserActions
      {
      class DeathCamOn
         {
               displayName="Death Cam On";
               position="";
         radius=1.00000;
               //condition="this";
         condition="(Format [{%1},Death_Cam_On] != {false}) && (player == this)";
               statement="_unit addEventHandler [""killed"",{_unit exec {\RAST\script\rast_deathcam.sqs}}]";
         };

Maybe it's something wrong with that  :-\
Title: Re:Kill-Camera of one man(enemy)
Post by: 456820 on 30 May 2005, 20:38:37
well i think the thing is since this isnt rn through a script or atleast i dont think so its has no unit to add an event handler to so try this
Code: [Select]
this addEventHandler ["Killed",{_unit exec {RAST\script\rast_deathcam.sqs}}]';now simply add that line into the soldiers init filed and then have a go also you have the cript n the right place by the looks of it its going to be in a folder
Title: Re:Kill-Camera of one man(enemy)
Post by: Maximus-Sniper on 30 May 2005, 21:02:49
Hi 456820 :)

I try that, but don't work. :(
And i don't want to add anything in the init filed on the enemy. I want that script to know that. When i press "Death Cam On" i want that script to run the Death cam on every enemy i kill.

The rast_deathcam.sqs looks like this:

Code: [Select]
_unit = _this select 0

_cam = "camera" camcreate [0,0,0]
_cam cameraeffect ["internal", "back"]

; Slowdown time

setAccTime 0.2

_cam camSetTarget _unit
_cam camSetRelPos [3,5,3]

exit

And in my config.cpp:

Code: [Select]
class UserActions
      {
      class DeathCamOn
         {
               displayName="Death Cam On";
               position="";
         radius=1.00000;
               //condition="this";
         condition="(Format [{%1},Death_Cam_On] != {false}) && (player == this)";
               statement="this addEventHandler [""killed"",{_unit exec {\RAST\script\rast_deathcam.sqs}}]";
         };

i tryed, i think all in the statement=_unit, unit, _this and this but nothing work :(

Maximus-Sniper
Title: Re:Kill-Camera of one man(enemy)
Post by: 456820 on 31 May 2005, 08:04:55
well this would be tricky  well for me it would be becuase im not a to good a scripter
okay anyway ill make it up for you using what youve got and post it up later.
Title: Re:Kill-Camera of one man(enemy)
Post by: Lean Bear on 31 May 2005, 08:58:59
Maximus-Sniper

I'm sure you've tried this already, but did you replace both the _unit with this?

Also, with that camera script, it was only meant to be a template :P and it won't really work if you use it as it is. If you want to use it, that's fine with me - but I'd recommend adding this to the end:

_cam camSetTarget _unit
_cam camSetRelPos [3,5,3]

~3 // this will cause a delay in between the exit command so you can actually see the unit die in slo-mo.

exit

Just thought of something else, with the class UserActions, what do you mean that its in a config.cpp? Did you make an addon?
Title: Re:Kill-Camera of one man(enemy)
Post by: 456820 on 31 May 2005, 10:04:03
why have you edited the config.cpp file i would find it easier to create a script with a radio message wich turns it on and then every unit the plaer shoots shows them fall in slo mo,
Title: Re:Kill-Camera of one man(enemy)
Post by: Maximus-Sniper on 31 May 2005, 16:09:28
Hi Lean Bear and 456820 :)

Yes i have made a new Addon, my own ;) I have made a Sniper Pack :) :)
So i like to add that into my addon :) If it's possible? :)

yes i replaced both _unit with this in the statement:

Code: [Select]
statement="this addEventHandler [""killed"",{this exec {\RAST\script\rast_deathcam.sqs}}]";

And did the same in the script:

Code: [Select]
this = _this select 0

_cam = "camera" camcreate [0,0,0]
_cam cameraeffect ["internal", "back"]

; Slowdown time

setAccTime 0.2

_cam camSetTarget this
_cam camSetRelPos [3,5,3]
~3

exit

But nothing happend :(
Here is a pic of the "Action Menu" or "User Action" i don't remember the name, hehe
(http://www.rast.co.uk/images/ofp/screenshots/death_cam.JPG)

Maximus-Sniper
Title: Re:Death Camera On The Enemy(On/Off)?
Post by: 456820 on 31 May 2005, 18:58:41
okay well this could be difficult
try this exatly like this

create a rigger 9999 x 99999 to cover the whole map and if the sniper's west set the trigger to east present,
condition = true
activation = eastsnipe = this list
/\ i think thats right.
then in that script put this  (note syntax not guarantted at all)

Code: [Select]
#loop
? slow_mo_deathcam_on : goto "EH"
{this <line to remove event handler's here> _x} foreach units eastsnipe
~5
goto "loop"
#EH
{this addEventHandler [""killed"",{this exec {\RAST\script\rast_deathcam.sqs}}]" _x} foreach units eastsnipe
? slow_mo_deathcam_off : goto "loop"
~5
goto "EH"

Hopefully that should be right let me walk you through it to make sure you understand

firstline detects if slow_mo_deathcam_on is on obdviously cahnge it to a variable you are using. next line gets rid of EH if they have them,
then it loops that until the death cam is turned on.
then it adds event handler's fired to all east units, then loops that until the death cam is turned off
then when it is goes back to begining

Hopeully you understanc that NOTE-i ont know how to remove event handlers
hope this works and good luck with your addon cya
Title: Re:Death Camera On The Enemy(On/Off)?
Post by: Lean Bear on 01 Jun 2005, 09:06:36
@ Maximus-Sniper

Oh, ok. Since you're making you're own addon that's ok. Also, to save making a huge trigger on every mission you ever use (and having to adapt the existing missions) why not try this in the config:

class UserActions
{
   class DeathCamOn
   {
      displayName="Death Cam On";
      position="player";
      radius=99999;
      condition="this";
      statement="eastsnipe = this list; this exec ""RAST\script\rast_deathcam.sqs""";
   };
};


This will basically make a "trigger" 99,999m around the player (should cover the whole map :D) then in the script put what 456820 said.

Missing line:

{this removeAllEventHandlers _x} foreach units eastsnipe

/\ to remove all the event handlers of the units.
Title: Re:Death Camera On The Enemy(On/Off)?
Post by: Maximus-Sniper on 01 Jun 2005, 14:24:58
Hi again :)

Ok did try all that, but it's did't work :( :(

Got some error:

First i make a new sqs file called deathcam.sqs and added this on it:

Code: [Select]
#loop
? slow_mo_deathcam_on : goto "EH"
{this removeAllEventHandlers  _x} foreach units eastsnipe
~5
goto "loop"
#EH
{this addEventHandler [""killed"",{this exec ""\RAST\script\Death_Cam\rast_deathcam.sqs""}]" _x} foreach units eastsnipe
? slow_mo_deathcam_off : goto "loop"
~5
goto "EH"

Than i make another one called rast_deathcam.sqs and added this:

Code: [Select]
this = _this select 0

_cam = "camera" camcreate [0,0,0]
_cam cameraeffect ["internal", "back"]

; Slowdown time

setAccTime 0.2

_cam camSetTarget this
_cam camSetRelPos [3,5,3]
~3

exit

Than i added this into my config.cpp:

Code: [Select]
class UserActions
      {
      class DeathCamOn
         {
               displayName="Death Cam On";
               position="player";
         radius=999999;
               //condition="this";
         condition="(Format [{%1},Death_Cam] != {false}) && (player == this)";
         statement="eastsnipe=this list; this exec {\RAST\script\Death_Cam\deathcam.sqs}";
         };


i had to change the condition to make it visible on the Action Menu, like that pic a post.
With this condition="this"; nothing happend and i could't see the "Death Cam On" on the Action Menu :(
So i had to add this line:
Code: [Select]
condition="(Format [{%1},Death_Cam] != {false}) && (player == this)";

Than i got the "Death Cam On" in the Action Menu :)

When i press "Death Cam On" i got some errors:

Code: [Select]
'eastsnipe = this |#|list; this exec "RAST\script\Death_Cam\deathcam.sqs"': Error Uknown Operator list

So i remove this line from the statement and change it to:

Code: [Select]
statement="this exec {\RAST\script\Death_Cam\deathcam.sqs}";

Than i got this error:

Code: [Select]
'{|#|this {this removeAllEventHandlers _x} foreach units eastsnipe': Error Missing )

So i don't realy know what's the problem is, but i feel we all are realy close now :)

Thanks again for your help, both of you :)
Title: Re:Death Camera On The Enemy(On/Off)?
Post by: 456820 on 01 Jun 2005, 14:27:37
'eastsnipe = this |#|list; this exec "RAST\script\Death_Cam\deathcam.sqs"': Error Uknown Operator list

well to fix that i think it might be list this instead of this list try that. also make sure you have the variable globals right
Title: Re:Death Camera On The Enemy(On/Off)?
Post by: Maximus-Sniper on 01 Jun 2005, 14:50:00
Hi 456820 :)

Ok, i change it to:

Code: [Select]
statement="eastsnipe = list this; this exec ""\RAST\script\Death_Cam\deathcam.sqs""";

Now i got this error:

Code: [Select]
'{this removeAllEventHandlers _x} foreach units eastsnipe|#|': Error units: Type Array, expected Object,Group

Here is the line from the deathcam.sqs:

Code: [Select]
#loop
? slow_mo_deathcam_on : goto "EH"
{this removeAllEventHandlers _x} foreach units eastsnipe
~5
.
.
.
.

maybe somthing wrong there?

Thanks :)
Title: Re:Death Camera On The Enemy(On/Off)?
Post by: 456820 on 01 Jun 2005, 15:31:27
most likely i did say syntax not guaranteed that was just to help get started or a push how ever you want to think about it anyway i would try and get a more experienced scripter to help you get the syntax right
im not sure what the error mesage stands for its just the problem is at the end of the line but that means i solved the first wrong line wich means event handlers are added they just wont be removed sooo.
get rid og the this at the begining of the line if that doesnt work just have a mess around by changing the line until you get an error message aboutsomething else.
Title: Re:Death Camera On The Enemy(On/Off)?
Post by: Lean Bear on 01 Jun 2005, 17:50:00
I think I can help you out a bit here Maximus-Sniper,

I've fixed the removeAllEventHandlers line to a valid code. There was 2 problems with that:

1. The forEach command didn't have the right syntax, the _x should be first, followed by the command. I also didn't finish the eventhandlers part.

2. putting ... forEach units eastsnipe tells OFP that eastsnipe is a group, but it it should be an array of all enemy units.

(3.) You also left spaces in the syntax which probably didn't help :P

Maybe I'm missing something here, but when was slo_mo_deathcam_on and slo_mo_deathcam_off defined?

OFP will have a hard time switching it ona nd off if it doesn't know what it is.

Here's what I got for that part of the script anyway:

#loop

? slow_mo_deathcam_on : goto "EH"

{_x removeAllEventHandlers "killed"} foreach eastsnipe
~5

goto "loop"

#EH

{_x addEventHandler ["killed",{this exec "\RAST\script\Death_Cam\rast_deathcam.sqs"}]} foreach eastsnipe

? slow_mo_deathcam_off : goto "loop"
~5

goto "EH"


For the config.cpp, I don't think that the command list is the right one for the job.

I think that extra line you put in to make it work is fine :)

The only thing I'd change would be the statement line:

statement="this exec {\RAST\script\Death_Cam\deathcam.sqs}";

Should work ok. ;)

btw I don't know how you've been testing this, but for what I've put to work, you need to:

1. Make a new mission in OFP
2. Place some enemy units around and name them something like: "east1", "east2", "east3" - but don't group them!
3. In the mission folder, make an init.sqs and put:
eastsnipe = [east1, east2, east3] // I forget if you need quotation marks around them or not, try both
4. Save the init.sqs and start the mission - if there are no script or config errors it should work fine. :D
Title: Re:Death Camera On The Enemy(On/Off)?
Post by: 456820 on 01 Jun 2005, 18:07:24
Quote
slo_mo_deathcam_on and slo_mo_deathcam_off defined?
never im using that as an example

this does actually sound like a very interesting addon are you relasing it ?
Title: Re:Death Camera On The Enemy(On/Off)?
Post by: Maximus-Sniper on 01 Jun 2005, 18:38:10
Hi 456820 & Lean Bear :)

@Lean Bear

I try that you say to me, and i did't get any error now :) But Nothing happend  ???
I make a new mission, and added my sniper and added one eneme unit from east and named him to east1 :) And make that init.sqs file and added eastsnipe = [east1, east2, east3]
Than i shot that man and norhing happend  :-\

It's that possible to make this script in another way? As you see now i have to make a init.sqs all the time and name som units to east1 .......

I hope if it's possible to make all that included in a script ?? So i don't need to make that init.sqs and named some units :)


@ 456820 :)

Yes i gonna release this sniper pack later some time :) Still need some bug fix and some more scripts :)

I have some pic and movies in this page at the middle:
http://www.flashpoint1985.com/cgi-bin/ikonboard311/ikonboard.cgi?s=1c93b255019b2ae3f54322e83f611bc2;act=ST;f=4;t=44830;st=1260 (http://www.flashpoint1985.com/cgi-bin/ikonboard311/ikonboard.cgi?s=1c93b255019b2ae3f54322e83f611bc2;act=ST;f=4;t=44830;st=1260)

Thanks again for all help i got from you all :)

Maximus-Sniper :)
Title: Re:Death Camera On The Enemy(On/Off)?
Post by: Lean Bear on 01 Jun 2005, 18:53:17
I had a feeling it wouldn't work:

never im using that as an example

:P

Also, I agree abou the int.sqs thing - but it could be hard to put it in the script. Which side will your sniper units be on? (eg. West, Res etc.)

btw there's not really any point in making 1 unit called east1, then putting:

eastsnipe = [east1,east2,east3]

when east2 and east3 don't even exist :P

The thing that means the script doesn't work is the main problem to fix though...

What 456820 put in the script:

? slow_mo_deathcam_on : goto "EH"

well, atm, it isn't defined. So the script will never run "EH".

So, you'll need to do that do get the script working.
Title: Re:Death Camera On The Enemy(On/Off)?
Post by: 456820 on 01 Jun 2005, 18:57:26
well when you switch your camera on make switch a variable to true an easier example
death cam = on             therefore
deathcam = true

death cam = off               therefore
deathcam = false

like that of course if you dont use deathcam as the variable change it to what you do use in the script i made then it should work fine
Title: Re:Death Camera On The Enemy(On/Off)?
Post by: Maximus-Sniper on 01 Jun 2005, 19:32:20
Hi again mates :)

@Lean Bear

Well i gonna make this pack for WEST side :)

Quote
btw there's not really any point in making 1 unit called east1, then putting:

eastsnipe = [east1,east2,east3]

when east2 and east3 don't even exist  :P

hehe, i just run a fast test  :P  :P

Quote
? slow_mo_deathcam_on : goto "EH"

well, atm, it isn't defined. So the script will never run "EH".

So, you'll need to do that do get the script working.

Ok i understand :) So i have to define "slow_mo_deathcam_on"
So how do i define that? Well i'm not good in scripting, :( I only have work with script some few months  :-\ :-\


@456820

Quote
well when you switch your camera on make switch a variable to true an easier example
death cam = on            therefore
deathcam = true

death cam = off              therefore
deathcam = false

like that of course if you dont use deathcam as the variable change it to what you do use in the script i made then it should work fine

So you mean i can only copy and past that into the deathcam.sqs?

deathcam.sqs:

Code: [Select]
#loop
? slow_mo_deathcam_on : goto "EH"
{_x removeAllEventHandlers "killed"} foreach eastsnipe
~5
goto "loop"
#EH
{_x addEventHandler ["killed",{this exec "\RAST\script\Death_Cam\rast_deathcam.sqs"}]} foreach eastsnipe
? slow_mo_deathcam_off : goto "loop"
~5
goto "EH"

Where should i put that into this script ??

Thanks again :)

Hope we resolved this and it's gonna be funny to have this script working. :) :)  :P
Title: Re:Death Camera On The Enemy(On/Off)?
Post by: 456820 on 01 Jun 2005, 19:38:40
erm you dont put it in the deathcam.sqs you put it in the config file i think where you have the option to turn on and off.
when its turned on put
Code: [Select]
slow_mo_deathcam = trueand when you turn it off put
Code: [Select]
slow_mo_deathcam = flase
also
Code: [Select]
#loop
? slow_mo_deathcam_on : goto "EH"
{_x removeAllEventHandlers "killed"} foreach eastsnipe
~5
goto "loop"
#EH
{_x addEventHandler ["killed",{this exec "\RAST\script\Death_Cam\rast_deathcam.sqs"}]} foreach eastsnipe
? slow_mo_deathcam_off : goto "loop"
~5
goto "EH"

if thats the correct version your using at the moment change it to

Code: [Select]
#loop
? slow_mo_deathcam : goto "EH"
{_x removeAllEventHandlers "killed"} foreach eastsnipe
~5
goto "loop"
#EH
{_x addEventHandler ["killed",{this exec "\RAST\script\Death_Cam\rast_deathcam.sqs"}]} foreach eastsnipe
? slow_mo_deathcam !: goto "loop"
~5
goto "EH"

That should be all then try a demo mission and have a test and also fingers crossed
Title: Re:Death Camera On The Enemy(On/Off)?
Post by: Maximus-Sniper on 01 Jun 2005, 20:54:17
Hi 456820 :)

Now we are realy close  :P :P :P :P

But still got some errors:

Error 1:

When i press "Death Cam On" in the Action Menu i got this error:

Code: [Select]
'slow_mo_deathcam |#|!': Error Uknown Operator

That error most have somthing with this line in the Class UserAction:
Code: [Select]
class UserActions
      {
      class DeathCamOn
         {
               displayName="Death Cam On";
               position="player";
         radius=999999;
         condition="(Format [{%1},slow_mo_deathcam] != {false}) && (player == this)";
         statement="slow_mo_deathcam=true; this exec {\RAST\script\Death_Cam\deathcam.sqs}";
         };

As you see I added "slow_mo_deathcam=true" into the statement= . I think that's is the right place for that, but maybe i have to add some more?? I don't know  ??? ??? ???

Error 2:

When i shot one of the enemy (i call them for east1, east2 and east3. i added 3 officer form east side) i got this error, see pic and look at the camera.

(http://www.rast.co.uk/images/ofp/error/error_2.jpg)

That point to the rast_deathcam.sqs:

Code: [Select]
this=_this select 0

_cam="camera" camcreate [0,0,0]
_cam cameraeffect ["internal", "back"]

; Slowdown time

setAccTime 0.2

_cam camSetTarget this
_cam camSetRelPos [3,5,3]
~3

exit

Most be something wrong in the first line, maybe change it or add some more, i don't know.  ???

But we are closer now :)

Thanks :) :)
Title: Re:Death Camera On The Enemy(On/Off)?
Post by: Lean Bear on 01 Jun 2005, 21:41:29
Yay! We're nearly there. Both those errors are very easy to fix.

1. This is infact from deathcam.sqs. I don't quite know what 456820 was trying to do, but !: is deffinately not a valid command. It means "not goto" ???

Umm, I guess he'd know what he meant by that and an alternative. But if you want to quickly test it, use the script you were using before that change.

2. This one is, as you rightly said, from the rast_deathcam.sqs.

You can't use this = _this select 0. So we'll have to find a method of selecting the unit that's just been killed and run the script from him.

Unfortunately, even after these are corrected, I can tell we're gonna have more problems :P

Although, I have thought of a solution to the problem of using an init.sqs or naming all the enemy units each time.

If you make eastsnipe equal to all the units present on the map, it will work fine. Whether you shoot an ally or an enemy it doesn't really matter. You can choose to switch the deathcam on or off anyway.

So...  (btw for the final thing, I'd recommend going through everything you've done and change eastsnipe to something more recognisable and general, like enemy_units or something)

eastsnipe = east && resistance && west

Just an idea :)
Title: Re:Death Camera On The Enemy(On/Off)?
Post by: 456820 on 02 Jun 2005, 09:17:04
thats weird it should target the person you killed becuase this select 0 in a killed EH is the person killed try
killed = _this select 0
and when you want to target the person whose noe dead use killed instead of this

oh yh and with the '!' command i think i might of put that in the wrong place try this
Code: [Select]
? ! slow_mo_deathcam : goto "loop"that should be in the right place if not out it right next to the slow like !slow thats if that idea doesnt work about the other message im not totally sure but at the top should work if notthen im out of ideas
Title: Re:Death Camera On The Enemy(On/Off)?
Post by: Lean Bear on 02 Jun 2005, 10:07:43
I can see what you're trying to do here 456820, but I don't think its gonna work anyway.

_this select 0 from the EH "killed" selects the killer, and that's the only argument stored in _this for that EH. :P

I think it does need to be right against it:

? !slow_mo_deathcam : goto "loop"

edit

Just looking around, I found that the "hit" EH stores what object caused the dammage as well! :)

This means we can run another EH when the unit is dead (cause that will activate the "killed" EH) to find out who did it.

I've got a few ideas for this. One which looks right, but will probably have bugs:

#loop

{_x removeAllEventHandlers "killed"} forEach eastsnipe
{_x removeAllEventHandlers "hit"} forEach eastsnipe
? slow_mo_deathcam : goto "AddKilledEH"
~1

goto "loop"

#AddKilledEH

{_x addEventHandler ["killed",{goto "AddHitEH"}]} forEach eastsnipe

#AddHitEH

{_x addEventHandler ["hit",{_this exec "\RAST\script\Death_Cam\rast_deathcam.sqs"}]} forEach eastsnipe

? !slow_mo_deathcam : goto "loop"
~1

goto "AddKilledEH"


or, this much different one, but one I'm more certain would work:

#loop

? slow_mo_deathcam : goto "EH"
{_x removeAllEventHandlers "hit"} forEach eastsnipe
~1

goto "loop"

#EH

{_x addEventHandler ["hit",{goto "CheckDead"}]} forEach eastsnipe

#Check Dead

_dammage = _this select 1
_dammage >= 1 : _this exec "\RAST\script\Death_Cam\rast_deathcam.sqs"
_dammage < 1 : goto "loop"

? !slow_mo_deathcam : goto "loop"
~1

goto "EH"


Then, for the rast_deathcam.sqs:

_unit = _this select 0

_cam="camera" camcreate [0,0,0]
_cam cameraeffect ["internal", "back"]

; Slowdown time

setAccTime 0.2

_cam camSetTarget _unit
_cam camSetRelPos [3,5,3]
~3

exit
Title: Re:Death Camera On The Enemy(On/Off)?
Post by: Maximus-Sniper on 02 Jun 2005, 18:58:39
Hi again :)

I see you both are fighting  :P :P

Ok.. i try your new idea @Lean Bear :)

First i add this into my deathcam.sqs:

Code: [Select]
#loop

{_x removeAllEventHandlers "killed"} forEach eastsnipe
{_x removeAllEventHandlers "hit"} forEach eastsnipe
? slow_mo_deathcam : goto "AddKilledEH"
~1

goto "loop"

#AddKilledEH

{_x addEventHandler ["killed",{goto "AddHitEH"}]} forEach eastsnipe

#AddHitEH

{_x addEventHandler ["hit",{_this exec "\RAST\script\Death_Cam\rast_deathcam.sqs"}]} forEach eastsnipe

? !slow_mo_deathcam : goto "loop"
~1

goto "AddKilledEH"

And change the rast_deathcam.sqs to:

Code: [Select]
_unit = _this select 0

_cam="camera" camcreate [0,0,0]
_cam cameraeffect ["internal", "back"]

; Slowdown time

setAccTime 0.2

_cam camSetTarget _unit
_cam camSetRelPos [3,5,3]
~3

exit

Than i start my demo test mission  :P
I still have the init.sqs inside the mission folder :)

Than i start the mission, and pressed the "Death Cam On" and shot one man (east1), nothing happend :(

So i try the another ida :)
I change the deathcam.sqs to:
Code: [Select]
#loop

? slow_mo_deathcam : goto "EH"
{_x removeAllEventHandlers "hit"} forEach eastsnipe
~1

goto "loop"

#EH

{_x addEventHandler ["hit",{goto "CheckDead"}]} forEach eastsnipe

#Check Dead

_dammage = _this select 1
_dammage >= 1 : _this exec "\RAST\script\Death_Cam\rast_deathcam.sqs"
_dammage < 1 : goto "loop"

? !slow_mo_deathcam : goto "loop"
~1

goto "EH"

And did nothing with the rast_deathcam.sqs now :)

Than i try the mission again :)
When i press the "Death Cam On" i got this error:

Code: [Select]
'_dammage < 1 |#|: goto "loop": Error Uknown Operator

Looks like we missed something in the deathcam.sqs this line:

Code: [Select]
_dammage < 1 : goto "loop"

Thanks :)

Maximus-Sniper
Title: Re:Death Camera On The Enemy(On/Off)?
Post by: 456820 on 02 Jun 2005, 19:20:29
okay the error message
to be truthull i dont know

the line you are using only checks if the target is wounded i dont think it will detect if hes dead but im not totally sure try instead
_dammage == 1
that should check when the dammage equals oris the same as one not totally sure but if its right it might also get rid of the error message
Title: Re:Death Camera On The Enemy(On/Off)?
Post by: Maximus-Sniper on 02 Jun 2005, 19:57:36
Hi 456820 :)

I change that, but i almost got the same error:

Code: [Select]
'_dammage ==1 |#|: goto "loop": Error Uknown Operator

So i don't realy know what the problem are :(


btw 456820 :) I'll try your "Suprise Suprise" mission, realy good work man :) Maybe some day you can make a Sniper Mission, with my sniper pack  :P :P
Title: Re:Death Camera On The Enemy(Switch On/Off)?
Post by: Lean Bear on 02 Jun 2005, 22:26:47
@ 456820

That part of the code is to check if the unit is only wounded, as suppsoed to dead. Any value less than one (completely dead) will make it loop again.

I put that in cause we don't want the deathcam running when the enemy get's shot in the foot.

The line checking if the unit is dead is:

_dammage >= 1 : _this exec "\RAST\script\Death_Cam\rast_deathcam.sqs"

In which case the rast_deathcam.sqs would be run.

But I don't know why the error comes up, its a perfectly valid command :P

@ Maximus-Sniper

Try it this way instead:

(_dammage < 1): goto "loop"

Keep using the init.sqs for now :) Its the safer method. We can fix the selecting units bit after the death cam works ;)

Title: Re:Death Camera On The Enemy(Switch On/Off)?
Post by: Maximus-Sniper on 02 Jun 2005, 23:50:36
Hi again :)

@Lean Bear

Ok, i change the line to:

Code: [Select]
#loop

? slow_mo_deathcam : goto "EH"
{_x removeAllEventHandlers "hit"} forEach eastsnipe
~1

goto "loop"

#EH

{_x addEventHandler ["hit",{goto "CheckDead"}]} forEach eastsnipe

#CheckDead

_dammage = _this select 1
_dammage >= 1 : _this exec "\RAST\script\Death_Cam\rast_deathcam.sqs"
(_dammage < 1): goto "loop"

? !slow_mo_deathcam : goto "loop"
~1

goto "EH"

But got the same error:

Code: [Select]
'(_dammage < 1)|#|: goto "loop": Error Uknown Operator

Hmmm, i'm not realy sure what the problem is, maybe because we are using two  :goto "loop" in here:

Code: [Select]
#CheckDead

_dammage = _this select 1
_dammage >= 1 : _this exec "\RAST\script\Death_Cam\rast_deathcam.sqs"
(_dammage < 1): goto "loop"

? !slow_mo_deathcam : goto "loop"
~1

i'm not sure  ???

btw ,take a look  Here :) (http://www.ofpec.com/yabbse/index.php?board=14;action=display;threadid=24005)
Title: Re:Death Camera On The Enemy(Switch On/Off)?
Post by: Planck on 03 Jun 2005, 00:01:20
I don't see this:

(_dammage ==1)

In any part of your script, if that was part of the error message, what is it refering to, not that script anyway.   ;D


Planck
Title: Re:Death Camera On The Enemy(Switch On/Off)?
Post by: Maximus-Sniper on 03 Jun 2005, 00:13:03
Hi Planck :)

Do you maybe now where i should put that in my script?
My deathcam.sqs looks like this now:
Code: [Select]
#loop

? slow_mo_deathcam : goto "EH"
{_x removeAllEventHandlers "hit"} forEach eastsnipe
~1

goto "loop"

#EH

{_x addEventHandler ["hit",{goto "CheckDead"}]} forEach eastsnipe

#CheckDead

_dammage = _this select 1
_dammage >= 1 : _this exec "\RAST\script\Death_Cam\rast_deathcam.sqs"
(_dammage < 1): goto "loop"

? !slow_mo_deathcam : goto "loop"
~1

goto "EH"

Where should i put this
Code: [Select]
(_dammage ==1)into that script ??

Thanks :)
Title: Re:Death Camera On The Enemy(Switch On/Off)?
Post by: Planck on 03 Jun 2005, 00:19:59
I think you should change these 2 lines:

_dammage >= 1 : _this exec "\RAST\script\Death_Cam\rast_deathcam.sqs"
(_dammage < 1): goto "loop"

To read:

?(_dammage >= 1) : _this exec "\RAST\script\Death_Cam\rast_deathcam.sqs"
?(_dammage < 1): goto "loop"

Try that anyway.......


Planck
Title: Re:Death Camera On The Enemy(Switch On/Off)?
Post by: Maximus-Sniper on 03 Jun 2005, 00:27:32
Hi Planck :)

I did change those two lines :)

Now i got a new error:

Code: [Select]
'_dammage = _this select 1|#|': Error select: Type Object, expected Array

Hmm, maybe you know the problem  ??? :)

Thanks for helping :)
Title: Re:Death Camera On The Enemy(Switch On/Off)?
Post by: Lean Bear on 03 Jun 2005, 08:55:57
@ Planck

Aww, I was just about to say that :P

btw Yes that is the correct syntax, I can't believe I missed that out ::)

@ Maximus-Sniper

For some reason, OFP seems to be expecting an array of numbers - which is odd, cause its just a float value of how much damage has been caused :P

edit

Hmm, I think I see another problem.

There is no loop or pause between adding the EH and checking if the unit is dead, which could lead to all sorts of problems. I also changed the script a bit, see if it works now:

#loop

? slow_mo_deathcam : goto "EH"
{_x removeAllEventHandlers "hit"} forEach eastsnipe
~1

goto "loop"

#EH

{_x addEventHandler ["hit",{_dammage = _this select 1; goto "CheckDead"}]} forEach eastsnipe

#Wait

~3

goto "Wait"

#CheckDead

?(_dammage >= 1): _this exec "\RAST\script\Death_Cam\rast_deathcam.sqs"
?(_dammage < 1): goto "loop"

? !slow_mo_deathcam : goto "loop"
~1

goto "EH"


edit 2

Hang on :P

If that doesn't work, then I think I might know what the problem is. OFP was expecting an array (which we want) but it got an object.

In the "Hit" EH, the arguments: "CausedBy" and "HowMuch" are stored in _this.

AFAIK to get "causedBy" you would use _this select 0 right? That's an object.

To get the value of "HowMuch" you'd use _this select 1 right? This is a scalar ammount (can be an array).

So if OFP is getting an object, then maybe its _this select 1 for "causedBy" and _this select 2 for "HowMuch".

Just to see, try using this script as well:

#loop

? slow_mo_deathcam : goto "EH"
{_x removeAllEventHandlers "hit"} forEach eastsnipe
~1

goto "loop"

#EH

{_x addEventHandler ["hit",{goto "CheckDead"}]} forEach eastsnipe

#Wait

~3

goto "Wait"

#CheckDead

_dammage = _this select 2;
?(_dammage >= 1): _this exec "\RAST\script\Death_Cam\rast_deathcam.sqs"
?(_dammage < 1): goto "loop"

? !slow_mo_deathcam : goto "loop"
~1

goto "EH"
Title: Re:Death Camera On The Enemy(Switch On/Off)?
Post by: 456820 on 03 Jun 2005, 11:18:31
Quote
You can't use this = _this select 0. So we'll have to find a method of selecting the unit that's just been killed and run the script from him.

actually i just checked a tutorial on event handlers and for killed it says this
Quote
"killed" (addable to men or vehicles) :
_this select 0 : who's dead ;
_this select 1 : whodunnit (say, the killer) ;

so you should be able to use _this select 0
wich also means all the hit event handlers and codes to check dammage were basically a waste of time but it might depend what version you have im not sure
Title: Re:Death Camera On The Enemy(Switch On/Off)?
Post by: Lean Bear on 03 Jun 2005, 17:53:21
I hope you're right, it would make this a lot easier to do :P

btw I got my info from the Offical and Unoffical ComRefs. Where did you find this tut?
Title: Re:Death Camera On The Enemy(Switch On/Off)?
Post by: 456820 on 03 Jun 2005, 18:00:14
the editors depot just search in event and theres one about event handlers
Title: Re:Death Camera On The Enemy(Switch On/Off)?
Post by: Maximus-Sniper on 03 Jun 2005, 19:22:46
Hi again :)

@Lean Bear

Ok i did the last edit 2 from you :)

The good news is, i did't get any error now when i press "Death Cam On" in my test mission  :D

Bad news is, nothing happend when i kill the man (east1)  ???

Looks like the script did't call for the camera script (rast_deathcam.sqs)

I'm not  realy sure what the problem are now... hmm

But just take a look now to my scripts:

rast_deathcam.sqs:
Code: [Select]
_unit = _this select 0

_cam="camera" camcreate [0,0,0]
_cam cameraeffect ["internal", "back"]

; Slowdown time

setAccTime 0.2

_cam camSetTarget _unit
_cam camSetRelPos [3,5,3]
~3

exit

And

deathcam.sqs:
Code: [Select]
#loop

? slow_mo_deathcam : goto "EH"
{_x removeAllEventHandlers "hit"} forEach eastsnipe
~1

goto "loop"

#EH

{_x addEventHandler ["hit",{goto "CheckDead"}]} forEach eastsnipe

#Wait

~3

goto "Wait"

#CheckDead

_dammage = _this select 2;
?(_dammage >= 1): _this exec "\RAST\script\Death_Cam\rast_deathcam.sqs"
?(_dammage < 1): goto "loop"

? !slow_mo_deathcam : goto "loop"
~1

goto "EH"

Than the Class UserActions in config.cpp:

Code: [Select]
class UserActions
      {
      class DeathCamOn
         {
               displayName="Death Cam On";
               position="";
         radius=99999;
         condition="(Format [{%1},slow_mo_deathcam] != {false}) && (player == this)";
         statement="slow_mo_deathcam=true; this exec {\RAST\script\Death_Cam\deathcam.sqs}";
         };


That's  the last update we got :)  :P

Thanks :)

Maximus-Sniper
Title: Re:Death Camera On The Enemy(Switch On/Off)?
Post by: 456820 on 03 Jun 2005, 19:58:16
ermm to me it looks perfect and should work
one thing where you have
Quote
?(_dammage >= 1): _this exec "\RAST\script\Death_Cam\rast_deathcam.sqs"
?(_dammage < 1): goto "loop"

 i usually use spaces that might be the problem but i doubt it try

Code: [Select]
?(_dammage >= 1) : _this exec "\RAST\script\Death_Cam\rast_deathcam.sqs"
?(_dammage < 1) : goto "loop"

apart from that it should work everything seems to be called right and if theres no error messages theres no reason for it not to work
Title: Re:Death Camera On The Enemy(Switch On/Off)?
Post by: Lean Bear on 03 Jun 2005, 22:24:33
Yeah, 456820's right. There isn't really anything wrong with that script.

OK, 2 things. 1st keep the scripts you're using in the latest update but add this:

Code: [Select]
_unit = _this select 1

_cam="camera" camcreate [0,0,0]
_cam cameraeffect ["internal", "back"]

; Slowdown time

setAccTime 0.2

_cam camSetTarget _unit
_cam camSetRelPos [3,5,3]
~3

exit

Then, if that doesn't work, try this...

I'd recomend trying what 456820 said before, using the "killed" EH. If the info he found is right, then using _this select 0 we can find out who is dead.

(oh btw 456820, the error that came up before about not being able to use this = _this select 0. It was the first "this" I was refering to - so the "killed" EH should work :) )

Code: [Select]
#loop

? slow_mo_deathcam : goto "EH"
{_x removeAllEventHandlers "killed"} forEach eastsnipe
~1

goto "loop"

#EH

{_x addEventHandler ["killed",{_unit = _this select 0; _this exec "\RAST\script\Death_Cam\rast_deathcam.sqs"}]} forEach eastsnipe

? !slow_mo_deathcam : goto "loop"
~1

goto "EH"

Then, in "rast_deathcam.sqs":

Code: [Select]
_unit = _this select 0

_cam="camera" camcreate [0,0,0]
_cam cameraeffect ["internal", "back"]

; Slowdown time

setAccTime 0.2

_cam camSetTarget _unit
_cam camSetRelPos [3,5,3]
~3

exit

Hope it works for you :)
Title: Re:Death Camera On The Enemy(Switch On/Off)?
Post by: Maximus-Sniper on 03 Jun 2005, 23:04:22
Hi mates :)

@456820

Ok i did that change and still the same, nothing happend :(

Thanks :)

@Lean Bear

Ok, i change the rast_deathcam.sqs to this:
Code: [Select]
_unit = _this select 1

_cam="camera" camcreate [0,0,0]
_cam cameraeffect ["internal", "back"]

; Slowdown time

setAccTime 0.2

_cam camSetTarget _unit
_cam camSetRelPos [3,5,3]
~3

exit

But nothing happend, still the same when i kill a man :(

Ok, now i did the last change, used the killed, and change those two script to:

deatcam.sqs:
Code: [Select]
#loop

? slow_mo_deathcam : goto "EH"
{_x removeAllEventHandlers "killed"} forEach eastsnipe
~1

goto "loop"

#EH

{_x addEventHandler ["killed",{_unit = _this select 0; _this exec "\RAST\script\Death_Cam\rast_deathcam.sqs"}]} forEach eastsnipe

? !slow_mo_deathcam : goto "loop"
~1

goto "EH"

And the rast_dethcam.sqs:
Code: [Select]
_unit = _this select 0

_cam="camera" camcreate [0,0,0]
_cam cameraeffect ["internal", "back"]

; Slowdown time

setAccTime 0.2

_cam camSetTarget _unit
_cam camSetRelPos [3,5,3]
~3

exit

But nothing happend, the same. I kill him, and he died, but the camera did't start, hmmm

Ok... maybe it's some thing wrong with the Class UserActions:

Code: [Select]
class UserActions
      {
      class DeathCamOn
   Â Â Â Â Â Â {
               displayName="Death Cam On";
               position="";
         radius=99999;
         condition="(Format [{%1},slow_mo_deathcam] != {false}) && (player == this)";
         statement="slow_mo_deathcam=true; this exec {\RAST\Script\Death_Cam\deathcam.sqs}";
   Â Â Â Â Â Â };

I feel it, we are realy close now  :P :P

EDIT:

btw, maybe somthing wrong with the init.sqs:
Code: [Select]
eastsnipe = [east1, east2, east3]

Maximus-Sniper
Title: Re:Death Camera On The Enemy(Switch On/Off)?
Post by: Maximus-Sniper on 04 Jun 2005, 00:54:40
Hi again :)

Last update of this script  ;D ;D

config.cpp @ Class UserActions:

Code: [Select]
   class UserActions
      {
      class DeathCamOn
   Â Â Â Â Â Â {
               displayName="Death Cam On";
               position="";
         radius=99999;
         condition="(Format [{%1},slow_mo_deathcam] != {false}) && (player == this)";
         statement="slow_mo_deathcam=true; this exec {\RAST\Script\Death_Cam\deathcam.sqs}";
   Â Â Â Â Â Â };

and deathcam.sqs:

Code: [Select]
#loop

? slow_mo_deathcam : goto "EH"
{_x removeAllEventHandlers "killed"} forEach eastsnipe
~1

goto "loop"

#EH

{_x addEventHandler ["killed",{_unit = _this select 0; _this exec "\RAST\script\Death_Cam\rast_deathcam.sqs"}]} forEach eastsnipe

? !slow_mo_deathcam : goto "loop"
~1

goto "EH"

and rast_deathcam.sqs:

Code: [Select]
_unit = _this select 0

_cam="camera" camcreate [0,0,0]
_cam cameraeffect ["internal", "back"]

; Slowdown time

setAccTime 0.2

_cam camSetTarget _unit
_cam camSetRelPos [3,5,3]
~3

exit

and last the init.sqs:

Code: [Select]
eastsnipe = [east1, east2, east3]


But this not work   :( :(
So i think the problem maybe are something with the Class UserActions in the config.cpp or maybe the init.sqs in the mission  ??? ???

Thanks :)

Maximus-Sniper

EDIT 2:

GOOD NEWS
[/size]

Now it's allmost working, just a litle problem with the camera when i kill the enemy. Take a look at the picture :)

(http://www.rast.co.uk/images/ofp/screenshots/FLASHPOINTRESISTANCE11-23_600.jpg)

Ok :) Looks like the problem is now in the rast_deathcam.sqs maybe change some of the codes inside to make it work  ;)

EDIT 3:

GOOD NEWS AGAIN
[/size]

Ok, i did some change in the rast_deathcam.sqs to:

Code: [Select]
SetAccTime 0.2
_unit = _this select 0
_camPos = GetPos _unit
_cx = _camPos Select 0
_cy = _camPos Select 1
_cz = _camPos Select 2
_cam1 = "camera" CamCreate [_cx+2, _cy+1, _cz+2]
_cam1 CamSetTarget _unit
_cam1 CamSetFov 0.3
_cam1 CameraEffect ["Internal","Back"]
_cam1 CamCommit 2
@CamCommitted _cam1
SetAccTime 1.0

_cam1 CameraEffect ["Terminate","Back"]
CamDestroy _cam1

exit

Now we can see that man die in slow motion, hehe

But another problem, how do i turn OFF the Camara again? I only have "Death Cam On" in the Action Menu., When i press it, than the camara goes on and shows the Enemy Death cam all the time, how do i add the turn off in the Class UserActions in my config.cpp file?? hehe

BIG THANKS TO YOU ALL
[/size][/color]

Maximus-Sniper


EDIT 4:

Hi again :)

Ok i fix the "Death Cam Off" and now it's work to turn of and On the Enemy Death Cam  :P :P :P :P

So my Class UserActions in config.cpp looks like this now:

Code: [Select]
class UserActions
      {
      class DeathCamOn
         {
               displayName="Death Cam On";
               position="";
         radius=99999;
         condition="(Format [{%1},slow_mo_deathcam] != {false}) && (player == this)";
         statement="slow_mo_deathcam=true; this exec {\RAST\Script\Death_Cam\deathcam.sqs}";
         };
      class DeathCamOff
         {
               displayName="Death Cam Off";
               position="";
         radius=99999;
         condition="(Format [{%1},slow_mo_deathcam] != {false}) && (player == this)";
         statement="slow_mo_deathcam=false; this exec {\RAST\Script\Death_Cam\deathcam.sqs}";
         };

The Action Menu looks like this:

(http://www.rast.co.uk/images/ofp/screenshots/death_cam_1.JPG)  ;D ;D ;D

But another thing, i know i have seen it befor, when you press the "......On" than it will show automatic "....OFF" As you see now, the "Death Cam On/OFF" are inn the Action Menu at the same time.. Maybe one of you may know how i can fix that??


Thanks :

Maximus-Sniper
Title: Re:Death Camera On The Enemy(Switch On/Off)?
Post by: 456820 on 04 Jun 2005, 08:49:14
shame but good work
i could do that on/off thing as a script but i couldnt do it in a user actions thing
but it doesnt matter to much aslong as it works unless someone else knows the answer
good work hope to see a beta version soon
Title: Re:Death Camera On The Enemy(Switch On/Off)?
Post by: Maximus-Sniper on 04 Jun 2005, 09:21:59
Hi 456820 :)

I say good work to you and Lean Bear for helping with this script :)  :P

btw the On/Off Swith, what about to use class EventHandlers in the config.cpp file ?? In the "init=" field ??

Thanks :)

Maximus-Sniper
Title: Re:Death Camera On The Enemy(Switch On/Off)?
Post by: 456820 on 04 Jun 2005, 09:28:11
im not to sure about that kind of file so i odnt know if its possible it could be though
lean bear might no he seems like he understands the user action file
Title: Re:Death Camera On The Enemy(Switch On/Off)?
Post by: Maximus-Sniper on 04 Jun 2005, 10:46:40
Hi :)

I'm not realy sure about that Class EventHandlers. But i did a try with another script i have, the bullet cam. :) So if i use the Bullet Cam script i got "Bullet Cam On" twise in the Actions Menu  :-\ if i add another sniper to. If you use 10 RAST snipers, you will got 10 "Bullet Cam On" in the Action Menu. So i think the right way maybe in the Class UserActions ???

I'm not sure, hope somebody know how to fix that in the Class UserActions  :P :P :P

Thanks :)

Maximus-Sniper
Title: Re:Death Camera On The Enemy(Switch On/Off)?
Post by: Lean Bear on 04 Jun 2005, 12:43:13
Hey! Glad it finally works :D !!

With your class UserActions you need to put something in them (eg a variable) so that when it is true the other is false, and vica versa.

But this really depends on what you want.

Do you want it so when you have switched on "Death Cam On" you want it to be like that for every kill you make. And so after it is switched on you have the option to switch it off.

Or do you want the option to switch it off only when the death cam is running?

(I'd pressume the first - so I'll write the code for that :) )

edit

OK, here's all the code:

First, in your units' config.cpp, you'll need to make a class EventHandlers and modify the class UserActions

Code: [Select]
class Eventhandlers
{
   init="cam_enabled=true";
};

class UserActions
{
   class DeathCamOn
   {
      displayName="Death Cam On";
      position="";
      radius=99999;
      condition="(Format [{%1},slow_mo_deathcam] != {false}) && (player == this) && cam_enabled";
      statement="slow_mo_deathcam=true; this exec {\RAST\Script\Death_Cam\deathcam.sqs}";
   };
     
   class DeathCamOff
   {
      displayName="Death Cam Off";
      position="";
      radius=99999;
      condition="(Format [{%1},slow_mo_deathcam] != {false}) && (player == this) && !cam_enabled";
      statement="slow_mo_deathcam=false";
   };
};

This makes a new variable, cam_enabled which from when the unit is created is set to true: displaying the action "Death Cam On".

"Death Cam Off" will only be displayed when cam_enabled is false. Which only happens once the scipt "deathcam.sqs" is running thus hiding the action "Death Cam On" :)

"deathcam.sqs":

Code: [Select]
#loop

cam_enabled=true
? slow_mo_deathcam : goto "EH"
{_x removeAllEventHandlers "killed"} forEach eastsnipe
~1

goto "loop"

#EH

{_x addEventHandler ["killed",{_unit = _this select 0; _this exec "\RAST\script\Death_Cam\rast_deathcam.sqs"}]} forEach eastsnipe
cam_enabled=false

? !slow_mo_deathcam : goto "loop"
~1

goto "EH"

"rast_deathcam.sqs":

Code: [Select]
SetAccTime 0.2
_unit = _this select 0
_camPos = GetPos _unit
_cx = _camPos Select 0
_cy = _camPos Select 1
_cz = _camPos Select 2
_cam1 = "camera" CamCreate [_cx+2, _cy+1, _cz+2]
_cam1 CamSetTarget _unit
_cam1 CamSetFov 0.3
_cam1 CameraEffect ["Internal","Back"]
_cam1 CamCommit 2
@CamCommitted _cam1
SetAccTime 1.0

_cam1 CameraEffect ["Terminate","Back"]
CamDestroy _cam1

exit

btw You'll probably be wanting a method now so that you don't need to make an init.sqs each time you want to use this, right?

I'll try and fix that up for you as well :)
Title: Re:Death Camera On The Enemy(Switch On/Off)?
Post by: Maximus-Sniper on 04 Jun 2005, 13:24:01
Hi Lean Bear :)

Ok.. i'll try, but one problem, hehe
I have the class Eventhandlers in my config.cpp before and i use it, here take a look, and where should i add "cam_enabled=true" in that line?:
Code: [Select]
class EventHandlers
      {
      init="RAST_M82fx=loadFile ""\RAST\Script\M82A1_FX\m82fx.sqf""; [_This Select 0] Exec ""\RAST\Script\wbe_tracerfx\wbe_tracerfx.sqs""";
      //init="RAST_M82fx=loadFile ""\RAST\Script\M82A1_FX\m82fx.sqf""; [_This Select 0] Exec ""\RAST\Script\wbe_tracerfx\wbe_tracerfx.sqs""; this exec ""\RAST\Script\Bullet_Cam\sniperinit.sqs""; PosBullcam=loadFile ""\RAST\Script\Bullet_Cam\PosBullcam.sqf""";
      fired="if ((_this select 4) in [""AMMOM82APMag"",""AMMOM82ATMag""]) then {_this call RAST_M82fx}";
      };
   };

But i was working on another solution, hehe

I made two new sqs files and i call them for menu_1.sqs and menu_2.sqs

Take a look :)

menu_1.sqs
Code: [Select]
player addaction ["Enemy Death Cam","\RAST\Script\Death_Cam\menu_2.sqs"]
player addEventHandler _this exec "\RAST\script\Death_Cam\deathcam.sqs"   <----- Here is the big problem :( :( :( :(
track = false

and menu_2.sqs
Code: [Select]
_ID = _this select 2
player removeAction _ID
? !(track) : track = true ; player addaction ["Enemy Death Cam On", "\RAST\Script\Death_Cam\menu_2.sqs"];exit
? (track) : track = false; player addaction ["Enemy Death Cam Off", "\RAST\Script\Death_Cam\menu_2.sqs"]

Than i add this line at the end of my init= filed:

Code: [Select]
init="RAST_M82fx=loadFile ""\RAST\Script\M82A1_FX\m82fx.sqf""; [_This Select 0] Exec ""\RAST\Script\wbe_tracerfx\wbe_tracerfx.sqs""; this exec ""\RAST\Script\Death_Cam\menu_1.sqs""";

This works in the Action Menu. When i start the mission i have this "Enemy Death Cam" when i press it, i got this "Enemy Death Cam On" and Enemy Death Cam Off" when i press "Enemy Death Cam On" and kill the man, nothing happend, lol  ;D ;D ;D ;D

So the problem are in menu_1.sqs

But if you know how i can add "cam_enabled=true" in my class EventHandlers init field, mybe that's better  ;) ;)

Quote
btw You'll probably be wanting a method now so that you don't need to make an init.sqs each time you want to use this, right?

I'll try and fix that up for you as well

Yeah man, that's it's exactelly what i want. To remove the init.sqs and have that included in my addon for ever, hehe

Thank you so match if you can help me with that after we have fix this liltle problem in the Action Menu, hehe

Thanks :)

Maximus-Sniper
Title: Re:Death Camera On The Enemy(Switch On/Off)?
Post by: Lean Bear on 04 Jun 2005, 13:26:22
@ Maximus-Sniper

Simple, just do this:

Code: [Select]
class EventHandlers
      {
      init="cam_enabled=true;RAST_M82fx=loadFile ""\RAST\Script\M82A1_FX\m82fx.sqf""; [_This Select 0] Exec ""\RAST\Script\wbe_tracerfx\wbe_tracerfx.sqs""";
      //init="RAST_M82fx=loadFile ""\RAST\Script\M82A1_FX\m82fx.sqf""; [_This Select 0] Exec ""\RAST\Script\wbe_tracerfx\wbe_tracerfx.sqs""; this exec ""\RAST\Script\Bullet_Cam\sniperinit.sqs""; PosBullcam=loadFile ""\RAST\Script\Bullet_Cam\PosBullcam.sqf""";
      fired="if ((_this select 4) in [""AMMOM82APMag"",""AMMOM82ATMag""]) then {_this call RAST_M82fx}";
      };
   };
Title: Re:Death Camera On The Enemy(Switch On/Off)?
Post by: Maximus-Sniper on 04 Jun 2005, 13:42:35
Hi Lean Bear :)

Ok i change the init= field and now it's works allmost, one problem, when i press the "Death Cam On" and kill that man, it's works, but when i Press "Death Cam Off" than it turn it off and disappear form the Action Menu  ??? ??? So now i could't see the "Death Cam On" anymore, hehe  ;D

Maximus-Sniper
Title: Re:Death Camera On The Enemy(Switch On/Off)?
Post by: Lean Bear on 04 Jun 2005, 13:47:22
OK, did you replace the "deathcam.sqs" script?

Cause I double checked it and it all matches up fine.

Also, when you start the mission, what do you see in the action menu?

Do you only see "Death Cam On" or do you see both "Death Cam On" and "Death Cam Off"?
Title: Re:Death Camera On The Enemy(Switch On/Off)?
Post by: Maximus-Sniper on 04 Jun 2005, 13:53:34
Hi again :)

Yes i change the deathcam.sqs to :

Code: [Select]
#loop

cam_enabled=true
? slow_mo_deathcam : goto "EH"
{_x removeAllEventHandlers "killed"} forEach eastsnipe
~1

goto "loop"

#EH

{_x addEventHandler ["killed",{_unit = _this select 0; _this exec "\RAST\script\Death_Cam\rast_deathcam.sqs"}]} forEach eastsnipe
cam_enabled=false

? !slow_mo_deathcam : goto "loop"
~1

goto "EH"

And when i start the test mission i see "Death Cam On" only, when i press it, than it change to "Death Cam Off" and it's works, but when i press the "Death Cam Off" than it's disappear and can't see the "Death Cam On" any more

Maybe somthing in the Class UserActions ??

Maximus-Sniper
Title: Re:Death Camera On The Enemy(Switch On/Off)?
Post by: Lean Bear on 04 Jun 2005, 13:59:35
OK, try this in the class UserActions

Code: [Select]
class UserActions
{
   class DeathCamOn
   {
      displayName="Death Cam On";
      position="";
      radius=99999;
      condition="(Format [{%1},slow_mo_deathcam] != {false}) && (player == this) && cam_enabled";
      statement="slow_mo_deathcam=true; this exec {\RAST\Script\Death_Cam\deathcam.sqs}";
   };
     
   class DeathCamOff
   {
      displayName="Death Cam Off";
      position="";
      radius=99999;
      condition="(Format [{%1},slow_mo_deathcam] != {false}) && (player == this) && !cam_enabled";
      statement="slow_mo_deathcam=false; cam_enabled=true";
   };
};
Title: Re:Death Camera On The Enemy(Switch On/Off)?
Post by: Maximus-Sniper on 04 Jun 2005, 14:27:00
Hi :)

Ok i change the Class UserActions :)

But it's still the same, it's disappear when i turn it off  ???

Maximus-Sniper
Title: Re:Death Camera On The Enemy(Switch On/Off)?
Post by: Planck on 04 Jun 2005, 14:31:24
You did restart the game after changing the addon config didn't you?

I'm sure you did, but........just checking.  ;D


Planck
Title: Re:Death Camera On The Enemy(Switch On/Off)?
Post by: Maximus-Sniper on 04 Jun 2005, 14:56:07
Hi :)

@Lean Bear

It's work now, i did a change in the CLass UserActions, here:

Code: [Select]
class UserActions
      {
      class DeathCamOn
        {
         displayName="Death Cam On";
         position="";
         radius=99999;
         condition="(Format [{%1},slow_mo_deathcam] != {true}) && (player == this) && cam_enabled";
         statement="slow_mo_deathcam=true; this exec {\RAST\Script\Death_Cam\deathcam.sqs}";
      };

Had to change the condition to "true" hehe  ;D

Now it's works

Thanks Lean Bear :)

And now the init.sqs problem, hehe
I'm not realy sure how i can fix that to be included in the addon  ??? ???


@Planck

hehe  ;D ;D Yes i allways restart after some change in some files LOL

Maximus-Sniper
Title: Re:Death Camera On The Enemy(Switch On/Off)?
Post by: 456820 on 04 Jun 2005, 15:26:13
by any chance can you create a trigger but via a marker in a script included in the addon then just set the diameter to the whole map and put
eastsipe = this list
then that should make all east units eastsnipe so the deathcam would work on all east units i know its possible to create triggers via scripts because someone said they solved something with it but im not sure how hope that helps though
Title: Re:Death Camera On The Enemy(Switch On/Off)?
Post by: Lean Bear on 04 Jun 2005, 15:30:26
Yeah, that would be helpful. Cause that way all the units on the map would be included (including the player :) - I suppose it could be interesting to see yourself die in slo-mo as well :) )

If creating a trigger in a script doesn't work, the we could always do something in the class UserActions.

Because you can effectively create a trigger in the userActions, but you wouldn't have to make it do anything. In fact, you could add it on in the current userActions.

edit

Like this:

Code: [Select]
class UserActions
{
  class DeathCamOn
  {
      displayName="Death Cam On";
      position="";
      radius=99999;
      condition="(Format [{%1},slow_mo_deathcam] != {true}) && (player == this) && cam_enabled";
      statement="eastsnipe=this list; slow_mo_deathcam=true; this exec {\RAST\Script\Death_Cam\deathcam.sqs}";
  };
     
  class DeathCamOff
  {
      displayName="Death Cam Off";
      position="";
      radius=99999;
      condition="(Format [{%1},slow_mo_deathcam] != {false}) && (player == this) && !cam_enabled";
      statement="slow_mo_deathcam=false";
  };
};
Title: Re:Enemy Death Camera(Switch On/Off) In Action Menu?
Post by: Maximus-Sniper on 04 Jun 2005, 16:35:51
Hi :)

@Lean Bear and  456820

Well, if we use the eastsnipe=this list, that's mean we still have to use the init.sqs in evey mission?? Or it's that possible to make a another script that tells us what side is enemy etc.

"eastsnipe" are ok,but why "this list"? Which "list"?? hehe

Maximus-Sniper
Title: Re:Enemy Death Camera(Switch On/Off) In Action Menu?
Post by: 456820 on 04 Jun 2005, 16:38:10
well it was originally in a trigger so this list basically telling everyon inside the trigger area
Title: Re:Enemy Death Camera(Switch On/Off) In Action Menu?
Post by: Maximus-Sniper on 04 Jun 2005, 16:47:29
Hi :)

Ok, but that did't work :( I added the   eastsnipe=this list like this in the Class UserActions:

Code: [Select]
class UserActions
      {
      class DeathCamOn
        {
         displayName="Death Cam On";
         position="";
         

         condition="(Format [{%1},slow_mo_deathcam] != {true}) && (player == this) && cam_enabled";
         statement="eastsnipe=this list; slow_mo_deathcam=true; this exec {\RAST\Script\Death_Cam\deathcam.sqs}";
      };

And removed the init.sqs from the mission folder. May i make a trigger??
But in the Class UserActions we have this:

radius=99999;

that's mean the same if you make a trigger with radius of 99999 ??

:)
Title: Re:Enemy Death Camera(Switch On/Off) In Action Menu?
Post by: Lean Bear on 04 Jun 2005, 16:48:02
list is just a command used in scripting. No different to something like exec etc.

It lists all the units who would be affected by that trigger (all the units ion the map in this case).

edit

Yes, it is the same as a trigger of axis a and b = 99999 ;)

Except this one is bound to the player //or something :P
Title: Re:Enemy Death Camera(Switch On/Off) In Action Menu?
Post by: 456820 on 04 Jun 2005, 16:50:17
well make sure its east present and condition this
then activation
eastsnipe = this list
im not sure if you can do that in those files but have a go
Title: Re:Enemy Death Camera(Switch On/Off) In Action Menu?
Post by: Maximus-Sniper on 04 Jun 2005, 17:19:08
Hi mates :)

Ok.. i still got this error after adding  eastsnipe=this list

Code: [Select]
'eastsnipe=this |#|list; slow_mo_deathcam=true; this exec {\RAST\Script\Death_Cam\deathcam.sqs}': Error Uknown operator list

I remember we did this befor? :) So we had to remove the "eastsnipe=this list"

I'm not sure, hehe :)
Title: Re:Enemy Death Camera(Switch On/Off) In Action Menu?
Post by: Planck on 04 Jun 2005, 17:47:31
Maybe its just me, but is it not thislist

Or try........... eastsnipe in thislist

EDIT:  Forget that.....I thought it was for the condition.  ::)


Planck ::)
Title: Re:Enemy Death Camera(Switch On/Off) In Action Menu?
Post by: Maximus-Sniper on 04 Jun 2005, 20:56:58
Hi :)

@456820

Quote
just alittle thing the deathcam i think is to slow cahnge the speed to 0.35 and add a 1 second white in at the begining and black out at the end that way it will be great

Ok. i'm gonna change some more in the rast_deathcam.sqs :)

Change done:

Code: [Select]
SetAccTime 0.35
_unit = _this select 0
_camPos = GetPos _unit
_cx = _camPos Select 0
_cy = _camPos Select 1
_cz = _camPos Select 2
_cam1 = "camera" CamCreate [_cx+2, _cy+1, _cz+2]
_cam1 CamSetTarget _unit
_cam1 CamSetFov 0.3
_cam1 CameraEffect ["Internal","Back"]
_cam1 CamCommit 2
@CamCommitted _cam1
SetAccTime 1.0

_cam1 CameraEffect ["Terminate","Back"]
CamDestroy _cam1

exit

I'm nor sure where i can add 1 sec at the beginning and Black Out ??, hehe

I like to try to make the camera go around the man to, but not realy sure where i do that.. hehe  :P
Title: Re:Enemy Death Camera(Switch On/Off) In Action Menu?
Post by: 456820 on 04 Jun 2005, 21:17:45
change it to this

Code: [Select]
titlecut [" ", "White in", 1]
_unit = _this select 0
_camPos = GetPos _unit
_cx = _camPos Select 0
_cy = _camPos Select 1
_cz = _camPos Select 2
SetAccTime 0.35
_cam1 = "camera" CamCreate [_cx+2, _cy+1, _cz+2]
_cam1 CamSetTarget _unit
_cam1 CamSetFov 0.3
_cam1 CameraEffect ["Internal","Front"]
_cam1 CamCommit 2
@CamCommitted _cam1
SetAccTime 1.0

_cam1 CameraEffect ["Terminate","Back"]
CamDestroy _cam1

exit

thats just the same but ive added the white in no black out becuase its at the end and it might dirupt the game eg all you can see is black screen. Ive also made it target the dead guy from the front because i think it looks better that way but if you disagree you can change it back
cya
Title: Re:Enemy Death Camera(Switch On/Off) In Action Menu?
Post by: Maximus-Sniper on 04 Jun 2005, 22:07:07
Hi 456820 :)

Thanks  ;D That's was better  :P :P

I'm gonna see if it's possible to add some rotating to, hehe

Maximus-Sniper
Title: Re:Enemy Death Camera(Switch On/Off) In Action Menu?
Post by: Maximus-Sniper on 05 Jun 2005, 02:36:16
Hi again :)

Ok, now have I included the init.sqs into my deathcam.sqs :) So now we don't need to add init.sqs into any mission anymore, hehe  ;D

Just another and finale thing to do. I still need to name the unit to east1, east2 etc...

So it is possible to do something now to change that, so i don't need to add name all the time to get the "Enemy Death Cam" to work??

Maximus-Sniper
Title: Re:Enemy Death Camera(Switch On/Off) In Action Menu?
Post by: Lean Bear on 05 Jun 2005, 11:23:05
Yes, that was what the eastsnipe=thislist was about.

@ Planck, yeah I reckon you're right about that ;)

@ Maximus-Sniper

I dunno if you tried it this way or not:

Code: [Select]
class UserActions
{
  class DeathCamOn
  {
      displayName="Death Cam On";
      position="";
      radius=99999;
      condition="(Format [{%1},slow_mo_deathcam] != {true}) && (player == this) && cam_enabled";
      statement="eastsnipe=thislist; slow_mo_deathcam=true; this exec {\RAST\Script\Death_Cam\deathcam.sqs}";
  };
     
  class DeathCamOff
  {
      displayName="Death Cam Off";
      position="";
      radius=99999;
      condition="(Format [{%1},slow_mo_deathcam] != {false}) && (player == this) && !cam_enabled";
      statement="slow_mo_deathcam=false";
  };
};
Title: Re:Enemy Death Camera(Switch On/Off) In Action Menu?
Post by: Maximus-Sniper on 05 Jun 2005, 13:45:48
Hi Lean Bear :)

Ok, now i understand that eastsnipe=thislist, hehe
But that did't work when i press the "Death Cam On" :(
Nothing happend when i kill a enemy. I don't give him any name and i removed the   "eastsnipe= [east1, east2, east3] from the deathcam.sqs

maybe we need a trigger ?

hmm.. ???

Maximus-Sniper


EDIT:1

Yes, i had to make a TRIGGER :(

(http://www.rast.co.uk/images/ofp/screenshots/trigger.JPG)

So it's looks like this "Enemy Death Cam" ended here. I don't think it's possible to make a script to make a trigger, i'm not sure  ???

Hope it's possible  :P :P :P

Maximus-Sniper
Title: Re:Enemy Death Camera(Switch On/Off) In Action Menu?
Post by: Maximus-Sniper on 06 Jun 2005, 07:11:05
Hi all :)

Do anyone know how i can make that deathcam to rotate around?
Here is my rast_deathcam.sqs file:

Code: [Select]

titlecut [" ", "White in", 1]
_unit = _this select 0
_camPos = GetPos _unit
_cx = _camPos Select 0
_cy = _camPos Select 1
_cz = _camPos Select 2
SetAccTime 0.35

_cam = "camera" CamCreate [_cx+2, _cy+1, _cz+2]
_cam CamSetTarget _unit
_cam CamSetFov 0.3
_cam CameraEffect ["Internal","Front"]
_cam CamCommit 2
@CamCommitted _cam
SetAccTime 1.0

_cam CameraEffect ["Terminate","Back"]
CamDestroy _cam

exit


Thanks :)

Maximus-Sniper
Code: [Select]
Title: Re:Enemy Death Camera(Switch On/Off) In Action Menu?
Post by: Lean Bear on 06 Jun 2005, 08:38:00
Try this in the class UserActions:

Code: [Select]
class UserActions
{
  class DeathCamOn
  {
      displayName="Death Cam On";
      position="zbran";
      radius=99999;
      condition="(Format [{%1},slow_mo_deathcam] != {true}) && (player == this) && cam_enabled";
      statement="eastsnipe=thislist; slow_mo_deathcam=true; this exec {\RAST\Script\Death_Cam\deathcam.sqs}";
  };
     
  class DeathCamOff
  {
      displayName="Death Cam Off";
      position="zbran";
      radius=99999;
      condition="(Format [{%1},slow_mo_deathcam] != {false}) && (player == this) && !cam_enabled";
      statement="slow_mo_deathcam=false";
  };
};

I added a position so that the "trigger" might be considered valid.
Title: Re:Enemy Death Camera(Switch On/Off) In Action Menu?
Post by: Maximus-Sniper on 06 Jun 2005, 08:54:41
Hi Lean Bear :)

I still needed to make a trigger with 9999 xy and Activation "East" nothing more to add in that trigger.

So i don't know if it's another way to do this? :(

Maximus-Sniper
Title: Re:Enemy Death Camera(Switch On/Off) In Action Menu?
Post by: Lean Bear on 06 Jun 2005, 09:23:49
Well, doing that in the class UserActions should work just fine.

Try reducing the radius size to say 1000, and play around with the "position".

You could try changing it to "player", "this" or make a point in model.p3d file called "pos_trigger" (in the memory lod) and then put:

position="pos_trigger";
Title: Re:Enemy Death Camera(Switch On/Off) In Action Menu?
Post by: Maximus-Sniper on 06 Jun 2005, 09:50:53
Hi Lean Bear :)

Ok :)

I did try:

position="player";
Not Working

position="this";
Not Working

And i make a new point in my sniper model, in the Memory, called it for "pos_trigger" than

position="pos_trigger";
Not Working

position="trigger";
Not Working

position="zbran";
Not Working

I'm gonna try some more "position". but i don't that gonna work.

Thanks :)

Maximus-Sniper
Title: Re:Enemy Death Camera(Switch On/Off) In Action Menu?
Post by: Maximus-Sniper on 06 Jun 2005, 10:18:13
Hi again :)

Now i have tryed lots of differents point in the "Memory" in my sniper model, but nothing happen :( :( :(

I still now need to make a trigger with:

- Axis a b =1000

- Activation = East

So i think if we make the activation (East) to work, than i think the hole script will work without that trigger.

But, how do we get "Activation=East" to work???

Maximus-Sniper
Title: Re:Enemy Death Camera(Switch On/Off) In Action Menu?
Post by: Lean Bear on 06 Jun 2005, 11:28:51
You can't - UserAction aren't triggers, they just behave like them.

btw It doesn't matter about activation East, you could do activation Anyone and it would still work fine (probably better as it would select all units, not just the east).
Title: Re:Enemy Death Camera(Switch On/Off) In Action Menu?
Post by: Maximus-Sniper on 06 Jun 2005, 15:53:25
Hei Lean Bear :)

Ok i understand  ;)

btw, it's much better to make a trigger and just change 2 settings (Axis and Activation) instead of use a init.sqs, trigger and name of unit  ;D ;D

So i will thank you so match for helping me with this Enemy Death Cam :) and thanks to 456820 :)
I'm gonna add your name, 456820 and Planck names into my credit list  ;)

Best Regards
Maximus-Sniper
Title: Re:Enemy Death Camera(Switch On/Off) In Action Menu?
Post by: Lean Bear on 06 Jun 2005, 16:46:19
np ;)

Its a shame that we couldn't get the userActions working - cause that way you wouldn't need a trigger, init.sqs, name units or anything.
Title: Re:Enemy Death Camera(Switch On/Off) In Action Menu?
Post by: 456820 on 06 Jun 2005, 19:25:50
Quote
456820 and Planck names into my credit list  
nice to hear i helped
also if the trigger idea doesnt work how is this going to work or have i missed something out or will soomeone have to create the trigger in game ?
anyway i cant wait until this comes out looking at the videos and pics it definately looks like one of the best snipers ive seen on ofp
Title: Re:Enemy Death Camera(Switch On/Off) In Action Menu?
Post by: Maximus-Sniper on 06 Jun 2005, 20:31:49
He mates :)

@Lean Bear

Quote
Its a shame that we couldn't get the userActions working - cause that way you wouldn't need a trigger, init.sqs, name units or anything.

Yeah, it's a shame we couldn't get that UserActions to work :( But i think everybody can make a trigger and change two settings,  ;D ;D

@456820

Quote
also if the trigger idea doesnt work how is this going to work or have i missed something out or will soomeone have to create the trigger in game ?
anyway i cant wait until this comes out looking at the videos and pics it definately looks like one of the best snipers ive seen on ofp

The trigger idea work fine, it's just we couldn't get the UserActions to make a trigger :( so you all have to make one trigger and put it eneywhere in the map. You need only to make two change on that trigger. The Axis (to whatever you want) and Activation (East or Anybody)Like this:

(http://www.rast.co.uk/images/ofp/screenshots/trigger_2.JPG)

Nice to hear you like this pack  ;)

btw, about that camera, hehe Maybe we can make it rotate around the man? It's that possible to add the rotate effect inn this script?:

Code: [Select]
titlecut [" ", "White in", 1]
_unit = _this select 0
_camPos = GetPos _unit
_cx = _camPos Select 0
_cy = _camPos Select 1
_cz = _camPos Select 2
SetAccTime 0.35

_cam = "camera" CamCreate [_cx+2, _cy+1, _cz+2]
_cam CamSetTarget _unit
_cam CamSetFov 0.3
_cam CameraEffect ["Internal","Front"]
_cam CamCommit 2
@CamCommitted _cam
SetAccTime 1.0

_cam CameraEffect ["Terminate","Back"]
CamDestroy _cam

exit

Thanks to you all again :)
Title: Re:Enemy Death Camera(Switch On/Off) In Action Menu?
Post by: 456820 on 07 Jun 2005, 15:56:29
Code: [Select]
titlecut [" ", "White in", 1]
_unit = _this select 0
_camPos = GetPos _unit
_cx = _camPos Select 0
_cy = _camPos Select 1
_cz = _camPos Select 2
SetAccTime 0.35

_cam = "camera" CamCreate [_cx+2, _cy+1, _cz+2]
_cam CamSetTarget _unit
_cam CamSetFov 0.3
_cam CameraEffect ["Internal","Front"]
_cam CamCommit 2
@CamCommitted _cam
_cam CameraEffect ["Internal","right back"]
_cam CamSetTarget _unit
_cam CamCommit 3
@CamCommitted _cam
SetAccTime 1.0

_cam CameraEffect ["Terminate","Back"]
CamDestroy _cam

exit

yep like that it should work anyway have a go
Title: Re:Enemy Death Camera(Switch On/Off) In Action Menu?
Post by: Maximus-Sniper on 07 Jun 2005, 20:42:46
Hi mate :)

That did't work :( It was the same.

I was looking around here in the forum and found this one, but i don't know how i can put this one into my script.

Code: [Select]
; spin camera around object in downward spiral



;set up the camera

showcinemaborder true
_camera = "camera" camcreate [0,0,0]
_camera cameraeffect ["internal", "back"]
_camera camSetTarget object_name


;get the coordinates of the object to spin around

_x = getpos object_name select 0
_y = getpos object_name select 1
_dir = getdir object_name


;set up the increments by which the camera will move

_incr = 0.7
_angle = 0
_height = 50


#rotate

_camera camSetPos [_x + (8*sin(_dir+_angle)), _y + (8*cos(_dir+_angle)),_height]
_camera camCommit 0

~0.001

_angle = _angle + _incr
_height = _height - (_incr/10)

?_angle>=360:_angle = 0

?not(_height<=1):goto "rotate"


;at the bottom of the spiral, so end the script

_camera cameraeffect ["terminate", "back"]
camdestroy _camera

showcinemaborder false


exit


Title: Re:Enemy Death Camera(Switch On/Off) In Action Menu?
Post by: 456820 on 08 Jun 2005, 20:55:06
erm to be truthull i could do it but to be honest i cant be arsed at the moment lol.
ill have alook tomorrow when im more bothered i know i can do it but it requires to many brain cells wich i have that are awake lol.
anyway ill have a look at a later time unless you want a lazy answer look at blanco's camera script in the editors depot somewhee.
cya