GTA: Modification Area
Would you like to react to this message? Create an account in a few clicks or log in to continue.
GTA: Modification Area

A website for the GTA modding scene

Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» Big-game starts raising Schneider's profile
Mission Question EmptySun Mar 04, 2012 2:28 am by lavivi

» [Help] cleo created lighting
Mission Question EmptyThu Oct 14, 2010 1:03 am by findmy012

» Mission Question
Mission Question EmptyThu Oct 14, 2010 1:02 am by findmy012

» [IV] Spoiler Script
Mission Question EmptyThu Oct 14, 2010 1:02 am by findmy012

» Mission mod [help]
Mission Question EmptySat Sep 18, 2010 5:50 pm by jayd00

» Bc7 Mod Help
Mission Question EmptyFri Aug 20, 2010 11:19 am by pengpeng

» Found a bug
Mission Question EmptyFri Dec 18, 2009 4:22 am by _CJ360_

» [IV] Novitec Rosso 599 GTB
Mission Question EmptyTue Nov 17, 2009 4:22 pm by Kotton

» Hello/Guidance Request
Mission Question EmptyMon Oct 12, 2009 6:45 am by Adler

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search
Affiliates
image

Image

Image

Image

Image

Image

Image

Image

Image

Image

image

Image

steve-m.com

Image


----- Русский -----

Если ваш сайт содержит большую коллекцию 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
, and I will add it to the list. The unique scripts are preferable ... Thank you. ))))
Log in

I forgot my password



July 2024
MonTueWedThuFriSatSun
1234567
891011121314
15161718192021
22232425262728
293031    

Calendar Calendar


You are not connected. Please login or register

Mission Question

3 posters

Go to page : 1, 2, 3, 4  Next

Go down  Message [Page 1 of 4]

1Mission Question Empty Mission Question Tue Jul 07, 2009 6:37 am

_CJ360_

_CJ360_

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

2Mission Question Empty Re: Mission Question Tue Jul 07, 2009 7:35 am

gtasbigfoot

gtasbigfoot
Admin



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


http://gtamodding.com

3Mission Question Empty Re: Mission Question Tue Jul 07, 2009 9:29 am

_CJ360_

_CJ360_

thx big. but could u show me how to have the actor shoot the weapon, then runs up and does a Kung-Fu move?

4Mission Question Empty Re: Mission Question Tue Jul 07, 2009 10:08 am

gtasbigfoot

gtasbigfoot
Admin



Sure, play around with the range and co-ordinates, and stuff how you want. Grin Smile


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

 


http://gtamodding.com

5Mission Question Empty Re: Mission Question Tue Jul 07, 2009 10:52 am

_CJ360_

_CJ360_

thx again! I'd say the 0xFFFFFFF, and 0xFFFFFFFE are memory addresses right? Either way could you shed some light on those?

6Mission Question Empty Re: Mission Question Tue Jul 07, 2009 11:06 am

gtasbigfoot

gtasbigfoot
Admin



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 ...

http://gtamodding.com

7Mission Question Empty Re: Mission Question Tue Jul 07, 2009 11:09 am

_CJ360_

_CJ360_

thx, again
edit whats the ~r~ and ~s~ do? Something with the text I presume?

8Mission Question Empty Re: Mission Question Wed Jul 08, 2009 9:54 am

gtasbigfoot

gtasbigfoot
Admin


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. Grin Smile

http://gtamodding.com

9Mission Question Empty Re: Mission Question Thu Jul 09, 2009 6:33 am

_CJ360_

_CJ360_

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

10Mission Question Empty Re: Mission Question Thu Jul 09, 2009 7:55 am

gtasbigfoot

gtasbigfoot
Admin



Sure, don't ask - ANY questions are welcome Wink.

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. Grin Smile

http://gtamodding.com

11Mission Question Empty Re: Mission Question Thu Jul 09, 2009 9:12 am

_CJ360_

_CJ360_

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.

12Mission Question Empty Re: Mission Question Thu Jul 09, 2009 9:32 am

gtasbigfoot

gtasbigfoot
Admin



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. Grin Smile

You will find most "camera-related" stuff is quite easy to do, anyway ...

http://gtamodding.com

13Mission Question Empty Re: Mission Question Tue Jul 14, 2009 2:54 am

_CJ360_

_CJ360_

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?

14Mission Question Empty Re: Mission Question Tue Jul 14, 2009 3:18 am

gtasbigfoot

gtasbigfoot
Admin



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? Wink



http://gtamodding.com

15Mission Question Empty Re: Mission Question Tue Jul 14, 2009 6:21 am

_CJ360_

_CJ360_

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.

16Mission Question Empty Re: Mission Question Tue Jul 14, 2009 7:35 am

gtasbigfoot

gtasbigfoot
Admin



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


http://gtamodding.com

17Mission Question Empty Re: Mission Question Tue Jul 14, 2009 7:46 am

_CJ360_

_CJ360_

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?

18Mission Question Empty Re: Mission Question Tue Jul 14, 2009 8:11 am

gtasbigfoot

gtasbigfoot
Admin



Yes, sure. Try to edit the script how you want it. If your version does not work, post it afterwards, and I'll help.

http://gtamodding.com

19Mission Question Empty Re: Mission Question Tue Jul 14, 2009 9:10 am

_CJ360_

_CJ360_

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:
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
It was working until I added the text that's supposed to appear if th player is on a mission and steps into the marker.

20Mission Question Empty Re: Mission Question Tue Jul 14, 2009 11:25 am

gtasbigfoot

gtasbigfoot
Admin



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. Good

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

http://gtamodding.com

21Mission Question Empty Re: Mission Question Tue Jul 14, 2009 11:35 am

_CJ360_

_CJ360_

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?

22Mission Question Empty Re: Mission Question Tue Jul 14, 2009 11:44 am

gtasbigfoot

gtasbigfoot
Admin



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


http://gtamodding.com

23Mission Question Empty Re: Mission Question Thu Jul 16, 2009 10:07 am

_CJ360_

_CJ360_

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 :/

24Mission Question Empty Re: Mission Question Sun Jul 19, 2009 2:29 am

gtasbigfoot

gtasbigfoot
Admin



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?

http://gtamodding.com

25Mission Question Empty Re: Mission Question Sun Jul 19, 2009 2:44 am

_CJ360_

_CJ360_

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.
Mission Question 6b736d42545541

Sponsored content



Back to top  Message [Page 1 of 4]

Go to page : 1, 2, 3, 4  Next

Permissions in this forum:
You cannot reply to topics in this forum