Quantcast

Jump to content

» «
Photo

Your most complex structures!

7 replies to this topic
gtasearcher
  • gtasearcher

    No sh*t.

  • Members
  • Joined: 26 Aug 2008

#1

Posted 06 May 2009 - 05:37 PM

Mine is
CODE
REPEAT
WAIT 0
0209: 22@ = random_int_in_ranges 41407 41409
if
Actor.Dead(6@)
then
7@s = 'TTIOT38'
jump @4
end
20@ = Actor.Health(6@)
0A91: $CLEO_TTIOT_TRUTH_HEALTH = 20@ / 5 // int
03C4: set_status_text $CLEO_TTIOT_TRUTH_HEALTH type 1 GXT 'TTIOT4' // global_variable  // Score ~1~
IF
80F2:   not actor $PLAYER_ACTOR near_actor 6@ radius 25.0 25.0 0
then
03CF: load_wav 22@ as 1
repeat
wait 0
until 03D0:   wav 1 loaded
if
22@ == 41407
then
23@s = 'TTIOT12'
end
if
22@ == 41408
then
23@s = 'TTIOT13'
end
if
22@ == 41409
then
23@s == 'TTIOT14'
end
0949: link_wav 1 to_actor $PLAYER_ACTOR
03D1: play_wav 1
06C9: remove_actor 6@ from_group
repeat
wait 0
00BC: show_text_highpriority GXT 23@s time 1 flag 1  // ~s~Come back between 9:00 and 17:00.
if
Actor.Dead(6@)
then
7@s = 'TTIOT38'
jump @4
end
20@ = Actor.Health(6@)
0A91: $CLEO_TTIOT_TRUTH_HEALTH = 20@ / 5 // int
03C4: set_status_text $CLEO_TTIOT_TRUTH_HEALTH type 1 GXT 'TTIOT4' // global_variable  // Score ~1~
if
00F2:   actor $PLAYER_ACTOR near_actor 6@ radius 20.0 20.0 0
then
jump @HIGH_LEVEL
end
until 03D2:   wav 1 ended
repeat
wait 0
if
Actor.Dead(6@)
then
7@s = 'TTIOT38'
jump @4
end
20@ = Actor.Health(6@)
0A91: $CLEO_TTIOT_TRUTH_HEALTH = 20@ / 5 // int
03C4: set_status_text $CLEO_TTIOT_TRUTH_HEALTH type 1 GXT 'TTIOT4' // global_variable  // Score ~1~
until 00F2: actor $PLAYER_ACTOR near_actor 6@ radius 20.0 20.0 0
jump @HIGH_LEVEL                                                                                        

:HIGH_LEVEL
0631: put_actor 6@ in_group $PLAYER_GROUP
repeat
wait 0
if
Actor.Dead(6@)
then
7@s = 'TTIOT38'
jump @4
end
20@ = Actor.Health(6@)
0A91: $CLEO_TTIOT_TRUTH_HEALTH = 20@ / 5 // int
03C4: set_status_text $CLEO_TTIOT_TRUTH_HEALTH type 1 GXT 'TTIOT4' // global_variable  // Score ~1~
UNTIL 03D2:   wav 1 ended
040D: unload_wav 1
end
until 0202:   actor $PLAYER_ACTOR near_car 5@ radius 15.0 15.0 flag 0
If you don't understand it, take a look here.
- = repeat...until
* = if...then...end
CODE
---------
REPEAT
WAIT 0
0209: 22@ = random_int_in_ranges 41407 41409
*************
if
Actor.Dead(6@)
then
7@s = 'TTIOT38'
jump @4
end
*************
20@ = Actor.Health(6@)
0A91: $CLEO_TTIOT_TRUTH_HEALTH = 20@ / 5 // int
03C4: set_status_text $CLEO_TTIOT_TRUTH_HEALTH type 1 GXT 'TTIOT4' // global_variable  // Score ~1~
*************
IF
80F2:   not actor $PLAYER_ACTOR near_actor 6@ radius 25.0 25.0 0
then
03CF: load_wav 22@ as 1
-----------------
repeat
wait 0
until 03D0:   wav 1 loaded
-----------------
*************
if
22@ == 41407
then
23@s = 'TTIOT12'
end
************
************
if
22@ == 41408
then
23@s = 'TTIOT13'
end
***********
***********
if
22@ == 41409
then
23@s == 'TTIOT14'
end
**********
0949: link_wav 1 to_actor $PLAYER_ACTOR
03D1: play_wav 1
06C9: remove_actor 6@ from_group
-------------
repeat
wait 0
00BC: show_text_highpriority GXT 23@s time 1 flag 1  // ~s~Come back between 9:00 and 17:00.
**********
if
Actor.Dead(6@)
then
7@s = 'TTIOT38'
jump @4
end
*********
20@ = Actor.Health(6@)
0A91: $CLEO_TTIOT_TRUTH_HEALTH = 20@ / 5 // int
03C4: set_status_text $CLEO_TTIOT_TRUTH_HEALTH type 1 GXT 'TTIOT4' // global_variable  // Score ~1~
*********
if
00F2:   actor $PLAYER_ACTOR near_actor 6@ radius 20.0 20.0 0
then
jump @HIGH_LEVEL
end
********
until 03D2:   wav 1 ended
--------------
-------------
repeat
wait 0
***********
if
Actor.Dead(6@)
then
7@s = 'TTIOT38'
jump @4
end
**********
20@ = Actor.Health(6@)
0A91: $CLEO_TTIOT_TRUTH_HEALTH = 20@ / 5 // int
03C4: set_status_text $CLEO_TTIOT_TRUTH_HEALTH type 1 GXT 'TTIOT4' // global_variable  // Score ~1~
until 00F2: actor $PLAYER_ACTOR near_actor 6@ radius 20.0 20.0 0
jump @HIGH_LEVEL                                                                                        

:HIGH_LEVEL
0631: put_actor 6@ in_group $PLAYER_GROUP
--------------
repeat
wait 0
*********
if
Actor.Dead(6@)
then
7@s = 'TTIOT38'
jump @4
end
*********
20@ = Actor.Health(6@)
0A91: $CLEO_TTIOT_TRUTH_HEALTH = 20@ / 5 // int
03C4: set_status_text $CLEO_TTIOT_TRUTH_HEALTH type 1 GXT 'TTIOT4' // global_variable  // Score ~1~
UNTIL 03D2:   wav 1 ended
040D: unload_wav 1
end
*********
until 0202:   actor $PLAYER_ACTOR near_car 5@ radius 15.0 15.0 flag 0
------------

Which is yours? sly.gif

coin-god
  • coin-god

    High Roller

  • $outh $ide Hoodz
  • Joined: 18 Mar 2007
  • None

#2

Posted 06 May 2009 - 07:27 PM

I would have to post my mission code of my Zombie Mod.

But its private. ph34r.gif

ZAZ
  • ZAZ

    Kernlochbohrer

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

#3

Posted 06 May 2009 - 08:56 PM

QUOTE (gtasearcher @ May 6 2009, 17:37)

Which is yours? sly.gif

you wont read it

Dutchy3010
  • Dutchy3010

    Female SCM coder!

  • Moderator
  • Joined: 30 Jul 2006
  • Netherlands
  • Best Script 2013 [DYOM]
    Best Script 2012 [DYOM]

#4

Posted 06 May 2009 - 11:03 PM Edited by Dutchy3010, 06 May 2009 - 11:39 PM.

This is one of the DYOM structures. Of course it isn't the biggest, because those were way to big to post here (some over 900 lines).

CODE
var
 $idx : integer
 $count : integer
 $buffer : integer
 $ready : integer
end  
0085: 1@ = $TEXTCUR
0085: 2@ = 1@
$ready = 0
$count = 0
gosub @TEXT_clear
repeat
   wait 10    
   // A-Z, a-z
   for $idx = 65 to 90
     if and
       0AB0:  key_pressed $idx
       not $count == $TEXTMAX
     then
       0084: $buffer = $idx
       if 8AB0: not key_pressed 16
       then
         $buffer += 32
       end
       0A8C: write_memory 1@ size 1 value $buffer virtual_protect 0
       1@ += 1  
       0A8C: write_memory 1@ size 1 value 0 virtual_protect 0
       $count += 1
       repeat
         wait 0
       until 8AB0: not key_pressed $idx
     end
   end
   // 0- 9
   for $idx = 48 to 57
     if and
       0AB0:  key_pressed $idx
       not $count == $TEXTMAX
     then
       0A8C: write_memory 1@ size 1 value $idx virtual_protect 0
       1@ += 1  
       0A8C: write_memory 1@ size 1 value 0 virtual_protect 0
       $count += 1
       repeat
         wait 0
       until 8AB0: not key_pressed $idx
     end
   end
   // Space
   if and
       0AB0:  key_pressed 32
       not $count == $TEXTMAX
   then
       0A8C: write_memory 1@ size 1 value 32 virtual_protect 0
       1@ += 1  
       0A8C: write_memory 1@ size 1 value 95 virtual_protect 0
       1@ += 1  
       0A8C: write_memory 1@ size 1 value 0 virtual_protect 0
       1@ -= 1  
        $count += 1
       repeat
         wait 0
       until 8AB0: not key_pressed 32
   end
   // ,
   if and
       0AB0:  key_pressed 188
       not $count == $TEXTMAX
   then
       0A8C: write_memory 1@ size 1 value 44 virtual_protect 0
       1@ += 1  
       0A8C: write_memory 1@ size 1 value 0 virtual_protect 0
       $count += 1
       repeat
         wait 0
       until 8AB0: not key_pressed 188
   end
   // .
   if and
       0AB0:  key_pressed 190
       not $count == $TEXTMAX
   then
       0A8C: write_memory 1@ size 1 value 46 virtual_protect 0
       1@ += 1  
       0A8C: write_memory 1@ size 1 value 0 virtual_protect 0
       $count += 1
       repeat
         wait 0
       until 8AB0: not key_pressed 190
   end
   // ~
   if and
       0AB0:  key_pressed 192
       0AB0:  key_pressed 16
       not $count == $TEXTMAX
   then
       0A8C: write_memory 1@ size 1 value 126 virtual_protect 0
       1@ += 1  
       0A8C: write_memory 1@ size 1 value 0 virtual_protect 0
       $count += 1
       repeat
         wait 0
       until 8AB0: not key_pressed 192
   end
   // backspace
   if 0AB0:  key_pressed 8
   then
       1@ -= 1  
       0A8C: write_memory 1@ size 1 value 95 virtual_protect 0
       $count -= 1
       repeat
         wait 0
       until 8AB0: not key_pressed 8
   end
   // return
   if 0AB0:  key_pressed 13
   then
       0A8C: write_memory 1@ size 1 value 0 virtual_protect 0
       $ready = 1
       repeat
         wait 0
       until 8AB0: not key_pressed 13
   end
   
   if 803B:   not  1@ == 2@ // (int)
   then
     gosub @TEXT_show_perm
     0085: 2@ = 1@
   end    
until $ready == 1
03E6: remove_text_box
return

trickstar34
  • trickstar34

    ATM, Money

  • BUSTED!
  • Joined: 14 Dec 2008

#5

Posted 08 May 2009 - 08:31 PM Edited by trickstar34, 29 May 2009 - 11:12 PM.

mine so far is the code to the Verdant Meadows oddjob to my GTA: San Andreas Empire Mode mod. But like goin-god, I like to keep my codes as private as possible.

EDIT: I'm going to have to change my answer, my Your The Cop mod definately is my most complex (5000+ lines)

james227uk
  • james227uk

    One Spartan Army

  • Andolini Mafia Family
  • Joined: 05 Feb 2008

#6

Posted 08 May 2009 - 08:50 PM Edited by james227uk, 08 May 2009 - 10:02 PM.

I don't really make high level constructions; I only use them when it's neccesary to use them.

@Trickstar34

A mod as simple as that is not really worth it. Besides, lots of people could learn from it

trickstar34
  • trickstar34

    ATM, Money

  • BUSTED!
  • Joined: 14 Dec 2008

#7

Posted 08 May 2009 - 09:05 PM

I'm talking about v2 (which hasnt been released yet), your thinking of my v1, which is just a code to cause payouts. My v1.5 has 2 missions. My v2 will have 5 which Verdant Meadows is my most complex. It has over 1000 lines of code which I'm trying to decrease before it is released.

Now out of my uploaded scripts, it would be v1.5's Doherty Garage oddjob (although not too complex), which will be even more complex before v2 release.

While I'm talking about my mod, v1 has a unlimited payout bug which I fixed in v1.5, so to anyone who downloaded it, I suggest you remove v1 (unless your trying to get max money) and install v1.5 until either the possible v1.6 or v2.0 are released.

Just to let you know that was still kind of on topic because I was simply discribing my mod and making suggestions towards people interested in it.

Wesser
  • Wesser

    The complexity simplifier, the efficiency optimizer.

  • Feroci Racing
  • Joined: 19 Aug 2006
  • Unknown

#8

Posted 04 August 2009 - 02:19 PM

This is mine I made some times ago which I forgot to post. It will be useful to create a reload system by pressing a key.
CODE

{$CLEO}

0000: NOP

while true
 wait 0
 if
 0256:  player $PLAYER_CHAR defined
 then
   if
   8118:  not actor $PLAYER_ACTOR dead
   then
     0581: enable_radar 0
     03F0: enable_text_draw 1
     0A96: 0@ = actor $PLAYER_ACTOR struct
     000A: 0@ += 0x718
     0A8D: 8@ = read_memory 0@ size 1 virtual_protect 0 // GetCurrentSlot
     0A96: 0@ = actor $PLAYER_ACTOR struct
     000A: 0@ += 0x5A0
     8@ *= 0x1C
     005A: 0@ += 8@ // (int)
     000A: 0@ += 0x08
     0A8D: 1@ = read_memory 0@ size 4 virtual_protect 0 // GetClipAmmo
     0470: 9@ = actor $PLAYER_ACTOR current_weapon
     0085: 0@ = 9@ // (int)
     0012: 0@ *= 0x70
     000A: 0@ += 0xC8AAB8
     000A: 0@ += 0x20
     0A8D: 7@ = read_memory 0@ size 2 virtual_protect 0 // GetMaxClipAmmo
     0085: 6@ = 7@ // (int)
     0093: 7@ = integer 7@ to_float
     041A: 3@ = actor $PLAYER_ACTOR weapon 9@ ammo
     0085: 2@ = 3@ // (int)
     0062: 2@ -= 1@ // (int)
     0085: 4@ = 2@ // (int)
     0093: 4@ = integer 4@ to_float
     0073: 4@ /= 7@ // (float)
     0087: 5@ = 4@ // (float)
     0092: 5@ = float 5@ to_integer
     0093: 5@ = integer 5@ to_float
     0063: 5@ -= 4@ // (float)
     0087: 10@ = 7@ // (float)
     10@ *= -1.0
     006B: 5@ *= 10@ // (float)
     5@ *= 1.05
     0092: 4@ = float 4@ to_integer
     0092: 5@ = float 5@ to_integer
     0062: 6@ -= 1@ // (int)
     0092: 7@ = float 7@ to_integer
     if
       5@ > 0
     then
       4@ += 1
     end
     gosub @DrawTextFormat
     033E: set_draw_text_position 32.0 300.0 GXT 'AMMO_1' // Ammo in clip
     gosub @DrawTextNumberFormat
     045A: draw_text_1number 200.0 300.0 GXT 'NUMBER' number 1@ // ~1~ // AmmoInClip
     gosub @DrawTextFormat
     033E: set_draw_text_position 32.0 320.0 GXT 'AMMO_2' // Other clip ammo
     gosub @DrawTextNumberFormat
     045A: draw_text_1number 200.0 320.0 GXT 'NUMBER' number 2@ // ~1~ // OtherClipAmmo
     gosub @DrawTextFormat
     033E: set_draw_text_position 32.0 340.0 GXT 'AMMO_3' // Total clip ammo
     gosub @DrawTextNumberFormat
     045A: draw_text_1number 200.0 340.0 GXT 'NUMBER' number 3@ // ~1~ // TotalClipAmmo
     gosub @DrawTextFormat
     033E: set_draw_text_position 32.0 360.0 GXT 'AMMO_4' // Clips
     gosub @DrawTextNumberFormat
     045A: draw_text_1number 200.0 360.0 GXT 'NUMBER' number 4@ // ~1~ // TotalClips (1 clip = ? bullet\s)
     gosub @DrawTextFormat
     033E: set_draw_text_position 32.0 380.0 GXT 'AMMO_5' // Last clip ammo remaining
     gosub @DrawTextNumberFormat
     045A: draw_text_1number 200.0 380.0 GXT 'NUMBER' number 5@ // ~1~ // LastClipAmmoRemaining
     gosub @DrawTextFormat
     033E: set_draw_text_position 32.0 400.0 GXT 'AMMO_6' // Clip ammo fired
     gosub @DrawTextNumberFormat
     045A: draw_text_1number 200.0 400.0 GXT 'NUMBER' number 6@ // ~1~ // ClipAmmoFired
     gosub @DrawTextFormat
     033E: set_draw_text_position 32.0 420.0 GXT 'AMMO_7' // Max clip ammo
     gosub @DrawTextNumberFormat
     045A: draw_text_1number 200.0 420.0 GXT 'NUMBER' number 7@ // ~1~ // MaxClipAmmo
   end
 end
end

:DrawTextFormat
0341: unknown_text_draw_flag 0
033F: set_text_draw_letter_size 0.4 1.8
0340: set_text_draw_RGBA 255 255 255 255
return

:DrawTextNumberFormat
0341: unknown_text_draw_flag 0
033F: set_text_draw_letter_size 0.4 1.8
0340: set_text_draw_RGBA 0 177 0 255
return

CODE
#
# filename: bullet.fxt
# description: this file contains all cleo texts of the mod named bullet.cs.
#
#format is
# entry name <space> entry value
#
# entry name:  name of gxt entry read by scm
# entry value: name of gxt value where the text is stored
#
AMMO_1 Ammo in clip
AMMO_2 Other clip ammo
AMMO_3 Total clip ammo
AMMO_4 Clips
AMMO_5 Last clip ammo rem.
AMMO_6 Clip ammo fired
AMMO_7 Max clip ammo




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users