When creating a ped can you have him do fighting animations while he already has a gun?
Search
Latest topics
Affiliates













----- Русский -----
Если ваш сайт содержит большую коллекцию SCM/CLEO-скриптов (больше 16), напишите на мой e-mail
----- English -----
If your website has a big enough collection of SCM/CLEO scripts (more than 16) notify me by e-mail
Log in
February 2019
YouTube page
gtasbigfoot's YouTube page
Other modders YouTube pages:
James227uk YouTube page
Ryosuke's YouTube page
ZAZ's YouTube page
Other modders YouTube pages:
James227uk YouTube page
Ryosuke's YouTube page
ZAZ's YouTube page
Mission Question
Go to page : 1, 2, 3, 4
2
Re: Mission Question on Tue Jul 07, 2009 7:35 am
You mean like Kung-Fu moves, etc? Yes, it's possible, for some animations. Just write a test script:
- Code:
{$CLEO}
0000:
var
$PLAYER_CHAR : Player
end
while true
wait 250
if
$PLAYER_CHAR.Defined
then
if
00E1: player 0 pressed_key 10 // N (Latin)
then
break
end
end
end
#BIKDRUG.Load
#AK47.Load
04ED: load_animation "FIGHT_C"
038B: load_requested_models
while true
if and
#BIKDRUG.Available
#AK47.Available
04EE: animation "FIGHT_C" loaded
then
break
end
wait 0
end
04C4: store_coords_to 1@ 2@ 3@ from_actor $PLAYER_ACTOR with_offset 1.0 3.0 1.0
009A: 0@ = create_actor_pedtype 4 model #BIKDRUG at 1@ 2@ 3@
0223: set_actor 0@ health_to 500
01B2: give_actor 0@ weapon 30 ammo 0xFFFFFFF // Load the weapon model before using this
if
not Actor.Dead(0@)
then
0605: actor 0@ perform_animation_sequence "FIGHTC_M" IFP_file "FIGHT_C" 4.0 loop 0 1 1 0 time -1 // versionA
end
while 0611: actor 0@ performing_animation "FIGHTC_M"
wait 0
end
wait 500
0605: actor 0@ perform_animation_sequence "FIGHTC_G" IFP_file "FIGHT_C" 4.0 loop 0 1 1 0 time -1 // versionA
while 0611: actor 0@ performing_animation "FIGHTC_G"
wait 0
end
wait 2000
#BIKDRUG.Destroy
#AK47.Destroy
04EF: release_animation "FIGHT_C"
01C2: remove_references_to_actor 0@ // Like turning an actor into a random pedestrian
0a93: enc_custom_thread
3
Re: Mission Question on Tue Jul 07, 2009 9:29 am
thx big. but could u show me how to have the actor shoot the weapon, then runs up and does a Kung-Fu move?
4
Re: Mission Question on Tue Jul 07, 2009 10:08 am
Sure, play around with the range and co-ordinates, and stuff how you want.

- Code:
{$CLEO}
0000:
var
$PLAYER_CHAR : Player
end
while true
wait 250
if
$PLAYER_CHAR.Defined
then
if
00E1: player 0 pressed_key 10 // N (Latin)
then
break
end
end
end
#BIKDRUG.Load
#AK47.Load
04ED: load_animation "FIGHT_C"
038B: load_requested_models
while true
if and
#BIKDRUG.Available
#AK47.Available
04EE: animation "FIGHT_C" loaded
then
break
end
wait 0
end
04C4: store_coords_to 1@ 2@ 3@ from_actor $PLAYER_ACTOR with_offset 1.0 8.0 1.0
009A: 0@ = create_actor_pedtype 4 model #BIKDRUG at 1@ 2@ 3@
0223: set_actor 0@ health_to 500
01B2: give_actor 0@ weapon 30 ammo 0xFFFFFFF // Load the weapon model before using this
04C4: store_coords_to 1@ 2@ 3@ from_actor $PLAYER_ACTOR with_offset 0.0 0.0 0.0
0668: AS_actor 0@ rotate_and_shoot_at 1@ 2@ 3@ 3000 ms
33@ = 0
repeat
wait 0
until 33@ > 3100
if
not Actor.Dead(0@)
then
0605: actor 0@ perform_animation_sequence "FIGHTC_IDLE" IFP_file "FIGHT_C" 4.0 loop 1 0 0 0 time -1 // versionA
end
33@ = 0
while true
if
33@ > 2300
then
break
end
wait 0
end
05D9: AS_actor 0@ run_to_actor $PLAYER_ACTOR timelimit 0xFFFFFFFE stop_within_radius 2.0
repeat
wait 0
until 0104: actor $PLAYER_ACTOR near_actor 0@ radius 1.58659369 2.0 2.0 sphere 0
if and
not Actor.Dead(0@)
not Actor.Dead($PLAYER_ACTOR)
then
0605: actor 0@ perform_animation_sequence "FIGHTC_M" IFP_file "FIGHT_C" 4.0 loop 0 1 1 0 time -1 // versionA
05BB: AS_actor $PLAYER_ACTOR fall_down 0 time_on_ground 1500
0851: set_actor $PLAYER_ACTOR decrease_health_by 10 flag 1
gosub @ReadMem
000E: 4@ -= @Message1
gosub @BlackBox
end
while 0611: actor 0@ performing_animation "FIGHTC_M"
wait 0
end
wait 2000
gosub @ReadMem
000E: 4@ -= @Message2
gosub @BlackBox
33@ = 0
#BIKDRUG.Destroy
#AK47.Destroy
04EF: release_animation "FIGHT_C"
01C2: remove_references_to_actor 0@ // Like turning an actor into a random pedestrian
0a93: end_custom_thread
:ReadMem
0A9F: 4@ = current_thread_pointer
4@ += 0x10
0A8D: 4@ = read_memory 4@ size 4 virtual_protect 0
return
:BlackBox
if
0AA9: is_game_version_original
then
0AA5: call 0x588BE0 num_params 4 pop 4 0 0 0 4@
else
0AA5: call 0x5893B0 num_params 4 pop 4 0 0 0 4@
end
return // Set SB 'Case Converting' to 'As is'
:Message1
hex
"~r~ You_got_owned!" 00
end
:Message2
hex
"~s~ Test_script_ended." 00
end
5
Re: Mission Question on Tue Jul 07, 2009 10:52 am
thx again! I'd say the 0xFFFFFFF, and 0xFFFFFFFE are memory addresses right? Either way could you shed some light on those?
6
Re: Mission Question on Tue Jul 07, 2009 11:06 am
0xFFFFFFF - hexadecimal value use Sanny Builder hexadecimal convert feature.
0xFFFFFFFE - hexadecimal ID of -2,
0xFFFFFFFF = -1
0xFFFFFFFE = -2
0xFFFFFFFD = -3
0xFFFFFFFC = -4
0xFFFFFFFB = -5
0xFFFFFFFA = -6
0xFFFFFFF9 = -7
etc ...
7
Re: Mission Question on Tue Jul 07, 2009 11:09 am
thx, again
edit whats the ~r~ and ~s~ do? Something with the text I presume?
edit whats the ~r~ and ~s~ do? Something with the text I presume?
8
Re: Mission Question on Wed Jul 08, 2009 9:54 am
edit whats the ~r~ and ~s~ do? Something with the text I presume?
Colour setting, just like in GXT/FXT file.
To set a special color use the ~?~ before
you write the text. Use ~s~ to restore the
text to normal.
- Code:
~r~ - Red
~s~ - Set normal
~g~ - Green
~b~ - Blue
~p~ - Purple
~y~ - Yellow
~w~ - White
etc.
Look there
Orginal post - in Russian language.

9
Re: Mission Question on Thu Jul 09, 2009 6:33 am
Okay your help's appreciated I guess its just that I'm not one to sit and read long things of text. Guess I should start huh? Any way would mind sheding some light on this:
- Code:
:BlackBox
if
0AA9: is_game_version_original
then
0AA5: call 0x588BE0 num_params 4 pop 4 0 0 0 4@
else
0AA5: call 0x5893B0 num_params 4 pop 4 0 0 0 4@
end
return // Set SB 'Case Converting' to 'As is'
:Message1
hex
"~r~ You_got_owned!" 00
end
:Message2
hex
"~s~ Test_script_ended." 00
end
10
Re: Mission Question on Thu Jul 09, 2009 7:55 am
Sure, don't ask - ANY questions are welcome

First, it checks the game version, if the game version is the original version (v1.0 US) then it will call the textbox which is at address 0x588BE0 in game version v1.0, otherwise false, and it will call the textbox for game version v1.01 which is at 0x5893B0 then the code return's where it last gosubed.
I tell you in the comment, that you should set Sanny Builder Options -> 'Case Coverting' to 'As is' so the text will not be displayed in UPPER-CASE letters, but how the user writes it.
This is just one way of displaying text via script, I know many, many ways, some which I posted in the SA Memory Topic & some on some Russian forums.
In this one the text data is stored using Sanny Builder's hex..end feature, to mark a space ( ) using this format use '_' as spaces do not get read by the script, the '00' (digits) at the end are needed, so when displaying the text the hex..end its self will not get displayed.
When you decompile the script it will be in its hexadecimal-format,
this:
- Code:
hex
"~r~ You_got_owned!" 00
end
will be:
- Code:
hex
7E 72 7E 59 6F 75 5F 67 6F 74 5F 6F 77 6E 65 64
21 00
end
Read about the CLEO opcodes » there » or in Sanny Builder -> Help -> CLEO 3 opcodes.
--
I should say, if CLEO is not installed, and you want to script in main.scm, and do the same thing, you may check the game version using:
- Code:
0@ = -429566
if
&0(0@,1i) == 4611680
then
....
else
....
end
And use a ASM injector to display the text ...
--
Peace.

11
Re: Mission Question on Thu Jul 09, 2009 9:12 am
Wow thats way easer. But now I have a camera related question do you know how to get the camera coords? Because I want the camera in a certain spot like over cj's head for a mission like in the bigfoot mission.
12
Re: Mission Question on Thu Jul 09, 2009 9:32 am
In Bigfoot missions, we (or Lord_Ice) just set that camera postion that we want (like over CJ's head) using:
- Code:
015F: set_camera_position 664.9277 -479.6112 16.1668 rotation 0.0 0.0 0.0
0160: set_camera_point_at 665.8948 -479.5685 16.4175 mode 2
In Bigfoot mission we never got the postion, but if you want, then use the opcodes:
- Code:
068D: get_camera_position_to $TEMPVAR_FLOAT_1 $TEMPVAR_FLOAT_2 $TEMPVAR_FLOAT_3
068E: get_camera_target_point_to $TEMPVAR_FLOAT_1 $TEMPVAR_FLOAT_2 $TEMPVAR_FLOAT_3
Please use the Sanny Builder Opcode Search Tool, if you can, as finding how a question like "is there a opcode ..." will be answered by yourself.

You will find most "camera-related" stuff is quite easy to do, anyway ...
13
Re: Mission Question on Tue Jul 14, 2009 2:54 am
Thx the thing is I wasn't sure how to get the coords for the camera. But I looked in the BigfootCleo.cs from the X-files 2 and after the custom mission is loaded why did you have it spawn the actor? Or is that the actor that the camera looks at during the cutscene?
14
Re: Mission Question on Tue Jul 14, 2009 3:18 am
If I understand correct, I made a Bigfoot for the small cut scence, and destroy it after. It's not the same Bigfoot that spawns at a random_int location. All models are loaded when the camera is in the sky, (I do not wish to make people see how the game spawns them) 5 seconds later the cut scence starts. Thing is, the mission uses global variables for the timer/health bar, since the mission was made there are been ways now to create a timer/status text without using them, the post was in Russian language, I posted it in English in the Mem Topic, and Russian in the Russian forum.
----
To try and create a status_text without using global variables, try this test script, it is written by Seemann.
Description of the script:
RU: Вот пример скрипта, который в течение 10 секунд показывает состояние переменной 33@ (т.е. таймера):
EN: Here is a example script, which in within 10 seconds will show the status variable 33@ (i.e, timer):
http://cleo.sannybuilder.com/scripts/status_text.cs
But I looked in the BigfootCleo.cs from the X-files 2
That is a script, 2 scripts in one CS-file, kind of. When you pass the mission 5 times the Bigfoot will spawn. Nothing-releated to the actual mission.
---
If you want to make a function like this, where you can check how many times the mission has passed to unlock a special function use the var function.
In CLEO-scripts, we use CLEO-var opcodes to check, you can use globals - but I recommend not to (because of the CLEO rule, which Seemann has said over 100000 times - do not use globals in CLEO scripts - NEVER).
Place this at the script of the script (starter-pack):
- Code:
0A95: enable_thread_saving
0AB3: var 15 = 0
This code will set the var 15 value to 0, and enable the threads saving.
Put this in the startpack script also:
- Code:
0AB4: 31@ = var 15
if
31@ == 5
then
...activate sub-Bigfoot script
end
This will check if the mission has been completed 5 times.
In the CM-file (Custom Mission) when the mission is passed add 1 to the var 15, so that it will know, it will add 1, so when you pass the mission again it will be second time, etc.
So, put this in the mission-pass selection:
- Code:
0AB4: 31@ = var 15
000A: 31@ += 1 // integer values
0AB3: var 15 = 31@
Understand?

15
Re: Mission Question on Tue Jul 14, 2009 6:21 am
K but about the script you posted above how would it look for the actor to shoot the gun, then kick the player, then shoot over and over until he's dead?
Edit- yes the var stores how many times the mission is passed, in a nutshell.
Edit- yes the var stores how many times the mission is passed, in a nutshell.
16
Re: Mission Question on Tue Jul 14, 2009 7:35 am
Good from what I tested. I wrote some modded scripts from the one before, they do as follows:
Script 1 - he shoots, kicks CJ, walks about 5 feet in front of him waits for him to get up and they start fighting again, he kicks CJ until he is dead.
Script 2 - the one you requested, shoot the gun, kick the player, wait for player to get up - shoot the player until he's dead.
Script 1:
- Code:
{$CLEO}
0000:
var
$PLAYER_CHAR : Player
end
while true
wait 250
if
$PLAYER_CHAR.Defined
then
if
00E1: player 0 pressed_key 10 // N (Latin)
then
break
end
end
end
#BIKDRUG.Load
#AK47.Load
04ED: load_animation "FIGHT_C"
038B: load_requested_models
while true
if and
#BIKDRUG.Available
#AK47.Available
04EE: animation "FIGHT_C" loaded
then
break
end
wait 0
end
04C4: store_coords_to 1@ 2@ 3@ from_actor $PLAYER_ACTOR with_offset 1.0 8.0 1.0
009A: 0@ = create_actor_pedtype 4 model #BIKDRUG at 1@ 2@ 3@
0223: set_actor 0@ health_to 500
060B: set_actor 0@ decision_maker_to 32
01B2: give_actor 0@ weapon 30 ammo 0xFFFFFFF // Load the weapon model before using this
04C4: store_coords_to 1@ 2@ 3@ from_actor $PLAYER_ACTOR with_offset 0.0 0.0 0.0
0668: AS_actor 0@ rotate_and_shoot_at 1@ 2@ 3@ 3000 ms
33@ = 0
repeat
wait 0
until 33@ > 3100
if
not Actor.Dead(0@)
then
0605: actor 0@ perform_animation_sequence "FIGHTC_IDLE" IFP_file "FIGHT_C" 4.0 loop 1 0 0 0 time -1 // versionA
end
33@ = 0
while true
if
33@ > 2300
then
break
end
wait 0
end
05D9: AS_actor 0@ run_to_actor $PLAYER_ACTOR timelimit 0xFFFFFFFE stop_within_radius 2.0
33@ = 0
repeat
wait 0
until 0104: actor $PLAYER_ACTOR near_actor 0@ radius 1.58659369 2.0 2.0 sphere 0
if and
not Actor.Dead(0@)
not Actor.Dead($PLAYER_ACTOR)
then
0605: actor 0@ perform_animation_sequence "FIGHTC_M" IFP_file "FIGHT_C" 4.0 loop 0 1 1 0 time -1 // versionA
05BB: AS_actor $PLAYER_ACTOR fall_down 0 time_on_ground 1500
0851: set_actor $PLAYER_ACTOR decrease_health_by 9 flag 1
gosub @ReadMem
000E: 4@ -= @Message1
gosub @BlackBox
end
while 0611: actor 0@ performing_animation "FIGHTC_M"
wait 0
end
wait 1000
04C4: store_coords_to 1@ 2@ 3@ from_actor $PLAYER_ACTOR with_offset 0.0 4.8 0.0
07CD: AS_actor 0@ walk_to 1@ 2@ 3@ stop_with_angle -1 within_radius 1.0
wait 2500
0A1D: AS_actor 0@ rotate_to_and_look_at_actor $PLAYER_ACTOR
wait 2000
0792: disembark_instantly_actor $PLAYER_ACTOR
0605: actor $PLAYER_ACTOR perform_animation_sequence "FIGHTC_IDLE" IFP_file "FIGHT_C" 4.0 loop 1 0 0 0 time -1 // versionA
while true
if
33@ > 2000
then
break
end
wait 0
end
33@ = 0
// --- end of attack start
:RepeatAction
wait 0
if and
not Actor.Dead(0@)
not Actor.Dead($PLAYER_ACTOR)
then
05D9: AS_actor 0@ run_to_actor $PLAYER_ACTOR timelimit 0xFFFFFFFE stop_within_radius 1.7
end
repeat
wait 0
until 0104: actor $PLAYER_ACTOR near_actor 0@ radius 1.5865936487 1.7 2.0 sphere 0
if and
not Actor.Dead(0@)
not Actor.Dead($PLAYER_ACTOR)
then
0605: actor 0@ perform_animation_sequence "FIGHTC_M" IFP_file "FIGHT_C" 4.0 loop 0 1 1 0 time -1 // versionA
05BB: AS_actor $PLAYER_ACTOR fall_down 0 time_on_ground 1500
0851: set_actor $PLAYER_ACTOR decrease_health_by 5 flag 1
end
if or
not Actor.Dead($PLAYER_ACTOR)
not Actor.Dead(0@)
jf @EndScript
while 0611: actor 0@ performing_animation "FIGHTC_M"
wait 0
end
wait 1000
04C4: store_coords_to 1@ 2@ 3@ from_actor $PLAYER_ACTOR with_offset 0.0 4.8 0.0
07CD: AS_actor 0@ walk_to 1@ 2@ 3@ stop_with_angle -1 within_radius 1.0
wait 2500
0A1D: AS_actor 0@ rotate_to_and_look_at_actor $PLAYER_ACTOR
wait 2000
0792: disembark_instantly_actor $PLAYER_ACTOR
0605: actor $PLAYER_ACTOR perform_animation_sequence "FIGHTC_IDLE" IFP_file "FIGHT_C" 4.0 loop 1 0 0 0 time -1 // versionA
while true
if
33@ > 3000 // in/de/crease this timer, for a time you want to re-loop the kick-action
then
break
end
wait 0
end
33@ = 0
jump @RepeatAction
:EndScript
wait 2000
gosub @ReadMem
000E: 4@ -= @Message2
gosub @BlackBox
#BIKDRUG.Destroy
#AK47.Destroy
04EF: release_animation "FIGHT_C"
01C2: remove_references_to_actor 0@ // Like turning an actor into a random pedestrian
0a93: end_custom_thread
:ReadMem
0A9F: 4@ = current_thread_pointer
4@ += 0x10
0A8D: 4@ = read_memory 4@ size 4 virtual_protect 0
return
:BlackBox
if
0AA9: is_game_version_original
then
0AA5: call 0x588BE0 num_params 4 pop 4 0 0 0 4@
else
0AA5: call 0x5893B0 num_params 4 pop 4 0 0 0 4@
end
return // Set SB 'Case Converting' to 'As is' !
:Message1
hex
"~r~ You_got_owned!" 00
end
:Message2
hex
"~s~ Test_script_ended." 00
end
Script 2:
- Code:
{$CLEO}
0000:
var
$PLAYER_CHAR : Player
end
while true
wait 250
if
$PLAYER_CHAR.Defined
then
if
00E1: player 0 pressed_key 10 // N (Latin)
then
break
end
end
end
#BIKDRUG.Load
#AK47.Load
04ED: load_animation "FIGHT_C"
038B: load_requested_models
while true
if and
#BIKDRUG.Available
#AK47.Available
04EE: animation "FIGHT_C" loaded
then
break
end
wait 0
end
04C4: store_coords_to 1@ 2@ 3@ from_actor $PLAYER_ACTOR with_offset 1.0 8.0 1.0
009A: 0@ = create_actor_pedtype 4 model #BIKDRUG at 1@ 2@ 3@
0223: set_actor 0@ health_to 500
060B: set_actor 0@ decision_maker_to 32
01B2: give_actor 0@ weapon 30 ammo 0xFFFFFFF // Load the weapon model before using this
04C4: store_coords_to 1@ 2@ 3@ from_actor $PLAYER_ACTOR with_offset 0.0 0.0 0.0
0668: AS_actor 0@ rotate_and_shoot_at 1@ 2@ 3@ 3000 ms
33@ = 0
repeat
wait 0
until 33@ > 3100
if
not Actor.Dead(0@)
then
0605: actor 0@ perform_animation_sequence "FIGHTC_IDLE" IFP_file "FIGHT_C" 4.0 loop 1 0 0 0 time -1 // versionA
end
33@ = 0
while true
if
33@ > 2300
then
break
end
wait 0
end
05D9: AS_actor 0@ run_to_actor $PLAYER_ACTOR timelimit 0xFFFFFFFE stop_within_radius 2.0
33@ = 0
repeat
wait 0
until 0104: actor $PLAYER_ACTOR near_actor 0@ radius 1.58659369 2.0 2.0 sphere 0
if and
not Actor.Dead(0@)
not Actor.Dead($PLAYER_ACTOR)
then
0605: actor 0@ perform_animation_sequence "FIGHTC_M" IFP_file "FIGHT_C" 4.0 loop 0 1 1 0 time -1 // versionA
05BB: AS_actor $PLAYER_ACTOR fall_down 0 time_on_ground 1500
0851: set_actor $PLAYER_ACTOR decrease_health_by 9 flag 1
gosub @ReadMem
000E: 4@ -= @Message1
gosub @BlackBox
end
while 0611: actor 0@ performing_animation "FIGHTC_M"
wait 0
end
wait 1000
04C4: store_coords_to 1@ 2@ 3@ from_actor $PLAYER_ACTOR with_offset 0.0 4.8 0.0
07CD: AS_actor 0@ walk_to 1@ 2@ 3@ stop_with_angle -1 within_radius 1.0
wait 2500
0A1D: AS_actor 0@ rotate_to_and_look_at_actor $PLAYER_ACTOR
wait 2000
0792: disembark_instantly_actor $PLAYER_ACTOR
0605: actor $PLAYER_ACTOR perform_animation_sequence "FIGHTC_IDLE" IFP_file "FIGHT_C" 4.0 loop 1 0 0 0 time -1 // versionA
while true
if
33@ > 2000
then
break
end
wait 0
end
33@ = 0
0687: clear_actor 0@ task
05E2: AS_actor 0@ kill_actor $PLAYER_ACTOR
repeat
wait 0
until Actor.Dead($PLAYER_ACTOR)
:EndScript
wait 2000
gosub @ReadMem
000E: 4@ -= @Message2
gosub @BlackBox
#BIKDRUG.Destroy
#AK47.Destroy
04EF: release_animation "FIGHT_C"
01C2: remove_references_to_actor 0@ // Like turning an actor into a random pedestrian
0a93: end_custom_thread
:ReadMem
0A9F: 4@ = current_thread_pointer
4@ += 0x10
0A8D: 4@ = read_memory 4@ size 4 virtual_protect 0
return
:BlackBox
if
0AA9: is_game_version_original
then
0AA5: call 0x588BE0 num_params 4 pop 4 0 0 0 4@
else
0AA5: call 0x5893B0 num_params 4 pop 4 0 0 0 4@
end
return // Set SB 'Case Converting' to 'As is' !
:Message1
hex
"~r~ You_got_owned!" 00
end
:Message2
hex
"~s~ Test_script_ended." 00
end
17
Re: Mission Question on Tue Jul 14, 2009 7:46 am
Thx man but if I wanted it to loop as he'll change between shooting and kicking constantly until hes dead, a jump after the last FIGHT_C would work yes?
18
Re: Mission Question on Tue Jul 14, 2009 8:11 am
Yes, sure. Try to edit the script how you want it. If your version does not work, post it afterwards, and I'll help.
19
Re: Mission Question on Tue Jul 14, 2009 9:10 am
I'll test mine in a bit but do you know of a tool that can get coords of SA with out having to open SA?
Edith- Dang thought I had it but now this script crashes on load up:
Edith- Dang thought I had it but now this script crashes on load up:
- Code:
{$CLEO .cs}
//-------------MAIN---------------
thread "HUNT_N"
0A95: enable_thread_saving
:HUNT_N_10
wait 0
if
Player.Defined($PLAYER_CHAR)
jf @HUNT_N_10
if
$ONMISSION == 0
jf @HUNT_N_10
jump @HUNT_N_55
:HUNT_N_55
wait 0
if and
$ONMISSION == 0
00FF: actor $PLAYER_ACTOR sphere 1 in_sphere -1907.506 716.6337 45.4453 radius 2.0 2.0 3.0 on_foot
jf @HUNT_N_13
00BE: text_clear_all
$ONMISSION = 1
00BA: show_text_styled GXT 'NEME1' time 1000 style 2
0A94: start_custom_mission "NEMESISMISSION"
jump @HUNT_N_10
:HUNT_N_13
gosub @ReadMem
000E: 4@ -= @Message1
gosub @BlackBox
:ReadMem
0A9F: 4@ = current_thread_pointer
4@ += 0x10
0A8D: 4@ = read_memory 4@ size 4 virtual_protect 0
return
:BlackBox
if
0AA9: is_game_version_original
then
0AA5: call 0x588BE0 num_params 4 pop 4 0 0 0 4@
else
0AA5: call 0x5893B0 num_params 4 pop 4 0 0 0 4@
end
return // Set SB 'Case Converting' to 'As is'
:Message1
hex
"~r~ Finish_Your_Curent_Mission_First!" 00
end
jump @HUNT_N_10
20
Re: Mission Question on Tue Jul 14, 2009 11:25 am
No, I only ever use Sanny Builder to get coords.
Yea, of course this script will not work, because you forgot a jump, so when it goes to label 13, it will gosub fine, but when these have finished returning it goes right on to :ReadMem and it gets stuck there. Also the jump@HUNT_N_10 after the text is not needed, as the script itself does not read the hex..end text by its self going right after, the thing which does is
this:
- Code:
000E: 4@ -= @Message1
So after the gosub @BlackBox gosubed to the display text_box sub-script, it then returns, but it has no where to go other than going right on to the label ReadMem AGAIN, it sees the gosub, and the engine thinks, WT*?, there is no gosub to return, because I have not gosubed.
I hope you understand what I mean.
Use this slightly modded script:
- Code:
{$CLEO}
0000:
:Script_01
while true
wait 250
if
Player.Defined($PLAYER_CHAR)
then
if
$ONMISSION == 0
then
break
end
end
end
wait 0
if and
$ONMISSION == 0
00FF: actor $PLAYER_ACTOR sphere 1 in_sphere -1907.506 716.6337 45.4453 radius 2.0 2.0 3.0 on_foot
then
00BE: text_clear_all
$ONMISSION = 1
00BA: show_text_styled GXT 'NEME1' time 1000 style 2
0A94: start_custom_mission "NEMESISMISSION"
wait 500
jump @Script_01
end
gosub @ReadMem
000E: 4@ -= @Message1
gosub @BlackBox
jump @Script_01
:ReadMem
0A9F: 4@ = current_thread_pointer
4@ += 0x10
0A8D: 4@ = read_memory 4@ size 4 virtual_protect 0
return
:BlackBox
if
0AA9: is_game_version_original
then
0AA5: call 0x588BE0 num_params 4 pop 4 0 0 0 4@
else
0AA5: call 0x5893B0 num_params 4 pop 4 0 0 0 4@
end
return // Set SB 'Case Converting' to 'As is'
:Message1
hex
"~r~ Finish_Your_Curent_Mission_First!" 00
end
Still - good job for paying attention to me, when I said you need to use '_' to mark a space.

As I final note; I recommend you to use high-level construction for most things, as it makes your script look awesome, more advanced, smart-looking, and much more readable.
Last edited by gtasbigfoot on Sun Jul 19, 2009 2:32 am; edited 1 time in total
21
Re: Mission Question on Tue Jul 14, 2009 11:35 am
Thx! Yea the high-level construction does look good just need to get how the while-true and break work other than those I think I got most of em. And the script crashes because it keeps read the gosub?
22
Re: Mission Question on Tue Jul 14, 2009 11:44 am
No, because after it HAD finished reading the gosubs it goes right on-to label :ReadMem, and it sees the 'return' but there is no gosub to return. So the game just crashes. And it's already readed the sub-text script, there is no reason why it should do so again.
I.e.:
- Code:
gosub @ReadMem // gosub to read address
// okay we finished gosubing to ReadMem..
000E: 4@ -= @Message1 // the data-text
gosub @BlackBox // call the text box
// OK!! we finished gosubing now where do we go??
// ANSWER: just continue ...
// SHOULD BE (what we should put here): put a jump here to restart the start - we should NOT CONTINUE!!!
// so we read this again - useless
:ReadMem
0A9F: 4@ = current_thread_pointer
4@ += 0x10
0A8D: 4@ = read_memory 4@ size 4 virtual_protect 0
// we see this 'return' it's useless now since we DID NOT gosub WE ALREADY DID IT! we just continue from the last gosub. no gosub to return from = CRASH!
return
.....
how the while-true and break work
Causes the loop of current flow to exit ...
Read the topic "Scripting functions" say we use 'Break':
- Code:
:Script_01
while true
wait 250
if
Player.Defined($PLAYER_CHAR)
then
if
$ONMISSION == 0
then
break
end
end
end
Decompile version will look like:
- Code:
:Noname_4
0001: wait 250 ms
00D6: if
0256: player $PLAYER_CHAR defined
004D: jump_if_false @Noname_50
00D6: if
0038: $ONMISSION == 0
004D: jump_if_false @Noname_50
0002: jump @Noname_57
:Noname_50
0002: jump @Noname_4
23
Re: Mission Question on Thu Jul 16, 2009 10:07 am
K now I get it. I'll read up on that just as soon as my pc is fixed. Until then I'm on my psp. And on this the page is stretched.
edit- now it flashes the text constantly even tho
I'm not in the marker or on a mission :/
edit- now it flashes the text constantly even tho
I'm not in the marker or on a mission :/
24
Re: Mission Question on Sun Jul 19, 2009 2:29 am
Yeah, sure it does. That's because we did it like that, take a look into the script.
The script first checks if your on a mission - if not then it creates the sphere, and ready to play, and it goes on to display the text weather on in the sphere/mission or not.
So did you want the sphere to be there always, and tell the player if he is on a mission to go away and finish his current mission? If so, use this script:
- Code:
{$CLEO}
0000:
:Script_01
while true
wait 250
if
Player.Defined($PLAYER_CHAR)
then
break
end
end
wait 0
if
00FF: actor $PLAYER_ACTOR sphere 1 in_sphere -1907.506 716.6337 45.4453 radius 2.0 2.0 3.0 on_foot
then
if
$ONMISSION == 0
jf @PlayerOnMission
00BE: text_clear_all
$ONMISSION = 1
00BA: show_text_styled GXT 'NEME1' time 1000 style 2
0A94: start_custom_mission "NEMESISMISSION"
wait 500
jump @Script_01
end
jump @Script_01
:PlayerOnMission
gosub @ReadMem
000E: 4@ -= @Message1
gosub @BlackBox
jump @Script_01
:ReadMem
0A9F: 4@ = current_thread_pointer
4@ += 0x10
0A8D: 4@ = read_memory 4@ size 4 virtual_protect 0
return
:BlackBox
if
0AA9: is_game_version_original
then
0AA5: call 0x588BE0 num_params 4 pop 4 0 0 0 4@
else
0AA5: call 0x5893B0 num_params 4 pop 4 0 0 0 4@
end
return // Set SB 'Case Converting' to 'As is'
:Message1
hex
"~r~ Finish_Your_Curent_Mission_First!" 00
end
See, easy no?
25
Re: Mission Question on Sun Jul 19, 2009 2:44 am
d'oh if it was any easier it would bite me thx mon
edit- got another question once a cm has started or before it starts can you check if a another cleo or .cs has started?
maybe something with 0ABA might work..
edit2 also it looks like theres a bug in the 2nd cleo you posted the one with the ped that shoots, kicks and then shoots again, if you kill the actor before he does the animation it has the player do the fight c ide animation then loops and looks up, but I can still pause it.

edit- got another question once a cm has started or before it starts can you check if a another cleo or .cs has started?
maybe something with 0ABA might work..
edit2 also it looks like theres a bug in the 2nd cleo you posted the one with the ped that shoots, kicks and then shoots again, if you kill the actor before he does the animation it has the player do the fight c ide animation then loops and looks up, but I can still pause it.

Go to page : 1, 2, 3, 4
Similar topics
Permissions in this forum:
You cannot reply to topics in this forum
|
|