Difference between revisions of "Clothes pickup"

From GTAMods Wiki
Jump to navigation Jump to search
(added alternate format)
Line 1: Line 1:
This is a code snippet for a clothes pickup in [[Sanny Builder]]'s format for [[Vice City]]. This code is based on the clothes pickups in Vice City. Even the "no fall off bike" glitch works.
+
This is a code snippet of a '''clothes pickup''' in [[Sanny Builder]]'s format for [[Vice City]]. This code is based on the clothes pickup script in Vice City. Even the "no fall off bike" glitch works.
<source lang="scm" line>
+
<source lang="scm" line>// set constants
:CLOTHES
+
const
03A4: name_thread 'CLOTHES'
+
PICKUP_PICKED_UP = 0@
055B: 0@ = create_clothes_pickup 13 at 0.0 0.0 0.0 // set your pickup location
+
CLOTHES_1 = 1@
 
+
CLOTHES_1_TYPE = 13   // choose your type of clothing
:CLOTHES_34
+
CLOTHES_1_X = -966.0  // x position
0001: wait 0 ms
+
CLOTHES_1_Y = -855.5  // y position
00D6: if
+
CLOTHES_1_Z = 15.0   // z position
0038:  $1180 == 0
+
end
004D: jump_if_false @CLOTHES_34
 
00D6: if
 
0214:  pickup 0@ picked_up
 
004D: jump_if_false @CLOTHES_115
 
0050: gosub @CLOTHES_122
 
00D6: if
 
0256:   player $PLAYER_CHAR defined
 
004D: jump_if_false @CLOTHES_108
 
0352: set_actor $PLAYER_ACTOR skin_to 'PLAYER' // set your character, see list of special actors (023C)
 
 
 
:CLOTHES_108
 
0050: gosub @CLOTHES_244
 
 
 
:CLOTHES_115
 
{
 
//add more pickups by copying and pasting this section, remember to make adjustments and corrections
 
00D6: if
 
0214:  pickup 1@ picked_up // change pickup handle
 
004D: jump_if_false @Second_Pickup_End // change jump-to-skip
 
0050: gosub @CLOTHES_122
 
00D6: if
 
0256:  player $PLAYER_CHAR defined
 
004D: jump_if_false @Second_Pickup_Gosub // change jump-to-gosub
 
0352: set_actor $PLAYER_ACTOR skin_to 'PLAYER' // set your character, see list of special actors (023C)
 
 
 
:Second_Pickup_Gosub // change jump-to-gosub label
 
0050: gosub @CLOTHES_244
 
 
 
:Second_Pickup_End // change jump-to-skip label
 
}
 
0002: jump @CLOTHES_34
 
 
 
:CLOTHES_122
 
0004: $1180 = 1
 
00D6: if
 
0256:  player $PLAYER_CHAR defined
 
004D: jump_if_false @CLOTHES_191
 
0169: set_fade_color 0 0 1
 
016A: fade 0 500 ms
 
 
 
:CLOTHES_160
 
00D6: if
 
016B:  fading
 
004D: jump_if_false @CLOTHES_184
 
0001: wait 0 ms
 
0002: jump @CLOTHES_160
 
 
 
:CLOTHES_184
 
0002: jump @CLOTHES_198
 
 
 
:CLOTHES_191
 
0004: $1180 = 0
 
  
:CLOTHES_198
+
// create pickup
00D6: if
+
055B: CLOTHES_1 = create_clothes_pickup CLOTHES_1_TYPE at CLOTHES_1_X CLOTHES_1_Y CLOTHES_1_Z
0256:  player $PLAYER_CHAR defined
 
004D: jump_if_false @CLOTHES_235
 
03BF: set_player $PLAYER_CHAR ignored_by_everyone_to 1
 
01B4: set_player $PLAYER_CHAR frozen_state 0
 
0002: jump @CLOTHES_242
 
 
 
:CLOTHES_235
 
0004: $1180 = 0
 
 
 
:CLOTHES_242
 
0051: return
 
 
 
:CLOTHES_244
 
00D6: if
 
0256:  player $PLAYER_CHAR defined
 
004D: jump_if_false @CLOTHES_351
 
038B: load_requested_models
 
00D6: if
 
0256:  player $PLAYER_CHAR defined
 
004D: jump_if_false @CLOTHES_283
 
0353: refresh_actor $PLAYER_ACTOR
 
 
 
:CLOTHES_283
 
03BF: set_player $PLAYER_CHAR ignored_by_everyone_to 0
 
00D6: if
 
810F:  not player $PLAYER_CHAR wanted_level > 2
 
004D: jump_if_false @CLOTHES_313
 
0110: clear_player $PLAYER_CHAR wanted_level
 
 
 
:CLOTHES_313
 
01B4: set_player $PLAYER_CHAR frozen_state 1
 
0004: $1180 = 0
 
016A: fade 1 500 ms
 
03E5: text_box 'CLOHELP'  // Clean Clothes!!
 
0002: jump @CLOTHES_358
 
 
 
:CLOTHES_351
 
0004: $1180 = 0
 
 
 
:CLOTHES_358
 
0051: return
 
</source>
 
Look [[023C#Vice City|here]] for a list of available characters. Open the [[GXT]] file and search for <code>OUTFT13</code> to edit the name of the clothing pickup.
 
 
 
==Alternate format==
 
The following code is exactly the same as the code above. It is just formatted differently.
 
<source lang="scm" line>
 
:CLOTHES
 
03A4: name_thread 'CLOTHES'
 
055B: 0@ = create_clothes_pickup 13 at -1444.0 160.7 64.0 // set your pickup location
 
  
 
while true
 
while true
 
     wait 0 ms
 
     wait 0 ms
 
     if
 
     if
         $1180 == 0
+
         PICKUP_PICKED_UP == 0
 
     then
 
     then
 
         if
 
         if
             0214:  pickup 0@ picked_up
+
             0214:  pickup CLOTHES_1 picked_up
 
         then
 
         then
             gosub @CLOTHES_122
+
             gosub @CLOTHES_FADE
 
             if
 
             if
 
                 0256:  player $PLAYER_CHAR defined
 
                 0256:  player $PLAYER_CHAR defined
 
             then
 
             then
                 0352: set_actor $PLAYER_ACTOR skin_to 'PLAYER' // set your character, see list of special actors (023C)
+
                 0352: set_actor $PLAYER_ACTOR skin_to 'CSJUGGZ' // set your character, see list of special actors (023C)
 
             end
 
             end
        gosub @CLOTHES_244
+
            gosub @CLOTHES_CLEAR_WANTED
 
         end
 
         end
{
 
//add more pickups by copying and pasting this section, remember to make adjustments and corrections
 
        if
 
            0214:  pickup 1@ picked_up
 
        then
 
            gosub @CLOTHES_122
 
            if
 
                0256:  player $PLAYER_CHAR defined
 
            then
 
                0352: set_actor $PLAYER_ACTOR skin_to 'PLAYER' // set your character, see list of special actors (023C)
 
            end
 
        gosub @CLOTHES_244
 
        end
 
}
 
 
     end
 
     end
 
end
 
end
  
:CLOTHES_122
+
:CLOTHES_FADE
$1180 = 1
+
PICKUP_PICKED_UP = 1
 
if
 
if
 
     0256:  player $PLAYER_CHAR defined
 
     0256:  player $PLAYER_CHAR defined
Line 159: Line 43:
 
     end
 
     end
 
else
 
else
     $1180 = 0
+
     PICKUP_PICKED_UP = 0
 
end
 
end
 
if
 
if
Line 167: Line 51:
 
     01B4: set_player $PLAYER_CHAR frozen_state 0  
 
     01B4: set_player $PLAYER_CHAR frozen_state 0  
 
else
 
else
     $1180 = 0
+
     PICKUP_PICKED_UP = 0
 
end
 
end
 
return
 
return
  
:CLOTHES_244
+
:CLOTHES_CLEAR_WANTED
 
if
 
if
 
     0256:  player $PLAYER_CHAR defined
 
     0256:  player $PLAYER_CHAR defined
Line 188: Line 72:
 
     end
 
     end
 
     01B4: set_player $PLAYER_CHAR frozen_state 1  
 
     01B4: set_player $PLAYER_CHAR frozen_state 1  
     $1180 = 0
+
     PICKUP_PICKED_UP = 0
     fade 1 500 ms        
+
     fade 1 500 ms
 
     03E5: text_box 'CLOHELP'  // Clean Clothes!!
 
     03E5: text_box 'CLOHELP'  // Clean Clothes!!
 
else
 
else
     $1180 = 0
+
     PICKUP_PICKED_UP = 0
 
end
 
end
return
+
return</source>
</source>
+
Look [[023C#Vice City|here]] for a list of available characters. To use clothing type 13, open the [[GXT]] file and search for <code>OUTFT13</code> to edit the text of the clothing pickup.
 +
 
 
[[Category:Code Snippets]]
 
[[Category:Code Snippets]]

Revision as of 08:51, 9 December 2011

This is a code snippet of a clothes pickup in Sanny Builder's format for Vice City. This code is based on the clothes pickup script in Vice City. Even the "no fall off bike" glitch works.

// set constants
const
PICKUP_PICKED_UP = 0@
CLOTHES_1 = 1@
CLOTHES_1_TYPE = 13   // choose your type of clothing
CLOTHES_1_X = -966.0  // x position
CLOTHES_1_Y = -855.5  // y position
CLOTHES_1_Z = 15.0    // z position
end

// create pickup
055B: CLOTHES_1 = create_clothes_pickup CLOTHES_1_TYPE at CLOTHES_1_X CLOTHES_1_Y CLOTHES_1_Z

while true
    wait 0 ms
    if
        PICKUP_PICKED_UP == 0
    then
        if
            0214:   pickup CLOTHES_1 picked_up
        then
            gosub @CLOTHES_FADE
            if
                0256:   player $PLAYER_CHAR defined
            then
                0352: set_actor $PLAYER_ACTOR skin_to 'CSJUGGZ' // set your character, see list of special actors (023C)
            end
            gosub @CLOTHES_CLEAR_WANTED
        end
    end
end

:CLOTHES_FADE
PICKUP_PICKED_UP = 1
if
    0256:   player $PLAYER_CHAR defined
then
    0169: set_fade_color 0 0 1
    fade 0 500 ms
    while if 016B:   fading
        wait 0 ms
    end
else
    PICKUP_PICKED_UP = 0
end
if
    0256:   player $PLAYER_CHAR defined
then
    03BF: set_player $PLAYER_CHAR ignored_by_everyone_to 1
    01B4: set_player $PLAYER_CHAR frozen_state 0 
else
    PICKUP_PICKED_UP = 0
end
return

:CLOTHES_CLEAR_WANTED
if
    0256:   player $PLAYER_CHAR defined
then
    038B: load_requested_models
    if
        0256:   player $PLAYER_CHAR defined
    then
        0353: refresh_actor $PLAYER_ACTOR
    end
    03BF: set_player $PLAYER_CHAR ignored_by_everyone_to 0
    if
        810F:   not player $PLAYER_CHAR wanted_level > 2
    then
        0110: clear_player $PLAYER_CHAR wanted_level
    end
    01B4: set_player $PLAYER_CHAR frozen_state 1 
    PICKUP_PICKED_UP = 0
    fade 1 500 ms
    03E5: text_box 'CLOHELP'  // Clean Clothes!!
else
    PICKUP_PICKED_UP = 0
end
return

Look here for a list of available characters. To use clothing type 13, open the GXT file and search for OUTFT13 to edit the text of the clothing pickup.