Quantcast

Jump to content

» «
Photo

kill_actor $PLAYER_ACTOR Issue

6 replies to this topic
jakejohnsonusa
  • jakejohnsonusa

    SAPD:FR Developer

  • Members
  • Joined: 07 Aug 2012

#1

Posted 27 January 2014 - 04:45 PM Edited by jakejohnsonusa, 27 January 2014 - 04:52 PM.

Ok, so I'm working on SAPD:FR (if you know what that is) and I'm having an issue. In the following code, actor 1@ exit's the car, and then does nothing. He does not follow me, as scripted, he does not try to kill me with his gun, as scripted. He just kind of stands there, and after a bit walks away.

 

I have tried multiple methods (though I'm not a very good scripter) to fix this issue. All the 'debug code' (show_formatted_text_lowpriority)reads correctly, meaning it's reading the lines. What is wrong?

 

 

Sorry for the length, it's not that long if you read it. This is being used for GTA SA.

:TR_STOP_9775
0AD0: show_formatted_text_lowpriority "~B~AT 9747" time 1000 
0001: wait 1000 ms
03F0: enable_text_draw 0
0164: disable_marker 4@
0050: gosub @TR_STOP_11263
0001: wait 500 ms
0247: load_model #KNIFECUR
0247: load_model #TEC9
0247: load_model #SAWNOFF
0247: load_model #DESERT_EAGLE
038B: load_requested_models
0AD0: show_formatted_text_lowpriority "~B~MODELS REQUESTED" time 1000 
0001: wait 1000 ms
0002: jump @TR_STOP_9882
0051: return
 
:TR_STOP_9882
0001: wait 5 ms
00D6: if and
0248:   model #KNIFECUR available
0248:   model #TEC9 available
0248:   model #SAWNOFF available
0248:   model #DESERT_EAGLE available
004D: jump_if_false @TR_STOP_9882
0AD0: show_formatted_text_lowpriority "~B~MODELS AVAILABLE" time 1000 
0001: wait 1000 ms
0209: 3@ = random_int_in_ranges 0 10 //Variable will decide which of the four weapons to give.
0AD0: show_formatted_text_lowpriority "~B~RANDOM INT CREATED" time 1000 
0001: wait 1000 ms
07DD: set_actor 1@ attack_rate 100 // previously known as temper_to
00D6: if
0039:   3@ == 10
004D: jump_if_false @TR_STOP_10230
0AD0: show_formatted_text_lowpriority "~B~ITS 10" time 1000 
0001: wait 1000 ms
01B2: give_actor 1@ weapon 32 ammo 75 // Load the weapon model before using this
0AD0: show_formatted_text_lowpriority "~B~WEAPON GIVEN" time 1000 
0001: wait 1000 ms
01B9: set_actor 1@ armed_weapon_to 32
0AD0: show_formatted_text_lowpriority "~B~WEAPON ARMED" time 1000 
0001: wait 1000 ms
0164: disable_marker 4@
02E2: set_actor 1@ weapon_accuracy_to 85
02AB: set_actor 1@ immunities BP 0 FP 0 EP 0 CP 0 MP 0
0223: set_actor 1@ health_to 250
09B6: set_actor 1@ wanted_by_police 1
0446: set_actor 1@ immune_to_headshots 0
04D8: set_actor 1@ drowns_in_water 0
0946: set_actor 1@ actions_uninterupted_by_weapon_fire 1
060B: set_actor 1@ decision_maker_to 32  
0AD0: show_formatted_text_lowpriority "~B~DM AT 32" time 1000  
0001: wait 1000 ms
0633: AS_actor 1@ exit_car
0001: wait 3000 ms 
0433: set_actor 1@ criminal_flag 1
0687: clear_actor 1@ task
0638: AS_actor 1@ stay_put 0
0575: set_actor 1@ keep_position 0
04D7: set_actor 1@ locked 0
081A: set_actor 1@ weapon_skill_to 2 
0850: AS_actor 1@ follow_actor $PLAYER_ACTOR 
05E2: AS_actor 1@ kill_actor $PLAYER_ACTOR
0AD0: show_formatted_text_lowpriority "~B~ATTACKING" time 1000 
0001: wait 1000 ms
0002: jump @TR_STOP_10921
 
:TR_STOP_10230
0001: wait 0 ms
00D6: if or
0039:   3@ == 9
0039:   3@ == 8
0039:   3@ == 7
004D: jump_if_false @TR_STOP_10480
0AD0: show_formatted_text_lowpriority "~B~ITS 9-7" time 1000 
0001: wait 1000 ms
01B2: give_actor 1@ weapon 26 ammo 8 // Load the weapon model before using this
0AD0: show_formatted_text_lowpriority "~B~WEAPON GIVEN" time 1000 
0001: wait 1000 ms
01B9: set_actor 1@ armed_weapon_to 26
0AD0: show_formatted_text_lowpriority "~B~WEAPON ARMED" time 1000 
0001: wait 1000 ms
0164: disable_marker 4@
02E2: set_actor 1@ weapon_accuracy_to 85
02AB: set_actor 1@ immunities BP 0 FP 0 EP 0 CP 0 MP 0
0223: set_actor 1@ health_to 250
09B6: set_actor 1@ wanted_by_police 1
0446: set_actor 1@ immune_to_headshots 0
04D8: set_actor 1@ drowns_in_water 0
0946: set_actor 1@ actions_uninterupted_by_weapon_fire 1
060B: set_actor 1@ decision_maker_to 32  
0AD0: show_formatted_text_lowpriority "~B~DM AT 32" time 1000 
0001: wait 1000 ms
0633: AS_actor 1@ exit_car
0001: wait 3000 ms
0433: set_actor 1@ criminal_flag 1
0687: clear_actor 1@ task
0638: AS_actor 1@ stay_put 0
0575: set_actor 1@ keep_position 0
04D7: set_actor 1@ locked 0
081A: set_actor 1@ weapon_skill_to 2 
0850: AS_actor 1@ follow_actor $PLAYER_ACTOR
05E2: AS_actor 1@ kill_actor $PLAYER_ACTOR
0AD0: show_formatted_text_lowpriority "~B~ATTACKING" time 1000 
0001: wait 1000 ms
0002: jump @TR_STOP_10921
 
:TR_STOP_10480
0001: wait 0 ms
00D6: if or
0039:   3@ == 6
0039:   3@ == 5
0039:   3@ == 4
004D: jump_if_false @TR_STOP_10730
0AD0: show_formatted_text_lowpriority "~B~ITS 6-4" time 1000 
0001: wait 1000 ms
01B2: give_actor 1@ weapon 24 ammo 25 // Load the weapon model before using this
0AD0: show_formatted_text_lowpriority "~B~WEAPON GIVEN" time 1000 
0001: wait 1000 ms
01B9: set_actor 1@ armed_weapon_to 24
0AD0: show_formatted_text_lowpriority "~B~WEAPON ARMED" time 1000 
0001: wait 1000 ms
0164: disable_marker 4@
02E2: set_actor 1@ weapon_accuracy_to 85
02AB: set_actor 1@ immunities BP 0 FP 0 EP 0 CP 0 MP 0
0223: set_actor 1@ health_to 250
09B6: set_actor 1@ wanted_by_police 1
0446: set_actor 1@ immune_to_headshots 0
04D8: set_actor 1@ drowns_in_water 0
0946: set_actor 1@ actions_uninterupted_by_weapon_fire 1
060B: set_actor 1@ decision_maker_to 32  
0AD0: show_formatted_text_lowpriority "~B~DM AT 32" time 1000
0001: wait 1000 ms
0633: AS_actor 1@ exit_car
0001: wait 3000 ms
0433: set_actor 1@ criminal_flag 1
0687: clear_actor 1@ task
0638: AS_actor 1@ stay_put 0
0575: set_actor 1@ keep_position 0
04D7: set_actor 1@ locked 0
081A: set_actor 1@ weapon_skill_to 2  
0850: AS_actor 1@ follow_actor $PLAYER_ACTOR
05E2: AS_actor 1@ kill_actor $PLAYER_ACTOR
0AD0: show_formatted_text_lowpriority "~B~ATTACKING" time 1000 
0001: wait 1000 ms
0002: jump @TR_STOP_10921
 
:TR_STOP_10730
0001: wait 0 ms
0AD0: show_formatted_text_lowpriority "~B~ITS ELSE" time 1000 
0001: wait 1000 ms
01B2: give_actor 1@ weapon 4 ammo 1 // Load the weapon model before using this
01B9: set_actor 1@ armed_weapon_to 4
0AD0: show_formatted_text_lowpriority "~B~WEAPON ARMED" time 1000 
0001: wait 1000 ms
0164: disable_marker 4@
02E2: set_actor 1@ weapon_accuracy_to 85
02AB: set_actor 1@ immunities BP 0 FP 0 EP 0 CP 0 MP 0
0223: set_actor 1@ health_to 250
09B6: set_actor 1@ wanted_by_police 1
0446: set_actor 1@ immune_to_headshots 0
04D8: set_actor 1@ drowns_in_water 0
0946: set_actor 1@ actions_uninterupted_by_weapon_fire 1
060B: set_actor 1@ decision_maker_to 32  
0AD0: show_formatted_text_lowpriority "~B~DM AT 32" time 1000
0001: wait 1000 ms
0633: AS_actor 1@ exit_car
0001: wait 3000 ms
0433: set_actor 1@ criminal_flag 1
0687: clear_actor 1@ task
0638: AS_actor 1@ stay_put 0
0575: set_actor 1@ keep_position 0
04D7: set_actor 1@ locked 0
081A: set_actor 1@ weapon_skill_to 2
0850: AS_actor 1@ follow_actor $PLAYER_ACTOR
05E2: AS_actor 1@ kill_actor $PLAYER_ACTOR
0AD0: show_formatted_text_lowpriority "~B~ATTACKING" time 1000 
0001: wait 1000 ms
0002: jump @TR_STOP_10921
 
:TR_STOP_10921
0001: wait 0 ms
00D6: if or
0118:   actor 1@ dead
0118:   actor $PLAYER_ACTOR dead
02D8:   actor 1@ current_weapon == 0
80F3:   not actor 1@ near_actor $PLAYER_ACTOR radius 20.0 20.0 sphere 0 on_foot
004D: jump_if_false @TR_STOP_10921
00D6: if or
80F4:   not actor 1@ near_actor $PLAYER_ACTOR radius 20.0 20.0 0 in_car
0118:   actor 1@ dead
0118:   actor $PLAYER_ACTOR dead
02D8:   actor 1@ current_weapon == 0
004D: jump_if_false @TR_STOP_10921
0249: release_model #TEC9
0249: release_model #SAWNOFF
0249: release_model #DESERT_EAGLE
0249: release_model #KNIFECUR
0519: set_car 0@ locked 0
0574: set_car 0@ keep_position 0
020A: set_car 0@ door_status_to 1
02AC: set_car 0@ immunities BP 0 FP 0 EP 0 CP 0 MP 0
02AB: set_actor 1@ immunities BP 0 FP 0 EP 0 CP 0 MP 0
0AAE: release_mp3 18@
0AAE: release_mp3 19@
0AAE: release_mp3 20@
0050: gosub @TR_STOP_11148
01C3: remove_references_to_car 0@
01C2: remove_references_to_actor 1@ // Like turning an actor into a random pedestrian
0AD0: show_formatted_text_lowpriority "~B~DONE" time 1000 
0002: jump @TR_STOP_11509
0051: return

Maro Hannover
  • Maro Hannover

    Scriptboy

  • BUSTED!
  • Joined: 06 Jan 2014
  • None

#2

Posted 27 January 2014 - 05:07 PM

How you make the text in The White Box?


ZAZ
  • ZAZ

    Kernlochbohrer

  • Members
  • Joined: 10 Jan 2005
  • European-Union

#3

Posted 27 January 2014 - 06:50 PM

In the following code, actor 1@ exit's the car, and then does nothing. He does not follow me, as scripted, he does not try to kill me with his gun, as scripted. He just kind of stands there, and after a bit walks away.

 

does this message appear imediatly after exit car?
 

0AD0: show_formatted_text_lowpriority "~B~DONE" time 1000

remove these lines:

02D8:   actor 1@ current_weapon == 0
80F3:   not actor 1@ near_actor $PLAYER_ACTOR radius 20.0 20.0 sphere 0 on_foot

and test again

:TR_STOP_10921
0001: wait 0 ms
00D6: if or
0118:   actor 1@ dead
0118:   actor $PLAYER_ACTOR dead
//02D8:   actor 1@ current_weapon == 0                                                   <--remove
//80F3:   not actor 1@ near_actor $PLAYER_ACTOR radius 20.0 20.0 sphere 0 on_foot        <--remove
004D: jump_if_false @TR_STOP_10921
00D6: if or
80F4:   not actor 1@ near_actor $PLAYER_ACTOR radius 20.0 20.0 0 in_car
0118:   actor 1@ dead
0118:   actor $PLAYER_ACTOR dead
//02D8:   actor 1@ current_weapon == 0                                                   <--remove
004D: jump_if_false @TR_STOP_10921

and this is sh*t:

0850: AS_actor 1@ follow_actor $PLAYER_ACTOR
05E2: AS_actor 1@ kill_actor $PLAYER_ACTOR

either follow or kill

 

 

 

 


Shmoopy
  • Shmoopy

    Thug (͡ ͜ʖ ͡)

  • Members
  • Joined: 16 Jun 2009
  • None

#4

Posted 27 January 2014 - 07:02 PM Edited by Manfred Von Karma, 27 January 2014 - 07:03 PM.

The script shouldn't be that long cz you can actually pack it in one paragraph ,the random digit between 0 and 10 that you used to decide witch weapon to  use should not be repeated 10 times

0209: 3@ = random_int_in_ranges 0 10 //Variable will decide which of the four weapons to give.

 
Here i'll show you what i mean :
 
 

0209: 3@ = random_int_in_ranges 0 10 //Variable will decide which of the four weapons to give.
if
   3@ == 10
then
0AD0: show_formatted_text_lowpriority "~B~ITS 10" time 1000 
0001: wait 1000 ms
01B2: give_actor 1@ weapon 32 ammo 75 // Load the weapon model before using this
else if and
  3@ >= 7
  3@ <= 9
then
0AD0: show_formatted_text_lowpriority "~B~ITS 7-9" time 1000 
0001: wait 1000 ms
01B2: give_actor 1@ weapon 26 ammo 75 // Load the weapon model before using this
else if and
  3@ >= 4
  3@ <= 6
then
0AD0: show_formatted_text_lowpriority "~B~ITS 4-6" time 1000 
0001: wait 1000 ms
01B2: give_actor 1@ weapon 24 ammo 75 // Load the weapon model before using this
else
0AD0: show_formatted_text_lowpriority "~B~ITS ELSE" time 1000 
0001: wait 1000 ms
01B2: give_actor 1@ weapon 4 ammo 1 // Load the weapon model before using this
end
end
end

By doing this you'll reduce 80% of used lines


jakejohnsonusa
  • jakejohnsonusa

    SAPD:FR Developer

  • Members
  • Joined: 07 Aug 2012

#5

Posted 27 January 2014 - 07:11 PM Edited by jakejohnsonusa, 27 January 2014 - 07:28 PM.

@ZAZ I tried what you said, but no luck, they still wont kill me. 

 

This:

0AD0: show_formatted_text_lowpriority "~B~DONE" time 1000

Does appear when I kill the person. I've also noticed that when I attack them, they just stand there or take cover. They never attempt to attack in self-defense (as they sometimes do in-game).

 

 

@Manfred Von Karma Thanks for bring that to my attention, I am still fairly new to this. I will edit the code and post the new code shortly.

 

 

UPDATED CODE:

:TR_STOP_9775
0AD0: show_formatted_text_lowpriority "~B~AT 9747" time 1000 
0001: wait 1000 ms
03F0: enable_text_draw 0
0164: disable_marker 4@
0050: gosub @TR_STOP_11555
0001: wait 500 ms
0247: load_model #KNIFECUR
0247: load_model #TEC9
0247: load_model #SAWNOFF
0247: load_model #DESERT_EAGLE
038B: load_requested_models
0AD0: show_formatted_text_lowpriority "~B~MODELS REQUESTED" time 1000 
0001: wait 1000 ms
0002: jump @TR_STOP_9882
0051: return

:TR_STOP_9882
0001: wait 5 ms
00D6: if and
0248:   model #KNIFECUR available
0248:   model #TEC9 available
0248:   model #SAWNOFF available
0248:   model #DESERT_EAGLE available
004D: jump_if_false @TR_STOP_9882
0AD0: show_formatted_text_lowpriority "~B~MODELS AVAILABLE" time 1000 
0001: wait 1000 ms
0209: 3@ = random_int_in_ranges 0 10
0AD0: show_formatted_text_lowpriority "~B~RANDOM INT CREATED" time 1000 
0001: wait 1000 ms
07DD: set_actor 1@ attack_rate 100 // previously known as temper_to
00D6: if
0039:   3@ == 10
then
0AD0: show_formatted_text_lowpriority "~B~ITS 10" time 1000 
0001: wait 1000 ms
01B2: give_actor 1@ weapon 32 ammo 75 // Load the weapon model before using this
0AD0: show_formatted_text_lowpriority "~B~WEAPON GIVEN" time 1000 
0001: wait 1000 ms
01B9: set_actor 1@ armed_weapon_to 32
0AD0: show_formatted_text_lowpriority "~B~WEAPON ARMED" time 1000 
0001: wait 1000 ms
else if or
0039:   3@ == 9
0039:   3@ == 8
0039:   3@ == 7
then
0AD0: show_formatted_text_lowpriority "~B~ITS 9-7" time 1000 
0001: wait 1000 ms
01B2: give_actor 1@ weapon 26 ammo 8 // Load the weapon model before using this
0AD0: show_formatted_text_lowpriority "~B~WEAPON GIVEN" time 1000 
0001: wait 1000 ms
01B9: set_actor 1@ armed_weapon_to 26
0AD0: show_formatted_text_lowpriority "~B~WEAPON ARMED" time 1000 
0001: wait 1000 ms
else if or
0039:   3@ == 6
0039:   3@ == 5
0039:   3@ == 4
then 0AD0: show_formatted_text_lowpriority "~B~ITS 6-4" time 1000 
0001: wait 1000 ms
01B2: give_actor 1@ weapon 24 ammo 25 // Load the weapon model before using this
0AD0: show_formatted_text_lowpriority "~B~WEAPON GIVEN" time 1000 
0001: wait 1000 ms
01B9: set_actor 1@ armed_weapon_to 24
0AD0: show_formatted_text_lowpriority "~B~WEAPON ARMED" time 1000 
0001: wait 1000 ms
else
0AD0: show_formatted_text_lowpriority "~B~ITS ELSE" time 1000 
0001: wait 1000 ms
01B2: give_actor 1@ weapon 4 ammo 1 // Load the weapon model before using this
01B9: set_actor 1@ armed_weapon_to 4
0AD0: show_formatted_text_lowpriority "~B~WEAPON ARMED" time 1000 
0001: wait 1000 ms
end
end
end
0164: disable_marker 4@
02E2: set_actor 1@ weapon_accuracy_to 85
02AB: set_actor 1@ immunities BP 0 FP 0 EP 0 CP 0 MP 0
0223: set_actor 1@ health_to 250
09B6: set_actor 1@ wanted_by_police 1
0446: set_actor 1@ dismemberment_possible 0
04D8: set_actor 1@ drowns_in_water 0
0946: set_actor 1@ actions_uninterupted_by_weapon_fire 1
060B: set_actor 1@ decision_maker_to 32
0AD0: show_formatted_text_lowpriority "~B~DM AT 32" time 1000 
0001: wait 1000 ms
0633: AS_actor 1@ exit_car
0001: wait 3000 ms
0433: set_actor 1@ criminal_flag 1
0687: clear_actor 1@ task
0638: AS_actor 1@ stay_put 0
0575: set_actor 1@ keep_position 0
04D7: set_actor 1@ locked 0
081A: set_actor 1@ weapon_skill_to 2 
05E2: AS_actor 1@ kill_actor $PLAYER_ACTOR
0AD0: show_formatted_text_lowpriority "~B~ATTACKING" time 1000 
0001: wait 1000 ms
0002: jump @TR_STOP_11213
0051: return

:TR_STOP_11213
0001: wait 0 ms
00D6: if or
0118:   actor 1@ dead
0118:   actor $PLAYER_ACTOR dead
//02D8:   actor 1@ current_weapon == 0
//80F3:   not actor 1@ near_actor $PLAYER_ACTOR radius 20.0 20.0 sphere 0 on_foot
004D: jump_if_false @TR_STOP_11213
00D6: if or
80F4:   not actor 1@ near_actor $PLAYER_ACTOR radius 20.0 20.0 0 in_car
0118:   actor 1@ dead
0118:   actor $PLAYER_ACTOR dead
//02D8:   actor 1@ current_weapon == 0
004D: jump_if_false @TR_STOP_11213
0249: release_model #TEC9
0249: release_model #SAWNOFF
0249: release_model #DESERT_EAGLE
0249: release_model #KNIFECUR
0519: set_car 0@ locked 0
0574: set_car 0@ keep_position 0
020A: set_car 0@ door_status_to 1
02AC: set_car 0@ immunities BP 0 FP 0 EP 0 CP 0 MP 0
02AB: set_actor 1@ immunities BP 0 FP 0 EP 0 CP 0 MP 0
0AAE: release_mp3 18@
0AAE: release_mp3 19@
0AAE: release_mp3 20@
0050: gosub @TR_STOP_11440
01C3: remove_references_to_car 0@
01C2: remove_references_to_actor 1@ // Like turning an actor into a random pedestrian
0AD0: show_formatted_text_lowpriority "~B~DONE" time 1000 
0002: jump @TR_STOP_11801
0051: return

ZAZ
  • ZAZ

    Kernlochbohrer

  • Members
  • Joined: 10 Jan 2005
  • European-Union

#6

Posted 29 January 2014 - 07:11 PM Edited by ZAZ, 29 January 2014 - 07:13 PM.

remove codes and test again
replace this block:

0164: disable_marker 4@
02E2: set_actor 1@ weapon_accuracy_to 85
02AB: set_actor 1@ immunities BP 0 FP 0 EP 0 CP 0 MP 0
0223: set_actor 1@ health_to 250
09B6: set_actor 1@ wanted_by_police 1
0446: set_actor 1@ dismemberment_possible 0
04D8: set_actor 1@ drowns_in_water 0
0946: set_actor 1@ actions_uninterupted_by_weapon_fire 1
060B: set_actor 1@ decision_maker_to 32
0AD0: show_formatted_text_lowpriority "~B~DM AT 32" time 1000 
0001: wait 1000 ms
0633: AS_actor 1@ exit_car
0001: wait 3000 ms
0433: set_actor 1@ criminal_flag 1
0687: clear_actor 1@ task
0638: AS_actor 1@ stay_put 0
0575: set_actor 1@ keep_position 0
04D7: set_actor 1@ locked 0
081A: set_actor 1@ weapon_skill_to 2 
05E2: AS_actor 1@ kill_actor $PLAYER_ACTOR
0AD0: show_formatted_text_lowpriority "~B~ATTACKING" time 1000 
0001: wait 1000 ms

with this:

0164: disable_marker 4@
0AD0: show_formatted_text_lowpriority "~B~DM AT 32" time 1000 
0001: wait 1000 ms
04D7: set_actor 1@ locked 0
0633: AS_actor 1@ exit_car
0001: wait 3000 ms 
05E2: AS_actor 1@ kill_actor $PLAYER_ACTOR
0AD0: show_formatted_text_lowpriority "~B~ATTACKING" time 1000 
0001: wait 1000 ms

if it doesn't help, then you need to post the whole script
post it at pastebin if it's very big


jakejohnsonusa
  • jakejohnsonusa

    SAPD:FR Developer

  • Members
  • Joined: 07 Aug 2012

#7

Posted 01 February 2014 - 04:14 PM

Sorry for the delay, I tried what you suggested, and it still doesn't want to work.

 

Here is the entire script: http://pastebin.com/EhFwQeY3

 

Thanks for helping so far. Let me know what you see.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users