Difference between revisions of "Clothes pickup"
Jump to navigation
Jump to search
(added alternate format) |
|||
Line 1: | Line 1: | ||
− | This is a code snippet | + | 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 |
− | + | 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 | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | 055B: | ||
while true | while true | ||
wait 0 ms | wait 0 ms | ||
if | if | ||
− | + | PICKUP_PICKED_UP == 0 | |
then | then | ||
if | if | ||
− | 0214: pickup | + | 0214: pickup CLOTHES_1 picked_up |
then | then | ||
− | gosub @ | + | gosub @CLOTHES_FADE |
if | if | ||
0256: player $PLAYER_CHAR defined | 0256: player $PLAYER_CHAR defined | ||
then | then | ||
− | 0352: set_actor $PLAYER_ACTOR skin_to ' | + | 0352: set_actor $PLAYER_ACTOR skin_to 'CSJUGGZ' // set your character, see list of special actors (023C) |
end | end | ||
− | + | gosub @CLOTHES_CLEAR_WANTED | |
end | end | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
end | end | ||
end | end | ||
− | : | + | :CLOTHES_FADE |
− | + | PICKUP_PICKED_UP = 1 | |
if | if | ||
0256: player $PLAYER_CHAR defined | 0256: player $PLAYER_CHAR defined | ||
Line 159: | Line 43: | ||
end | end | ||
else | else | ||
− | + | 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 | ||
− | + | PICKUP_PICKED_UP = 0 | |
end | end | ||
return | return | ||
− | : | + | :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 | ||
− | + | 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 | ||
− | + | PICKUP_PICKED_UP = 0 | |
end | end | ||
− | return | + | return</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.