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
Sun Mar 04, 2012 2:28 am by lavivi

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

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

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

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

» Bc7 Mod Help
Fri Aug 20, 2010 11:19 am by pengpeng

» Found a bug
Fri Dec 18, 2009 4:22 am by _CJ360_

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

» Hello/Guidance Request
Mon 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



December 2016
MonTueWedThuFriSatSun
   1234
567891011
12131415161718
19202122232425
262728293031 

Calendar Calendar


You are not connected. Please login or register

Mission Question

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

View previous topic View next topic Go down  Message [Page 2 of 4]

26 Re: Mission Question on Mon Jul 20, 2009 4:55 am



Is your question, can I check if another CS-file has started through a CM-file?

Opcode 0ABA ends a custom thread. It's like that of 0459, with the only difference it's made to end CLEO-scripts.

I will answer all the things which are in this category of thread questions.

1. To check if another thread is active with specifyed name, use the CLEO opcode 0AAA.


Code:

while true
    wait 250
    0AAA: 0@ = thread 'TEST' pointer
    if
        0@ > 0 // true if thread/mission 'TEST' is running
    then
    ....
    end
end // while true


2. To create a thread, which is not loaded until you create it through a CS/CM-file, give the file the extention ".s".

3. Threads can be ended through the end_thread opcodes. Use opcode 0ABA to end a CLEO-script with this name, and use 0459 to end a script in the main.scm file.

4. You can put mutli-threads in one CS-file by using the using create_custom_thread with parameters. Like the SCM opcode create_thread the CLEO version allows up to 34 parameters in total.



  • Your CS-files name must be the same as the parameter of the create_custom_thread opcode.

  • Select the threads using a check right at the top of your script, using create_custom_thread with parameters:



Code:

0A92: create_custom_thread "TestScript.cs" 1


the 2 parameter (1) in the opcode above ^ gives the value of the local variable 0@ in the thread which get started.

Here is an example script:


Code:

if
  0@ == 0
then
    0A92: create_custom_thread "TestScript.cs" 1
    0A92: create_custom_thread "TestScript.cs" 2
    0A92: create_custom_thread "TestScript.cs" 3

// here goes thread 1
03A4: name_thread 'Thread1'
....


end 


if
  0@ == 1
then

// here goes thread 2
03A4: name_thread 'Thread2'
....


end


if
  0@ == 2
then

// here goes thread 3
03A4: name_thread 'Tread3'
....


end


if
  0@ == 3
then

// here goes thread 4
03A4: name_thread 'Thread4'
....


end


0A93: end_custom_thread  // all done!


0@ is equal to 0 at start of TestScript.cs by default.



5. Pass on parameters to other threads simply by adding them to the create_thread line. Like this:


Code:

// create car with local var 1@
0A92: create_custom_thread "MyCustomThread.s" 1@ // the cars var passed on to the thread "MyCustomThread.s".


You can do the same in the main.scm, but use the opcode 004F.

6. In CS-files we can only use locals in range of 0@..33@
This is solved using a global variable, but that causes problems.

We have more space to the threads in advance, to save the variables to write directly to the memory.

It is difficult to operate.

However, it is very convenient to be able to increase the space to fit as much memory in the thread.


Code:

for 0@ = 0 to 9
    0093: 1@ = integer 0@ to_float
    04C4: store_coords_to 5@ 6@ 7@ from_actor $PLAYER_ACTOR with_offset 0.0 1@ 0.0
    0107: 2@ = create_object #KNIFECUR at 5@ 6@ 7@
    gosub @get_pointer
    0085: 4@ = 0@ // (int)
    0012: 4@ *= 4
    005A: 30@ += 4@ // (int)
    0A8C: write_memory 30@ size 4 value 2@ virtual_protect 0
   
    04C4: store_coords_to 5@ 6@ 7@ from_actor $PLAYER_ACTOR with_offset 0.0 0.0 1@
    0107: 3@ = create_object #KATANA at 5@ 6@ 7@
    gosub @get_pointer
    0085: 4@ = 0@ // (int)
    0012: 4@ *= 4
    005A: 30@ += 4@ // (int)
    000A: 30@ += 40
    0A8C: write_memory 30@ size 4 value 3@ virtual_protect 0
end

wait 2000

for 0@ = 0 to 9
    gosub @get_pointer
    0085: 4@ = 0@ // (int)
    0012: 4@ *= 4
    005A: 30@ += 4@ // (int)
    0A8D: 2@ = read_memory 30@ size 4 virtual_protect 0
    if
    03CA:  object 2@ exists
    then
        0108: destroy_object 2@
    end

    gosub @get_pointer
    0085: 4@ = 0@ // (int)
    0012: 4@ *= 4
    005A: 30@ += 4@ // (int)
    000A: 30@ += 40
    0A8D: 3@ = read_memory 30@ size 4 virtual_protect 0
    if
    03CA:  object 3@ exists
    then
        0108: destroy_object 3@
    end
end
                   
                   
:get_pointer
0A9F: 30@ = current_thread_pointer
000A: 30@ += 0x10
0A8D: 30@ = read_memory 30@ size 4 virtual_protect 0
000E: 30@ -= @pool
return

:pool
hex
//2@ - knife pool - 40byte
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

//3@ - katana pool - 40byte
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
end


1-M in front of the player is a knife and a blade at intervals of 10 units above the 1-M interval 10 a piece, extinguish all code after two seconds. Eight variables are used.

We have put a simple explanation for this case can be made with 24 variables.


Create a conversation area.


  • 1. Count the number of variables you want to use.
  • 2. 0 to 8 for one variable has to be written in hex..end structure
  • 3. Variable used to remember the size using the
    size 4

  • 4. If we treat this type of counting the size of the first two types (40byte)



Code:

:pool
      hex
      // 2@ - knife pool - 40byte
      00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

      // 3@ - katana pool - 40byte
      00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
      end


7. It's possible to pass a string to a new thread. Obviously you can't just write something like:


Code:

create_thread @MyAnim "anim_name"


but you can do the following:

1. store the string to pass to a string variable (for example, 0@s, 0@v, s$var, v$var, etc; local variables are always preferable).

2. the string (the sequence of symbols) is now occupying 8 or 16 bytes of the variable storage. If you use a short string (@s, s$), then its length is 8 bytes; if a long string (@v, v$) - 16 bytes. Say, if you write this:


Code:

1@s = 'THREAD1'


this does not mean that all the symbols ('T', 'H', 'R', 'E', 'A', 'D', '1') are stored in a single 1@ variable. A single variable can hold only 4 bytes of data. Each symbol takes exactly one byte, the whole 7-chars string 'THREAD1' will occupy.. guess how much?.. 7 bytes! (plus 1 byte is a null-terminator - a zero byte at the very end of a string). So, in our case the string will be stored in two variables: 1@ will contain first 4 symbols of the string (THRE) and the next variable (2@) will contain the rest (AD1). Long strings occupy up to 4 variables:


Code:

1@v = "my_long_string" =>
 1@ - my_l
 2@ - ong_
 3@ - stri
 4@ - ng


If the string is shorter (say 2 symbols only, or even its empty one) it will still occupy 2 or 4 variables depending on its type:


Code:

10@s = '123'
 10@ - 123
 11@ - nothing (just random or zero bytes)



Code:

22@v = "gtaf"
 22@ - gtaf
 23@ - random/empty
 24@ - random/empty
 25@ - random/empty


So, one more important thing: you are normally not able to store strings in local variable 31@ and higher, as the rest of the string will be overwritten by the timers (32@/33@):


Code:

31@ - 'string'
 31@ - stri
 32@ - ng -- this symbols will be lost later, as variables 32@ and 33@ due to its nature constantly change their values.


Same valid for the long strings. As you may already guess, you can not use any variables higher than 28@ for them:


Code:

29@v = "my_long_string" =>
 29@ - my_l
 30@ - ong_
 31@ - stri
 32@ - ng --this will be lost


Global variables do not have such behaviour as there are no timers.

3. So, what about passing a string at last. You can pass the string by passing the values of the variables that contain the string content. Say you use:


Code:

1@s = 'THREAD'



then you can pass this string as:


Code:

create_thread @random 1@ 2@ // yahoo, the string is out


Then read the string in the "Random" thread as usually:


Code:

:Random
03A4: name_thread 0@s //0@ is the first passed value, and s denoting its a string



With long strings:


Code:

9@v = "THREAD"
...
create_thread @random 9@ 10@ 11@ 12@
....
:Random
03A4: name_thread 0@v



With global variables its harder to use this method as you need to know the ID the variable is compiled with. If its a DMA variable (with a numeric name), there's no problem at all:


Code:

s$100 = 'string'
..
create_thread @random $100 $101
..
:Random
03A4: name_thread 0@s



But for the variables with custom names you should use the array trick:


Code:

s$var = 'string'
0@ = 1 // index
create_thread @random $var $var(0@,1i)
...
:Random
03A4: name_thread 0@s


Note that you need local variables for the indexes, so it still better to use the first way (save the string to a local but not global var).
---

Note 1. This method might be applied not only to the newly created threads but also to scm functions


Code:

1@s = 'string'
0AB1: call_scm_func @cmp 2 1@ 2@
..
:cmp
if
 0@s == 'string' // compare the passed string with another one
then
 ...
end
0AB2: ret 0


Note 2. As this method is using string variables that may hold maximum 16 symbols, you can't pass a longer string in such a way (even if you pass it somehow, you still cant read it, as @s, @v, s$, v$ variables only work with 16 chars-max strings).


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.

Yes. I did not test it for bugs - as it's not a MOD. Just an example code snippet to show you how to script it, like you asked me. Grin Smile It's because I did not check weather the actor is end or not, before CJ does this.

---

P.S. Do you have Microsoft Visual C++ 2008 Express Edition? If not you can download it from:

http://www.microsoft.com/rus/express/vc/

It's good to practice your programming skills, do you have knowleage in C/C++, ASM, LUA, and etc?

View user profile http://gtamodding.com

27 Re: Mission Question on Mon Jul 20, 2009 6:12 am

Thx mon with all that info it makes me feel as if I missed the topic on it Tounge 2
but as to what I know on C++ absolutely nothin Turn

View user profile

28 Re: Mission Question on Mon Jul 20, 2009 9:48 am




Thx mon with all that info it makes me feel as if I missed the topic on it Tounge 2

Yeah, thanks. BTW, sorry that link I posted was in Russian language, I forgot that you can't understand Russian. Tounge 2 Click "Загрузить" go down to the yellow box and click "» Загрузка (содержит SP1)" to download.

Or use this English language link:

http://www.microsoft.com/express/vc/



but as to what I know on C++ absolutely nothin Turn

Have you read the tut's by Microsoft?

http://msdn.microsoft.com/en-us/beginner/cc305129.aspx

It's easy to learn (as is possible). You will find it useful, for things such as writing your own ASI-plugin for San Andreas'e.

I myself use it (Russian version), and also Delphi is a good program - it's the same program Sanny Builder was written in.

View user profile http://gtamodding.com

29 Re: Mission Question on Mon Jul 20, 2009 11:56 pm

Nah I haven't read the tut by M. I might tho should I get bored. Tounge 2 I wish there was a way to open psp game files MGS ops+ has some models I realy want to put in SA oh well hey in the mission starter can you see the sphere in your game?

View user profile

30 Re: Mission Question on Tue Jul 21, 2009 2:23 am



No. It's because the wait-loop is effecting it. So re-loop it right away, let it go back to :Script_02 if the player is not in the sphere.


Code:


 {$CLEO}

0000:

:Script_01
while true
wait 0
if
  Player.Defined($PLAYER_CHAR)
then
    break
    end
end

:Script_02
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_02
 
    :PlayerOnMission
    gosub @ReadMem
    000E: 4@ -= @Message1
    gosub @BlackBox
    wait 2000
    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


View user profile http://gtamodding.com

31 Re: Mission Question on Tue Jul 21, 2009 3:59 am

thx, arg for some reason I can't access the advance display settings when I try it crashes. Even if I delete the gta_sa.set file. Confused 2

View user profile

32 Re: Mission Question on Tue Jul 21, 2009 4:28 am



Display setting? Do you have display MOD's installed? It works fine for me, I only have Ryosuke's google plugin installed. I should think this is nothing to-do with CLEO.

free image host

When did this start to happen? What kind of crash is it?


  • The game just closes and exits to the desktop.
  • Freezes completly - have to restart your PC.
  • Crashes, can still only hear sound.
  • Try to press Window button, a message comes up, but you can not exit the game.





View user profile http://gtamodding.com

33 Re: Mission Question on Tue Jul 21, 2009 4:32 am

The game just closes and exits to the desktop.
and which google mod is that? nvr heard of anything like that

View user profile

34 Re: Mission Question on Tue Jul 21, 2009 4:34 am

http://samc.blog123.fc2.com/blog-entry-488.html#more
http://gtasamod.web.fc2.com/tool/goggle/index.html

View user profile http://gtamodding.com

35 Re: Mission Question on Tue Jul 21, 2009 4:36 am

Oh that one but no I don't have any display mods like that installed.

View user profile

36 Re: Mission Question on Tue Jul 21, 2009 4:47 am



Was it working earlier? It's kind of hard to guess the problem when it's just a common crash to the desktop ...
Which is the most common crash.

But the rest of the menu is OK? Can you press Esc, alright? And it does not crash?

View user profile http://gtamodding.com

37 Re: Mission Question on Tue Jul 21, 2009 6:29 am

It was working earlier, and yea the reast of the menu is fine.

View user profile

38 Re: Mission Question on Tue Jul 21, 2009 11:21 am




-- 21 Июл 2009 - 6:29 AM --

It was working earlier, and yea the reast of the menu is fine.

Umm, it's very hard to answer you, as I don't and never had such a problem. Did you install/change anything since it was last working? Grin Smile Happen's as soon as you get in the display menu, or when you press something?

View user profile http://gtamodding.com

39 Re: Mission Question on Wed Jul 22, 2009 12:29 am

It's fine unless I try to get to the Advanced Display settings then it crashes to desktop but it also say GTA SA has had and error. Its weird cuz it happens on my family's pc which is newer and faster but my older pc has no such problem. Confused 2 Oh and would you mind helping me put a timer in this mission?
Spoiler:
Code:
{$CLEO .cm}
thread "NEMESISMISSION"

while true
wait 0
0AAA: 0@ = thread 'NEMESIS_THREAD' pointer
if
  0@ > 0 // true if thread/mission 'TEST' is running
    then
      0ABA: end_custom_thread_named 'NEMESIS_THREAD'
    end
end

:NEMESISMISSION_01
gosub @NEMESISMISSION_54
if
wasted_or_busted
jf @NEMESISMISSION_45
gosub @NEMESISMISSION_658

:NEMESISMISSION_45
gosub @NEMESISMISSION_681
end_thread

:NEMESISMISSION_54
increment_mission_attempts
$ONMISSION = 1
023C: load_special_actor 'NEMESIS' as 1 // models 290-299
023C: load_special_actor 'TRUTH' as 2 // models 290-299

:NEMESISMISSION_82
wait 0
if and
  Model.Available(#SPECIAL01)
  Model.Available(#SPECIAL02)
  Model.Available(#SADLER)
  Model.Available(#HEATSEEK)
jf @NEMESISMISSION_82
set_weather 9
08E7: disable_entrance_markers 1
Player.ClearWantedLevel($PLAYER_CHAR)
01F0: set_max_wanted_level_to 0
02A3: enable_widescreen 1
0@ = Actor.Create(CivMale, #SPECIAL02, -1923.7341, 719.4622, 45.4453)
Actor.Angle(0@) = 268.2894
Actor.SetImmunities(0@, 1, 1, 1, 1, 1)
0639: AS_actor $PLAYER_ACTOR rotate_to_actor 0@
0639: AS_actor 0@ rotate_to_actor $PLAYER_ACTOR
wait 5000
04C4: store_coords_to 1@ 2@ 3@ from_actor $PLAYER_ACTOR with_offset 0.0 1.8 0.0
Camera.SetPosition(-1659.5, -2240.099, 32.4503, 0.0, 0.0, 0.0)
Camera.PointAt(1@, 2@, 3@, 2)
05D3: AS_actor 0@ goto_point 1@ 2@ 3@ mode 4 12000 ms // versionA
wait 12000
00BB: show_text_lowpriority GXT 'NEME2' time 5000 flag 1
00BB: show_text_lowpriority GXT 'NEME3' time 5000 flag 1
0967: actor 0@ move_mouth 10000 ms
wait 10000 
Actor.DestroyInstantly(0@)
$GETTHERECAR = Car.Create(#SADLER, -1928.5808 721.0035 44.9999)
Car.Angle(16@) = 266.6987
01EC: make_car $GETTHERECAR very_heavy 1
02A3: enable_widescreen 0
Camera.Restore_WithJumpCut
Camera.SetBehindPlayer
Player.CanMove($PLAYER_CHAR) = True
03E5: show_text_box 'NEME3'
jump @NEMESISMISSION_1374

:NEMESISMISSION_1337
set_weather 9
wait 5000
02A3: enable_widescreen 0
Camera.Restore_WithJumpCut
Camera.SetBehindPlayer
Player.CanMove($PLAYER_CHAR) = True
00C0: set_current_time_hours_to 20 minutes_to 0
jump @NEMESISMISSION_1374

:NEMESISMISSION_1374
0209: 1@ = random_int_in_ranges 0 10

:_0_
00d6: if
0039:  1@ == 0
004d: jump_if_false @_1_
6@ = Actor.Create(CivMale, #SPECIAL01, )
Actor.Angle(6@) =
0002: jump @NEMESISMISSION_4763

:_1_
00d6: if
0039:  1@ == 1
004d: jump_if_false @_2_
6@ = Actor.Create(CivMale, #SPECIAL01, )
Actor.Angle(6@) =
0002: jump @NEMESISMISSION_4763

:_2_
00d6: if
0039:  1@ == 2
004d: jump_if_false @_3_
6@ = Actor.Create(CivMale, #SPECIAL01, )
Actor.Angle(6@) =
0002: jump @NEMESISMISSION_4763

:_3_
00d6: if
0039:  1@ == 0
004d: jump_if_false @_4_
6@ = Actor.Create(CivMale, #SPECIAL01, )
Actor.Angle(6@) =
0002: jump @NEMESISMISSION_4763

:_4_
00d6: if
0039:  1@ == 1
004d: jump_if_false @_5_
6@ = Actor.Create(CivMale, #SPECIAL01, )
Actor.Angle(6@) =
0002: jump @NEMESISMISSION_4763

:_5_
00d6: if
0039:  1@ == 2
004d: jump_if_false @_6_
6@ = Actor.Create(CivMale, #SPECIAL01, )
Actor.Angle(6@) =
0002: jump @NEMESISMISSION_4763

:_6_
00d6: if
0039:  1@ == 0
004d: jump_if_false @_7_
6@ = Actor.Create(CivMale, #SPECIAL01, )
Actor.Angle(6@) =
0002: jump @NEMESISMISSION_4763

:_7_
00d6: if
0039:  1@ == 1
004d: jump_if_false @_8_
6@ = Actor.Create(CivMale, #SPECIAL01, )
Actor.Angle(6@) =
0002: jump @NEMESISMISSION_4763

:_8_
00d6: if
0039:  1@ == 2
004d: jump_if_false @_9_
6@ = Actor.Create(CivMale, #SPECIAL01, )
Actor.Angle(6@) =
0002: jump @NEMESISMISSION_4763

:_9_
00d6: if
0039:  1@ == 2
004d: jump_if_false @_10_
6@ = Actor.Create(CivMale, #SPECIAL01, )
Actor.Angle(6@) =
0002: jump @NEMESISMISSION_4763

:_10_
00d6: if
0039:  1@ == 2
004d: jump_if_false @_1_
6@ = Actor.Create(CivMale, #SPECIAL01, )
Actor.Angle(6@) =
0002: jump @NEMESISMISSION_4763

:NEMESISMISSION_4877
023C: load_special_actor 'NEMESIS' as 1 // models 290-299
Model.Load(#HEATSEEK)
04ED: load_animation "FIGHT_C"
038B: load_requested_models

wait 0
if and
  023D:  special_actor 1 loaded
  Model.Available(#HEATSEEK)
  04EE:  animation "FIGHT_C" loaded
  jf @NEMESISMISSION_4877
jump @NEMESISMISSION_4924

:NEMESISMISSION_8600
wait 0
$Y_ROYAL_CASINO = Actor.Health(6@)
$Y_ROYAL_CASINO /= 25
03C4: set_status_text $BIGFOOT_ACTOR type 1 GXT 'NA' // global_variable
0084: $BIGFOOT_ACTOR = $Y_ROYAL_CASINO // (int)
wait 0
jump @NEMESISMISSION_4763

:NEMESISMISSION_4763
wait 0
if and
  Model.Available(#HEATSEEK)
  04EE:  animation "FIGHT_C" loaded
  jf @NEMESISMISSION_4763
Actor.Health(6@) = 7000
Actor.Armour(6@) = 3000
0446: set_actor 6@ immune_to_headshots 1
04D8: set_actor 6@ drowns_in_water 0
03FE: set_actor 6@ money 0
0946: set_actor 6@ actions_uninterupted_by_weapon_fire 1
060B: set_actor 6@ decision_maker_to 32
0245: set_actor 6@ walk_style_to "OLDMAN"
04C4: store_coords_to 10@ 11@ 12@ from_actor $PLAYER_ACTOR with_offset 1.0 8.0 1.0
01B2: give_actor 6@ weapon 36 ammo 0xFFFFFFF // Load the weapon model before using this
04C4: store_coords_to 10@ 11@ 12@ from_actor $PLAYER_ACTOR with_offset 0.0 0.0 0.0
0668: AS_actor 0@ rotate_and_shoot_at 10@ 11@ 12@ 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
else jump @NEMESISMISSION_8654


 

:NEMESISMISSION_8654
if
  Actor.Dead(6@)
jf @NEMESISMISSION_8600
jump @NEMESISMISSION_8677


:BIGFOOT_HUNTING_8677
wait 200
Marker.Disable(15@)
0151: remove_status_text $BIGFOOT_ACTOR
0871: init_jump_table $998 total_jumps 7 default_jump 0 @BIGFOOT_HUNTING_8755 jumps 0 @BIGFOOT_HUNTING_8755 1 @BIGFOOT_HUNTING_8783 2 @BIGFOOT_HUNTING_8811 3 @BIGFOOT_HUNTING_8839 4 @BIGFOOT_HUNTING_8867 -1 @BIGFOOT_HUNTING_8867 -1 @BIGFOOT_HUNTING_8867






























:NEMESISMISSION_658
00BA: show_text_styled GXT 'M_FAIL' time 5000 style 1  // ~r~MISSION FAILED!
return

:NEMESISMISSION_681
0296: unload_special_actor 1
0296: unload_special_actor 2
0151: remove_status_text $ACTORBIGFOOT
Actor.RemoveReferences(0@)
Actor.RemoveReferences(6@)
Car.RemoveReferences($GETTHERECAR)
$ONMISSION = 0
mission_cleanup
return
I was using the bigfoothunt.cm to see hot you did stuff but I'm still stuck on making a timer for like 10 minuets then a maker for where he spawned.

View user profile

40 Re: Mission Question on Wed Jul 22, 2009 3:37 am



The timer can be made in two ways, as the normal way needs global variables, in a CLEO-script you should use the safe way as I posted before.


1. Use global variables, and use the opcode:


Code:

$timer = 60000
$timer *= 5 // 5 mins
03C3: set_timer_to $timer type 1 GXT 'BB_19' // global_variable  // Time


First parameter is the storage variable (ms in time), second is the type of timer, third is the GXT entry of the text that appear's near the timer. 60000 is equal to one min, multiply it by something for a time you want, i.e. 60000 * 5 = 5 mins - just basic maths.


2. Use the CLEO way:


Code:

33@ = 600000
0AB1: call_scm_func @SetTimer 3 VARNUMBER = 33 TYPE = 1 GXT = @StatusText


Put this somewhere after the last line of your mission:


Code:

:SetTimer
0AB1: call_scm_func @__VarToOffset 1 0@ 0@
0AB1: call_scm_func @__LabelToOffset 1 2@ 2@
0AA6: call_method 0x0044CD50 struct 0x00BA1788 num_params 3 pop 0 ( TYPE = 1@ GXT = 2@ VARNUMBER = 0@ )
0AB2: ret 0

:StopTimer
0AB1: call_scm_func @__VarToOffset 1 0@ 0@
0AA6: call_method 0x0044CE60 struct 0x00BA1788 num_params 1 pop 0 ( VARNUMBER = 0@ )
0AB2: ret 0

:__VarToOffset
0A9F: 1@ = current_thread_pointer
0A8E: 2@ = 1@ + 0xDC // mission Flag
0A8D: 2@ = read_memory 2@ size 1 virtual_protect 0
if
    2@ == 1
then
    1@ = 0x00A48960 // mission locals
else
    1@ += 0x3C
end
0@ *= 4
005A: 1@ += 0@ // address of the local variable
1@ -= 0xA49960
0AB2: ret 1 1@

:__LabelToOffset
if
    0@ == 0
then
    0AB2: ret 1 0
end
0A9F: 1@ = current_thread_pointer
1@ += 0x10
0A8D: 1@ = read_memory 1@ size 4 virtual_protect 0 // baseIP
0062: 1@ -= 0@ // label address
1@ += 3
0AB2: ret 1 1@

:StatusText
0900: 'BB_19'
0000:


When you want to stop the timer use:


Code:

:StopTimer
0AB1: call_scm_func @__VarToOffset 1 0@ 0@
0AA6: call_method 0x0044CE60 struct 0x00BA1788 num_params 1 pop 0 ( VARNUMBER = 0@ )
0AB2: ret 0


And to remove the status_text use:


Code:

:RemoveStatusText
0AB1: call_scm_func @__VarToOffset 1 0@ 0@
0AA6: call_method 0x0044CE80 struct 0x00BA1788 num_params 1 pop 0 ( VARNUMBER = 0@ )
0AB2: ret 0


To add a status_text (such as a health bar) use:


Code:

:AddStatusText               
0AB1: call_scm_func @__VarToOffset 1 0@ 0@
0AB1: call_scm_func @__LabelToOffset 1 2@ 2@
0AA6: call_method 0x0044CDA0 struct 0x00BA1788 num_params 4 pop 0 ( LINE = 3@ GXT = 2@ TYPE = 1@ VARNUMBER = 0@ )
0AB2: ret 0


You can see more information in the SA Memory Topic (English), about this way, or you can see this topic (Russian).

Check if the timer is reached the time, and if it is:


Code:

:Timer_01
wait 0
if
  // timer reached
004D: jump_if_false @Timer_03
jump @Timer_02

:Timer_03
wait 0
if
  80EC:  not actor $PLAYER_ACTOR 0 near_point 18@ 19@ radius 9.0 8.0
004D: jump_if_false @Timer_04
jump @Timer_01

:Timer_02
wait 0
if
  80EC:  not actor $PLAYER_ACTOR 0 near_point 18@ 19@ radius 8.0 8.0
004D: jump_if_false @Camera_Table
0AB1: call_scm_func @StopTimer 1 VARNUMBER = 33
00BE: text_clear_all
02A8: 21@ = create_marker 60 at 18@ 19@ 20@ 
jump @Timer_02


:Timer_04
0AB1: call_scm_func @StopTimer 1 VARNUMBER = 33
00BE: text_clear_all
02A8: 21@ = create_marker 60 at 18@ 19@ 20@

:Camera_Table
....




Спойлер:
...

I can not see the script, a posting error must have happend. )))

View user profile http://gtamodding.com

41 Re: Mission Question on Wed Jul 22, 2009 5:36 am

You mean the one I posted I see it fine did you click on it?

View user profile

42 Re: Mission Question on Wed Jul 22, 2009 6:45 am




You mean the one I posted I see it fine did you click on it?



Спасибо, yes. It's OK now though. I can see it fine in Firefox, but not in Opera.

1. Don't load the special actors with 0248 load them with 023D.



Code:

while true
if or
      023D:  special_actor 1 loaded
      023D:  special_actor 2 loaded
    then
        break
        end
      wait 0
    end


2. Replace global $GETTHERECAR with a local.

3. The consturction of the script does not look nice, use break, continue, etc,


Code:

if
$currentactor.dead
jf continue // 'continue' это внутренняя метка в начале цикла


when you finish this MOD and if you release the source to the public.

4. Why do you set weather to go foggy again?


Code:

set_weather 9


5. Jumps that go on to the next label right after = useless.

6. In the table 0039: 1@ == 2 is the same number over again, so what? This is wrong. If you plan for him to spawn randomly use a init jump table.

7. Who's actor 0@? Does he not get destroyed at the top of the script? ... so why does his var appear later in the script, as him shooting?

8. $998? This means ...

9. Many things which do not make sence, I know this is because your not finished yet and your taking parts from other scripts, and have not changed them yet. Re-post the code when you feel comfortable with it. Then we can fix the silly mistakes.

10. You can release the models in the script as soon at there not needed anymore,


Code:

0249: release_model #model


it can be done right away, for example right after Car.Create.


Code:

Car.RemoveReferences()


You can remove the reference once you no longer need the actor/car/object.




View user profile http://gtamodding.com

43 Re: Mission Question on Wed Jul 22, 2009 10:30 am

That status text looks complicated did you do it a different way in the bigfoot script for X-files II?

View user profile

44 Re: Mission Question on Wed Jul 22, 2009 10:37 am

_CJ360_ wrote:That status text looks complicated did you do it a different way in the bigfoot script for X-files II?



Yes, I used global variables a year ago. And no such method existed, so this was my only choice. If you feel that you would rather use the "normal" way, you can. It just is not as recomended that's all. If you want I can make some example CLEO scripts using this "CLEO-timer" method to show you some more on how it works. Grin Smile

View user profile http://gtamodding.com

45 Re: Mission Question on Wed Jul 22, 2009 10:50 am

Yes that would realy help

View user profile

46 Re: Mission Question on Wed Jul 22, 2009 11:16 am



Timer lasts for 10 seconds.


Code:

{$CLEO}
0000:

while true
wait 250
if
  Player.Defined($PLAYER_CHAR)
then   
    if
        00E1:  player 0 pressed_key 11 // Yes / Да
      then
          Break
        end
    end
end
   
   
33@ = 10000
0AB1: call_scm_func @SetTimer 3 VARNUMBER = 33 TYPE = 1 GXT = @StatusText   
0A93: end_custom_thread 
   
   
   
   
    :SetTimer
    0AB1: call_scm_func @__VarToOffset 1 0@ 0@
    0AB1: call_scm_func @__LabelToOffset 1 2@ 2@
    0AA6: call_method 0x0044CD50 struct 0x00BA1788 num_params 3 pop 0 ( TYPE = 1@ GXT = 2@ VARNUMBER = 0@ )
    0AB2: ret 0

 

    :__VarToOffset
    0A9F: 1@ = current_thread_pointer
    0A8E: 2@ = 1@ + 0xDC // mission Flag
    0A8D: 2@ = read_memory 2@ size 1 virtual_protect 0
    if
        2@ == 1
    then
        1@ = 0x00A48960 // mission locals
    else
        1@ += 0x3C
    end
    0@ *= 4
    005A: 1@ += 0@ // address of the local variable
    1@ -= 0xA49960
    0AB2: ret 1 1@

    :__LabelToOffset
    if
        0@ == 0
    then
        0AB2: ret 1 0
    end
    0A9F: 1@ = current_thread_pointer
    1@ += 0x10
    0A8D: 1@ = read_memory 1@ size 4 virtual_protect 0 // baseIP
    0062: 1@ -= 0@ // label address
    1@ += 3
    0AB2: ret 1 1@

    :StatusText
    0900: 'BB_19'
    0000:


View user profile http://gtamodding.com

47 Re: Mission Question on Thu Jul 23, 2009 3:29 am

K but I'm still confused about
Code:
:StatusText
    0900: 'BB_19'
    0000:
And why do you end it here?
Code:
0AB1: call_scm_func @SetTimer 3 VARNUMBER = 33 TYPE = 1 GXT = @StatusText 
0A93: end_custom_thread
And
Code:
33@ = 10000
Thats how long the timer is for right?

View user profile

48 Re: Mission Question on Thu Jul 23, 2009 4:08 am




K but I'm still confused about

The GXT entry of the text near the timer, and just a null-terminator.

http://en.wikipedia.org/wiki/Null_terminator


And why do you end it here?

Because the code is used as a SCM function, therefore it is needed to end it there. The SCM-function has already read what is below the 0A93 opcode.

http://www.gtamodding.com/index.php?title=0AB1


33@ = 10000

Yeah, ms in time.

View user profile http://gtamodding.com

49 Re: Mission Question on Thu Jul 23, 2009 4:25 am

Okay so where does it make the 10 that you see in-game?

View user profile

50 Re: Mission Question on Thu Jul 23, 2009 4:49 am



On the side of the screen just like a normal timer.

free image host

View user profile http://gtamodding.com

51 Re: Mission Question Today at 7:55 pm

Sponsored content


View previous topic View next topic Back to top  Message [Page 2 of 4]

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

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