Advertisement
Guest User

A stalker for DutyStalker666

a guest
Jul 7th, 2012
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.65 KB | None | 0 0
  1.  
  2. ;Thread located in: 'http://www.gsc-game.com/main.php?t=community&s=forums&s_game_type=xr&thm_page=1&thm_id=21607&page=2&sort=ASC&sec_id=16#362081'
  3.  
  4. ;Created by 'Insanelazarez' in July, 7, 2012
  5.  
  6. ;NPC for DutyStalker666 [GSC - Forum] - [quick fix, not tested]
  7.  
  8. ; Please read EVERYTHING IN THIS FILE, ok?
  9.  
  10. ;You might consider a new position close of the fox position.
  11.  
  12. ;Use '_g.script' fix. Open it ... line 20... comment the line 20 ONLY, this way '-- log(string.format(fmt,...))'
  13.  
  14. ;Trust me you need that fix, cause you are working with the AI. IF you dont change it... YOU WILL DESPERATE.
  15.  
  16. ;Let's tell the game he shall NOT use the loadout form his profile (assuming he spawns by script ONLY)
  17.  
  18. [dont_spawn_character_supplies]
  19.  
  20. ;Done. So he has no loadout, right? But now you can customize his loadout (AGAIN... assuming he spawns by script ONLY)
  21.  
  22. [spawn]
  23. wpn_pb
  24. ammo_9x18_fmj = 7
  25. wpn_vintorez;LOL
  26. ammo_9x39_pab9 = 7
  27. medkit_scientic = 3
  28. medkit_army = 3
  29. medkit = 3
  30. device_torch
  31. grenade_f1 = 2
  32. guitar_a;;;;;later he might use it in the 'Kamp' Module.
  33. ;add other items to use in 'kamp' mode later if you want.
  34.  
  35. ;The next is just sad. Pretty soon the game is going to call him for some smart terrain, no matter what. Remmeber at this point i assume you killed the carpark bandits, right? Therefore the number of kamps increases.
  36.  
  37. ;Sooner or later that is going to happen. In special because you are spawning by script.
  38.  
  39. [smart_terrains]
  40. none = true
  41.  
  42. ;Logic 'introduction module' start here:
  43.  
  44. [logic]
  45. active = camper@start
  46. meet = meet
  47. combat_ignore = if_this_section_is_present_it_means_you_can_customize_it
  48. on_death = this_is_what_happens_when_he_dies;;this section is present in the end of this file. Keep it.
  49.  
  50. [if_this_section_is_present_it_means_you_can_customize_it]
  51. ;THIS IS USED THIS WAY... LITERALLY.
  52. ;WHEN I SAY 'CUSTOMIZE'... I MEAN IN THE NEXT MODULES YOU CAN CALL IT WITH THE CODE: 'combat_ignore_cond ='
  53.  
  54. ;In your code the walk/look paths's names were wrong:
  55.  
  56. [camper@start]
  57. wounded = wounded@test
  58. path_walk = esc_stalker_camp_esc_wounded_fox_walk;THIS IS CORRECT NOW... use it.
  59. path_look = esc_stalker_camp_esc_wounded_fox_look;DO THE SAME HERE... just use it.
  60. def_state_moving = walk
  61. def_state_standing = guard;This anim is called by the look path itself... KEEP IT.
  62. def_state_campering_fire = threat
  63. combat_ignore_cond = {=fighting_actor =fighting_dist_ge(25)};Aha... see? Now we can use this.
  64. danger = this_is_his_danger_section
  65. meet = no_meet
  66. on_info = {+escape_fox_heal} remark@if_fox_is_ok
  67. on_info2 = {+esc_dogs_return} remark@if_fox_is_dead;IF fox dies... 'esc_dogs_return' is the correct info.
  68.  
  69. ;So, in this case fox is alive right? So the new guy is happy.
  70.  
  71. ;The next two modules are 'remarks'... Therefore its an 'All Purpose Combat Scheme'. It might be hard to control the new guy... regarding the 'distance to dangers' thing.
  72.  
  73. ;But let's try that way...
  74.  
  75. [remark@if_fox_is_ok]
  76. wounded = wounded@test
  77. no_move = true
  78. anim = press;USE this one... it's very cool
  79. target = actor;OR you can replace it by fox id number... '5'. So use 'actor' OR '5'
  80. snd = story_reac_laughter;That's a 'HAPPY SOUND' kinda...
  81. combat_ignore_cond = {=fighting_actor =fighting_dist_ge(25)};See? now we can use it again.
  82. danger = this_is_his_danger_section
  83. meet = no_meet
  84. on_signal = sound_end | kamp@last_code
  85. on_info = {+esc_dogs_return} remark@if_fox_is_dead; Because fox might die, when 'happy sound' is still playing, right?
  86.  
  87. ;BUt in this case fox is dead... He needs a 'New' sound...
  88.  
  89. [remark@if_fox_is_dead]
  90. wounded = wounded@test
  91. no_move = true
  92. anim = sit_knee
  93. target = 5; in this case he looks to dead fox
  94. snd = val_escort_dead;;'Bullet' duty sound in darkvalley when the other duty guy dies.
  95. combat_ignore_cond = {=fighting_actor =fighting_dist_ge(25)};AGAIN see?
  96. danger = this_is_his_danger_section
  97. meet = no_meet
  98. on_signal = sound_end | kamp@last_code
  99.  
  100. ;The two 'All Purpose Combat Schemes' are over.
  101.  
  102. ;NOW he must start the final scheme, similar to fox himself. Make sure he has a guitar, right?
  103.  
  104. ;The meet state is enabled, but he might not use it at all.
  105.  
  106. [kamp@last_code]
  107. center_point = esc_stalker_camp_esc_fox_kamp;USE THIS PLEASE
  108. path_walk = esc_stalker_camp_esc_fox_kamp_task;AND THIS
  109. combat_ignore_cond = {=fighting_actor =fighting_dist_ge(25)};AGAIN see?
  110. danger = this_is_his_danger_section
  111. meet = meet;;;IF possible... you might 'use' him, eventually. Depending of the Kamp scheme itself.
  112.  
  113. ;This section is very effective in special when he is using 'camper' modules. Like the one used in 'camper@start'
  114.  
  115. ;However... The 'guard' animation is strange, but it's the one called by the look path itself. Don't be surprised if he behaves like an asshole. Lol.
  116.  
  117. [this_is_his_danger_section]
  118. ignore_distance = 25
  119. ignore_types = grenade, hit, corpse, sound
  120. ignore_distance_grenade = 5
  121. ignore_distance_corpse = 0.19;Don't worry... this value is ok for distance corpse
  122. ignore_distance_hit = 150
  123. ignore_distance_sound = 50
  124. danger_inertion_time_grenade = 2000
  125. danger_inertion_time_corpse = 190
  126. danger_inertion_time_hit = 2000
  127. danger_inertion_time_sound = 1500
  128. danger_inertion_time_ricochet = 1000
  129.  
  130.  
  131. [wounded@test]
  132. hp_state = 30|help_me@help|10|wounded_heavy@help_heavy
  133. hp_state_see = 30|wounded@help_see|10|wounded_heavy@help_heavy
  134. psy_state = 50|{=best_pistol}psy_armed,psy_pain@wounded_psy|20| {=best_pistol}psy_shoot,psy_pain@{=best_pistol}wounded_psy_shoot,wounded_psy
  135. hp_victim = 30|actor|10|nil
  136. hp_cover = 30|true|10|false
  137. hp_fight = 30|true|10|false
  138. syndata = wounded@help
  139.  
  140. ;OMG, he died. So... the game plays this sound: 'One is down. This is number two... assuming command'. LOL...
  141.  
  142. ;In short the sound is playing by the game engine.
  143.  
  144. [this_is_what_happens_when_he_dies]
  145. on_info = %=play_snd(characters_voice\scenario\military\dolg_attack\base\mil_dolg_down_3)%
  146.  
  147. ;The logic file ends here.
  148.  
  149. ;IMPORTANT:
  150.  
  151. ;1 - DutyStalker666, you might consider spawning him close of the fox position.
  152.  
  153. ;2 - Fox has a space restrictor for sure, and if the restrictor is type '2'... The new guy crashes the game when he penetrates the space.
  154. ;If the restrictor is type '0' or '3', well if that's the case... it's ok.
  155.  
  156. ;3 - I suppose you are creating the new guy, with wolf's dialog... or maybe the 'SIDOROVICH trader' Dialog.
  157. ;Ok, how can i explain this... Spawning the guy with such dialogs is a nice trick... IF we want the guy close of Wolf/or trader positions.
  158. ;BUT in this case, the guy is in a 'OFF-LINE' Position. The distance between him and you is bigger than 150 metters. It more like 900 metters. Maybe more.
  159. ;In short, by script he ALWAYS SPAWNS IN A DIFFERENT POSITION. That is not going to change.
  160. ;So don't be surprised, if sometimes the game crashes. IN SPECIAL IN A LOW-END PC.
  161.  
  162. ;4 - If you still want to create him by script, i recommend a function called LATER. Like the one used by the 'trader tip' when you receive the task 'MEET FOX'.
  163. ;This might help us better, because when the player receives this task... the distance is smaller, see?
  164.  
  165. ;5 - BUT DutyStalker666, You should consider to spawn him via all.spawn.
  166. ;Cause via script, you are going to have problems. Sorry.
  167.  
  168. ;6 - The code was NOT TESTED. And it was written by memory (except the 'wounded' section) ... so it might contain some error.
  169.  
  170. ;7 - The Code itself was created like in 5 minutes. BUT the commented sections... wow... it was like 90 minutes or something. English is not my language. I'm portuguese, see?
  171.  
  172. ;8 - Well, DutyStalker666. Have fun, and tell me something later in the 'GSC-Forum', ok?
  173.  
  174. ;9 - These Commented sections just killed me... lol.
  175.  
  176. ;10 - That's it... I'm out.
  177.  
  178.  
  179. Insanelazarez,
  180.  
  181. Lisbon July, 7, 2012
  182. Lisboa 7 de Julho, 2012
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement