Home   Help Search Login Register  

Author Topic: custom death script  (Read 6436 times)

0 Members and 1 Guest are viewing this topic.

voodzia

  • Guest
Re:custom death script
« Reply #30 on: 21 May 2005, 11:43:24 »
It's because you're looking at wrong examples ;) Take a look at macguba's latest mission - "Un-Impossible Mission". You'll see for your self how it was done by the master mission maker - he just can't be wrong.
« Last Edit: 21 May 2005, 11:48:10 by voodzia »

Offline 456820

  • Contributing Member
  • **
Re:custom death script
« Reply #31 on: 21 May 2005, 11:50:39 »
Solved this bit not sure why it went wrong but its fixed now.
But ive ran into a nother problem im trying to make the enddialog show when the player shoots any western soldier. i can do the trigger but i just triedit but the dialog wouldnt seem to show.
I created the trigger well in the test it was a radio alpha.
Condition = this
on activation = enable end dialog
But when i radiod alpha the dialog didt show what could be wrong

Also would a script be involved to check if the player killed the other unit. something to do with an event handler killed then the script gets activate and in the script is something like

Code: [Select]
?_this select1 == player: goto "enddialog"
#enddialog
EXIT

Thats probally wrong but it might be along those lines i just need to check if _this select1 wich is the returned value for the EH killed of who did it, then you ask the script if _this select1 equals the player if so i want it to show end dialog.
« Last Edit: 21 May 2005, 13:26:09 by 456820 »

voodzia

  • Guest
Re:custom death script
« Reply #32 on: 21 May 2005, 15:03:41 »
Quote
But when i radiod alpha the dialog didt show what could be wrong
I think the answer is simple and you can find it in comref -
Code: [Select]
enableEndDialog
Type of returned value:
    Nothing
Description:
    Enable dialog buttons to be shown during OnPlayerKilled script.
And one more thing - I hope there is a space between select and 1 in your script?

Offline 456820

  • Contributing Member
  • **
Re:custom death script
« Reply #33 on: 21 May 2005, 15:20:42 »
okay then so that means i cant show the dialog screen during a mission but ive seen it been done before so many times.
And yes there is a space between select and 1

Offline 456820

  • Contributing Member
  • **
Re:custom death script
« Reply #34 on: 22 May 2005, 15:03:26 »
hey
i was wondering Sui if by any chance you could explain how you did the edited dead screen and how you make it show becuase endgialogscreen command only workd through the onplayerkilled script plus i really need that for a mission well several just to finish them off because the note pad isnt really as good

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:custom death script
« Reply #35 on: 26 May 2005, 08:32:28 »
I'll find the code once I get home tonight and post it up for you...

Basically the sequence of events went something like this:

- Player shoots Superior office
- Soldier says "What did you do that for?" etc.
- Screen fades to black
- Player is killed (player setdammage 1)
- player setpos'ed to tent and revived (player setdammage 0)
- custom resource displayed on screen
- fade back in
- enableenddialog true

I'll post the code up a bit later...

[edit] THe code:

Onplayerkilled.sqs
Code: [Select]
? blueonblue: goto "KilledNPC"
...
#KilledNPC
orderstring = "enableradio false"
[player] join grpnull
~3
0 fademusic 1
3 fadesound 1
playmusic "track6"
enableenddialog
player setdammage 0
removeallweapons player
player playmove "combattostand"
player setpos [(getpos NPCKtent select 0), (getpos NPCKtent select 1), 0]
player setdir 270
~1
titlersc ["CourtMartial","PLAIN",0.1]
~1.5
_cam = "camera" camcreate [0,0,0]
_cam cameraeffect ["internal","back"]
_cam camsetpos [(getpos player select 0) + sin (getdir player) * 2, (getpos player select 1) + cos (getdir player) * 2, 1.8]
_cam camsettarget [getpos player select 0, getpos player select 1, 1.7].... etc. etc...

Description.ext

To define the resource:
Code: [Select]
class SolidPicture
{
   type=0;
   idc=-1;
   style=48;
   colorBackground[]={0,0,0,0};
   colorText[]={1,1,1,};
   font="tahomaB24";
   size=0;
};
...
class RscTitles
{
class CourtMartial
   {
      idd=-1;
      movingEnable=0;
      duration=999;
      name="CourtMartial";
      controls[]={"CourtMartial"};
      class CourtMartial: SolidPicture
      {
         text="CourtMartial.paa";
         x=0.000000;
         y=0.000000;
         w=1.000000;
         h=0.15000;
      };
   };
...

Anyway, play with that and see how you go. The tutorials mentioned before should be able to teach you how it all works ;)
« Last Edit: 26 May 2005, 11:00:11 by Sui »

Offline 456820

  • Contributing Member
  • **
Re:custom death script
« Reply #36 on: 26 May 2005, 17:21:24 »
hey thanks alot Sui im going to have a go later

voodzia

  • Guest
Re:custom death script
« Reply #37 on: 26 May 2005, 20:50:57 »
Only few days ago you posted your comment on "Cutrsc/Titlersc Tutorial" by General Barron but I guess you haven't read it yet, have you? It's all there - try to read it once again if you already have.

Offline 456820

  • Contributing Member
  • **
Re:custom death script
« Reply #38 on: 27 May 2005, 19:52:11 »
okay thanks alot Sui i think i understand it now so i decided to have a go and create a complicated script (wich probally isnt needed) well to me its complicated cause im just starting to get alright at scripting anyway i know for sure the syntax is wrong so i was hoping someone could have a go at correcting it for me The script is attached on this post.

I plan to run the script through an EH. im going to add a killed EH to all superior officers then the script should run and check if the killer is on the same side if he is it checks if its the player if still yes than it goes to the court martial bit and if no it makes sure the killer is on the other side then goes to exit meaning the player can carry on with the mission.

The only bit is Is the script right ?

Offline 456820

  • Contributing Member
  • **
Re:custom death script
« Reply #39 on: 28 May 2005, 18:19:23 »
okay ive had a pla around with the script i made and cant get it to work well i can kind of the script runs when theofficer is dead but doesnt care if it was the player or an east soldier but then after that everything works great until the text "You have been court martialled" comes up its just above the 'You are dead' text, is blury, 'You are dead' text can still be seen. but then the rest of the sript runs perfect.
Also i had a bit of trouble with Sui's description class mostly because of the .paa file needed it kept saying that files cant be seen i think most of these problems are linked to that suchas being blury.

Offline 456820

  • Contributing Member
  • **
Re:custom death script
« Reply #40 on: 29 May 2005, 13:55:22 »
another problem after editing my custom death script to show the players optics for a few seconfs at the begining it all works fine until i create a camera and tell it to target the dead player istead of targeting the player it goes halfway into the sea but still carries n with the script like changes FOV and changes height and so on.
ive posted the first half of the script below \/

Code: [Select]
killer = _this select 1
enableradio false
0 FadeSound 0.5
0 FadeMusic 1
PlayMusic "RTrack1A"
SetAccTime 0.35
~0.035

TitleCut ["","WHITE IN",0.50]
killer switchcamera "gunner"
~2
EnableEndDialog
~1
TitleCut ["","WHITE IN",1]
_camera = "camera" CamCreate [0,0,0]
_camera CameraEffect ["INTERNAL","FRONT"]

_camera setpos getpos (vehicle _player)
_camera CamSetTarget (vehicle _player)
_camera CamSetRelPos [+8,+5,+5]
_camera CamSetFov 0.250
_camera CamCommit 0
~1
0.5 FadeMusic 0.5
~0.5
_camera CamSetTarget (vehicle _player)
_camera CamSetRelPos [+10,+10,+10]
_camera CamSetFov 0.250
_camera CamCommit 0
~1
_camera CamSetTarget (vehicle _player)
_camera CamSetRelPos [+2,+3,+0.5]
_camera CamSetFov 0.250
_camera CamCommit 0.500
~1.5

Any reasons why its going into the sea have i missed a line out about the camera or something ?

Offline 456820

  • Contributing Member
  • **
Re:custom death script
« Reply #41 on: 30 May 2005, 20:33:20 »
erm *BUMP*

Offline Marvin

  • Members
  • *
  • One day they will come
Re:custom death script
« Reply #42 on: 30 May 2005, 20:34:40 »
yes not _player but player
Is there any games than Flashpoint?

Offline Marvin

  • Members
  • *
  • One day they will come
Re:custom death script
« Reply #43 on: 30 May 2005, 20:35:28 »
_player is local variable!
Is there any games than Flashpoint?

Offline 456820

  • Contributing Member
  • **
Re:custom death script
« Reply #44 on: 30 May 2005, 20:36:27 »
ok cheers i will try that and get back the only thing is that it worked before when i did _player until i added the switch camera to the beggining also what camera effect do i use in an intro to view a gunners sights?