Hi all, well Ill give a bit of an expilnation first. I am making an end of campaign stats mission which involves displaying the stats (in graphic form) of a few things. I have the bulk of it done but just need to know these. (All event based)
How do I return of the number of player kills/score/deaths/assists in the campaign?
Here is the mission code at the minute :
$Mission Desc:
XSTR("Shows end of campaign stats.", -1)
$end_multi_text
+Game Type Flags: 1
+Flags: 134298
+Disallow Support: 1
+Hull Repair Ceiling: 0.000000
+Subsystem Repair Ceiling: 100.000000
+Viewer pos: -1012.211914, 115902.898438, -51924.863281
+Viewer orient:
0.999951, -0.000001, -0.009931,
0.007458, 0.660392, 0.750884,
0.006558, -0.750921, 0.660359
$Load Screen 640: EBW-0.tga
$Load Screen 1024: EBW-0.tga
;;FSO 3.6.0;; $Skybox Model: starfield.pof
$AI Profile: TBP
#Sexp_variables
$Variables:
(
0 "Column1X" "200" "number"
1 "Column2X" "700" "number"
2 "DigitUnitValue" "0" "number"
3 "DigitValue" "0" "number"
4 "DigitX" "0" "number"
5 "HighestUnits" "1000" "number"
6 "NumberDisplayTime" "0" "number"
7 "NumberDrawFlag" "0" "number"
8 "NumberValue" "0" "number"
9 "NumberX" "0" "number"
10 "NumberY" "0" "number"
11 "Pitch" "0" "number"
12 "PlayerAssists" "0" "number"
13 "PlayerDeaths" "0" "number"
14 "PlayerKills" "0" "number"
15 "PlayerScore" "0" "number"
)
#Command Briefing
#Briefing
$start_briefing
$num_stages: 0
$end_briefing
#Debriefing_info
$Num stages: 0
#Players ;! 1 total
$Starting Shipname: Alpha 1
$Ship Choices: (
"EA Aurora" 5
"EA Aurora MK1" 5
"EA Badger" 5
"EA Thunderbolt" 5
"PSI Aurora" 5
"PSI Thunderbolt" 5
"CR Sentri" 5
"NR Frazi" 5
"ISA Whitestar" 5
)
+Weaponry Pool: (
"40mm Pulse" 16
"45mm Pulse" 16
"60mm Pulse" 16
"42mm Plasma" 16
"43mm Plasma" 16
"45mm Fusion" 16
"Disruptor" 16
"Particle Array" 16
"Ion Accelerator" 16
"52mm Pulse" 16
"75mm Pulse" 16
"Neutron Gun" 16
"Light Fusion" 16
"Drazi 35mm" 16
"WS Pulsed Fusion" 16
"WS Pulsed Neutron" 16
"Pulsed Fusion" 16
"WS Neutron Beam" 16
"EA Venom 1" 500
"EA Venom 2" 500
"EA Panther" 500
"EA Bulldog" 500
"CR Asari" 500
"NR Ta'Lon" 500
"NR T'Kor" 500
"MF Shokrai" 500
)
#Objects ;! 1 total
$Name: Alpha 1 ;! Object #0
$Class: EA Aurora
$Team: Friendly
$Location: 0.000000, 0.000000, 0.000000
$Orientation:
1.000000, 0.000000, 0.000000,
0.000000, 1.000000, 0.000000,
0.000000, 0.000000, 1.000000
$AI Behavior: None
$Cargo 1: XSTR("Nothing", -1)
+Initial Velocity: 33
+Initial Hull: 100
+Initial Shields: 100
+Subsystem: Pilot
$Arrival Location: Hyperspace
$Arrival Cue: ( false )
$Departure Location: Hyperspace
$Departure Cue: ( false )
$Determination: 10
+Flags: ( "cargo-known" "beam-protect-ship" "no-shields" "player-start" "invulnerable" "hidden-from-sensors" )
+Flags2: ( "targetable-as-bomb" )
+Respawn priority: 0
+Group: 0
+Score: 20
#Wings ;! 1 total
$Name: Alpha
$Waves: 1
$Wave Threshold: 0
$Special Ship: 0 ;! Alpha 1
$Arrival Location: Hyperspace
$Arrival Cue: ( true )
$Departure Location: Hyperspace
$Departure Cue: ( false )
$Ships: ( ;! 1 total
"Alpha 1"
)
+Hotkey: 0
+Flags:( )
#Events ;! 30 total
$Formula: ( do-nothing )
+Name: __________SET THESE ACCORDINGLY
+Repeat Count: 1
+Interval: 1
+Team: 0
$Formula: ( when
( true )
( modify-variable @PlayerKills[0] 1 )
)
+Name: set player kills
+Repeat Count: 1
+Interval: 1
+Team: 0
$Formula: ( when
( true )
( modify-variable @PlayerAssists[0] 2 )
)
+Name: set player assists
+Repeat Count: 1
+Interval: 1
+Team: 0
$Formula: ( when
( true )
( modify-variable @PlayerDeaths[0] 3 )
)
+Name: set player deaths
+Repeat Count: 1
+Interval: 1
+Team: 0
$Formula: ( when
( true )
( modify-variable @PlayerScore[0] 4 )
)
+Name: set player score
+Repeat Count: 1
+Interval: 1
+Team: 0
$Formula: ( do-nothing )
+Name: _______MAKE THESE TRUE OR FALSE
+Repeat Count: 1
+Interval: 1
+Team: 0
$Formula: ( when
( is-previous-event-true
"Brak attack 16a"
"start"
)
( do-nothing )
)
+Name: you did well
+Repeat Count: 1
+Interval: 1
+Team: 0
$Formula: ( when
( is-previous-event-true
"Brak attack 16b"
"start"
)
( do-nothing )
)
+Name: you did not do well
+Repeat Count: 1
+Interval: 1
+Team: 0
$Formula: ( when
( or
( < @PlayerKills[0] 15 )
( > @PlayerDeaths[0] 30 )
)
( do-nothing )
)
+Name: rookie
+Repeat Count: 1
+Interval: 1
+Team: 0
$Formula: ( when
( or
( < @PlayerKills[0] 30 )
( > @PlayerDeaths[0] 25 )
)
( do-nothing )
)
+Name: pilot
+Repeat Count: 1
+Interval: 1
+Team: 0
$Formula: ( when
( or
( < @PlayerKills[0] 30 )
( > @PlayerDeaths[0] 20 )
)
( do-nothing )
)
+Name: veteran
+Repeat Count: 1
+Interval: 1
+Team: 0
$Formula: ( when
( or
( > @PlayerKills[0] 70 )
( < @PlayerDeaths[0] 20 )
)
( do-nothing )
)
+Name: wing commander
+Repeat Count: 1
+Interval: 1
+Team: 0
$Formula: ( when
( or
( < @PlayerKills[0] 15 )
( > @PlayerDeaths[0] 30 )
)
( do-nothing )
)
+Name: pussy
+Repeat Count: 1
+Interval: 1
+Team: 0
$Formula: ( when
( or
( < @PlayerKills[0] 30 )
( > @PlayerDeaths[0] 25 )
)
( do-nothing )
)
+Name: brave
+Repeat Count: 1
+Interval: 1
+Team: 0
$Formula: ( when
( and
( < @PlayerKills[0] 50 )
( > @PlayerDeaths[0] 20 )
)
( do-nothing )
)
+Name: a threat
+Repeat Count: 1
+Interval: 1
+Team: 0
$Formula: ( when
( or
( > @PlayerKills[0] 70 )
( < @PlayerDeaths[0] 20 )
)
( do-nothing )
)
+Name: fearless
+Repeat Count: 1
+Interval: 1
+Team: 0
$Formula: ( do-nothing )
+Name: ____________THE CUTSCENE ITSELF
+Repeat Count: 1
+Interval: 1
+Team: 0
$Formula: ( when
( true )
( lock-perspective ( true ) )
( player-use-ai )
( add-goal
"Alpha 1"
( ai-waypoints-once "Dest" 89 )
)
( hud-disable 1 )
( play-sound-from-file
"b5_season4.wav"
)
( remove-sun-bitmap 0 )
)
+Name: start
+Repeat Count: 1
+Interval: 1
+Team: 0
$Formula: ( when
( true )
( show-subtitle
32
32
" "
4000
"ebwlogo.tga"
1000
( true )
( true )
)
)
+Name: ebw logo
+Repeat Count: 1
+Interval: 1
+Chained: 0
+Team: 0
$Formula: ( when
( true )
( show-subtitle
64
32
" "
999999
"ebwendofwarsummary.tga"
1000
( true )
)
)
+Name: end of war summary
+Repeat Count: 1
+Interval: 1
+Chained: 4
+Team: 0
$Formula: ( when
( true )
( when
( is-event-true-delay
"you did well"
0
)
( show-subtitle
32
128
" "
999999
"ebwyoudidwell.tga"
1000
( true )
)
)
( when
( is-event-true-delay
"you did not do well"
0
)
( show-subtitle
32
128
" "
999999
"ebwyoudidwell.tga"
1000
( true )
)
)
)
+Name: you did (not) do well pilot
+Repeat Count: 1
+Interval: 1
+Chained: 4
+Team: 0
$Formula: ( when
( true )
( show-subtitle
@Column1X[200]
256
" "
999999
"ebwplayerkills.tga"
1000
)
( modify-variable
@NumberValue[0]
@PlayerKills[0]
)
( modify-variable
@NumberX[0]
@Column2X[700]
)
( modify-variable @NumberY[0] 256 )
( modify-variable
@NumberDisplayTime[0]
999999
)
( modify-variable
@DigitUnitValue[0]
@HighestUnits[1000]
)
( modify-variable
@NumberDrawFlag[0]
1
)
)
+Name: player kills
+Repeat Count: 1
+Interval: 1
+Chained: 3
+Team: 0
$Formula: ( when
( true )
( show-subtitle
@Column1X[200]
320
" "
999999
"ebwplayerassists.tga"
1000
)
( modify-variable
@NumberValue[0]
@PlayerAssists[0]
)
( modify-variable
@NumberX[0]
@Column2X[700]
)
( modify-variable @NumberY[0] 320 )
( modify-variable
@NumberDisplayTime[0]
999999
)
( modify-variable
@DigitUnitValue[0]
@HighestUnits[1000]
)
( modify-variable
@NumberDrawFlag[0]
1
)
)
+Name: player assists
+Repeat Count: 1
+Interval: 1
+Chained: 1
+Team: 0
$Formula: ( when
( true )
( show-subtitle
@Column1X[200]
384
" "
999999
"ebwplayerdeaths.tga"
1000
)
( modify-variable
@NumberValue[0]
@PlayerDeaths[0]
)
( modify-variable
@NumberX[0]
@Column2X[700]
)
( modify-variable @NumberY[0] 384 )
( modify-variable
@NumberDisplayTime[0]
999999
)
( modify-variable
@DigitUnitValue[0]
@HighestUnits[1000]
)
( modify-variable
@NumberDrawFlag[0]
1
)
)
+Name: player deaths
+Repeat Count: 1
+Interval: 1
+Chained: 1
+Team: 0
$Formula: ( when
( true )
( show-subtitle
@Column1X[200]
448
" "
999999
"ebwplayerscore.tga"
1000
)
( modify-variable
@NumberValue[0]
@PlayerScore[0]
)
( modify-variable
@NumberX[0]
@Column2X[700]
)
( modify-variable @NumberY[0] 448 )
( modify-variable
@NumberDisplayTime[0]
999999
)
( modify-variable
@DigitUnitValue[0]
@HighestUnits[1000]
)
( modify-variable
@NumberDrawFlag[0]
1
)
)
+Name: player score
+Repeat Count: 1
+Interval: 1
+Chained: 1
+Team: 0
$Formula: ( when
( true )
( show-subtitle
@Column1X[200]
512
" "
999999
"ebwplayerrating.tga"
1000
)
( when
( is-event-true-delay "pussy" 0 )
( show-subtitle
@Column2X[700]
512
" "
999999
"ebwpussy.tga"
1000
)
)
( when
( is-event-true-delay "brave" 0 )
( show-subtitle
@Column2X[700]
512
" "
999999
"ebwbrave.tga"
1000
)
)
( when
( is-event-true-delay "a threat" 0 )
( show-subtitle
@Column2X[700]
512
" "
999999
"ebwathreat.tga"
1000
)
)
( when
( is-event-true-delay "fearless" 0 )
( show-subtitle
@Column2X[700]
512
" "
999999
"ebwfearless.tga"
1000
)
)
)
+Name: player rating
+Repeat Count: 1
+Interval: 1
+Chained: 1
+Team: 0
$Formula: ( when
( true )
( show-subtitle
@Column1X[200]
576
" "
999999
"ebwplayerranking.tga"
1000
)
( when
( is-event-true-delay "rookie" 0 )
( show-subtitle
@Column2X[700]
576
" "
999999
"ebwrookie.tga"
1000
)
)
( when
( is-event-true-delay "pilot" 0 )
( show-subtitle
@Column2X[700]
576
" "
999999
"ebwpilot.tga"
1000
)
)
( when
( is-event-true-delay "veteran" 0 )
( show-subtitle
@Column2X[700]
576
" "
999999
"ebwveteran.tga"
1000
)
)
( when
( is-event-true-delay
"wing commander"
0
)
( show-subtitle
@Column2X[700]
576
" "
999999
"ebwwingcommander.tga"
1000
)
)
)
+Name: player rank
+Repeat Count: 1
+Interval: 1
+Chained: 1
+Team: 0
$Formula: ( when ( true ) ( fade-out 2000 1 ) )
+Name: fade out
+Repeat Count: 1
+Interval: 1
+Chained: 15
+Team: 0
$Formula: ( when ( true ) ( end-mission ) )
+Name: end mission
+Repeat Count: 1
+Interval: 1
+Chained: 3
+Team: 0
$Formula: ( every-time
( = @NumberDrawFlag[0] 1 )
( every-time
( < @NumberValue[0] 0 )
( training-msg
"Negative Number Error"
)
( modify-variable
@NumberValue[0]
( abs @NumberValue[0] )
)
)
( modify-variable
@DigitValue[0]
( mod
( /
@NumberValue[0]
@DigitUnitValue[0]
)
10
)
)
( every-time
( = @DigitValue[0] 0 )
( show-subtitle
@NumberX[0]
@NumberY[0]
" "
@NumberDisplayTime[0]
"ebw0.tga"
1000
)
)
( every-time
( = @DigitValue[0] 1 )
( show-subtitle
@NumberX[0]
@NumberY[0]
" "
@NumberDisplayTime[0]
"ebw1.tga"
1000
)
)
( every-time
( = @DigitValue[0] 2 )
( show-subtitle
@NumberX[0]
@NumberY[0]
" "
@NumberDisplayTime[0]
"ebw2.tga"
1000
)
)
( every-time
( = @DigitValue[0] 3 )
( show-subtitle
@NumberX[0]
@NumberY[0]
" "
@NumberDisplayTime[0]
"ebw3.tga"
1000
)
)
( every-time
( = @DigitValue[0] 4 )
( show-subtitle
@NumberX[0]
@NumberY[0]
" "
@NumberDisplayTime[0]
"ebw4.tga"
1000
)
)
( every-time
( = @DigitValue[0] 5 )
( show-subtitle
@NumberX[0]
@NumberY[0]
" "
@NumberDisplayTime[0]
"ebw5.tga"
1000
)
)
( every-time
( = @DigitValue[0] 6 )
( show-subtitle
@NumberX[0]
@NumberY[0]
" "
@NumberDisplayTime[0]
"ebw6.tga"
1000
)
)
( every-time
( = @DigitValue[0] 7 )
( show-subtitle
@NumberX[0]
@NumberY[0]
" "
@NumberDisplayTime[0]
"ebw7.tga"
1000
)
)
( every-time
( = @DigitValue[0] 8 )
( show-subtitle
@NumberX[0]
@NumberY[0]
" "
@NumberDisplayTime[0]
"ebw8.tga"
1000
)
)
( every-time
( = @DigitValue[0] 9 )
( show-subtitle
@NumberX[0]
@NumberY[0]
" "
@NumberDisplayTime[0]
"ebw9.tga"
1000
)
)
( modify-variable
@NumberX[0]
( + @NumberX[0] 24 )
)
( every-time
( = @DigitUnitValue[0] 1 )
( modify-variable
@NumberDrawFlag[0]
0
)
)
( modify-variable
@DigitUnitValue[0]
( / @DigitUnitValue[0] 10 )
)
)
+Name: show number
+Repeat Count: 10000
+Interval: 5
+Team: 0
#Goals ;! 0 total
#Waypoints ;! 1 lists total
$Name: Dest
$List: ( ;! 1 points in list
( 0.000000, 0.000000, 100000.000000 )
)
#Messages ;! 1 total
$Name: Negative Number Error
$Team: -1
$MessageNew: XSTR("show number does not support negative numbers", -1)
$end_multi_text
#Reinforcements ;! 0 total
#Background bitmaps ;! 0 total
$Num stars: 500
$Ambient light level: 7895160
;;FSO 3.6.9;; $Bitmap List:
$Sun: SunWhite
+Angles: 0.000000 0.000000 1.047197
+Scale: 1.000000
#Asteroid Fields
#Music
$Event Music: None
$Briefing Music: None
#EndThe events that require the player kills etc is what i need. I also need to know how to get a percentage of completed objectives in the entire campaign for the ranking and rating (eg rookie, pilot, pussy etc.) For example if the player had completed 60% of the total objectives then the (Frearless event) would come true.
Any help in this matter would be appretiaited and credited accordingly in the Earth Brakiri War (Babylon 5 campaign).
MAG