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

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

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

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

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

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

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

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

» Hello/Guidance Request
Mission Question - Page 2 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



March 2024
MonTueWedThuFriSatSun
    123
45678910
11121314151617
18192021222324
25262728293031

Calendar Calendar


You are not connected. Please login or register

Mission Question

3 posters

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

Go down  Message [Page 2 of 4]

26Mission Question - Page 2 Empty Re: Mission Question Mon Jul 20, 2009 4:55 am

gtasbigfoot

gtasbigfoot
Admin



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?

http://gtamodding.com

27Mission Question - Page 2 Empty Re: Mission Question Mon Jul 20, 2009 6:12 am

_CJ360_

_CJ360_

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

28Mission Question - Page 2 Empty Re: Mission Question Mon Jul 20, 2009 9:48 am

gtasbigfoot

gtasbigfoot
Admin




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.

http://gtamodding.com

29Mission Question - Page 2 Empty Re: Mission Question Mon Jul 20, 2009 11:56 pm

_CJ360_

_CJ360_

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?

30Mission Question - Page 2 Empty Re: Mission Question Tue Jul 21, 2009 2:23 am

gtasbigfoot

gtasbigfoot
Admin



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


http://gtamodding.com

31Mission Question - Page 2 Empty Re: Mission Question Tue Jul 21, 2009 3:59 am

_CJ360_

_CJ360_

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

32Mission Question - Page 2 Empty Re: Mission Question Tue Jul 21, 2009 4:28 am

gtasbigfoot

gtasbigfoot
Admin



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.





http://gtamodding.com

33Mission Question - Page 2 Empty Re: Mission Question Tue Jul 21, 2009 4:32 am

_CJ360_

_CJ360_

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

34Mission Question - Page 2 Empty Re: Mission Question Tue Jul 21, 2009 4:34 am

gtasbigfoot

gtasbigfoot
Admin

http://gtamodding.com

35Mission Question - Page 2 Empty Re: Mission Question Tue Jul 21, 2009 4:36 am

_CJ360_

_CJ360_

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

36Mission Question - Page 2 Empty Re: Mission Question Tue Jul 21, 2009 4:47 am

gtasbigfoot

gtasbigfoot
Admin



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?

http://gtamodding.com

37Mission Question - Page 2 Empty Re: Mission Question Tue Jul 21, 2009 6:29 am

_CJ360_

_CJ360_

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

38Mission Question - Page 2 Empty Re: Mission Question Tue Jul 21, 2009 11:21 am

gtasbigfoot

gtasbigfoot
Admin




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

http://gtamodding.com

39Mission Question - Page 2 Empty Re: Mission Question Wed Jul 22, 2009 12:29 am

_CJ360_

_CJ360_

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

40Mission Question - Page 2 Empty Re: Mission Question Wed Jul 22, 2009 3:37 am

gtasbigfoot

gtasbigfoot
Admin



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

http://gtamodding.com

41Mission Question - Page 2 Empty Re: Mission Question Wed Jul 22, 2009 5:36 am

_CJ360_

_CJ360_

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

42Mission Question - Page 2 Empty Re: Mission Question Wed Jul 22, 2009 6:45 am

gtasbigfoot

gtasbigfoot
Admin




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.




http://gtamodding.com

43Mission Question - Page 2 Empty Re: Mission Question Wed Jul 22, 2009 10:30 am

_CJ360_

_CJ360_

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

44Mission Question - Page 2 Empty Re: Mission Question Wed Jul 22, 2009 10:37 am

gtasbigfoot

gtasbigfoot
Admin

_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

http://gtamodding.com

45Mission Question - Page 2 Empty Re: Mission Question Wed Jul 22, 2009 10:50 am

_CJ360_

_CJ360_

Yes that would realy help

46Mission Question - Page 2 Empty Re: Mission Question Wed Jul 22, 2009 11:16 am

gtasbigfoot

gtasbigfoot
Admin



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:


http://gtamodding.com

47Mission Question - Page 2 Empty Re: Mission Question Thu Jul 23, 2009 3:29 am

_CJ360_

_CJ360_

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?

48Mission Question - Page 2 Empty Re: Mission Question Thu Jul 23, 2009 4:08 am

gtasbigfoot

gtasbigfoot
Admin




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.

http://gtamodding.com

49Mission Question - Page 2 Empty Re: Mission Question Thu Jul 23, 2009 4:25 am

_CJ360_

_CJ360_

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

50Mission Question - Page 2 Empty Re: Mission Question Thu Jul 23, 2009 4:49 am

gtasbigfoot

gtasbigfoot
Admin



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

free image host

http://gtamodding.com

Sponsored content



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