Quantcast

Jump to content

» «
Photo

Changing your player's character

9 replies to this topic
daniHCF96
  • daniHCF96

    Sanit

  • Members
  • Joined: 21 Sep 2013
  • Spain

#1

Posted 12 October 2013 - 07:21 PM

Hi, i just wanted to know what to do to changing the default GTA SA character or actor (CJ) to another special actor for example Ryder or Pulaski... I don't know if it's this line:

 

0053: $PLAYER_CHAR = create_player #NULL at 2488.562 -1666.865 12.8757

 

I already trying to change the #NULL to #TENPEN to make the character be tenpenny, but it doesen't work. Maybe i need to change another line too


fastman92
  • fastman92

    фастман92 | ف

  • Members
  • Joined: 28 Jul 2009
  • None
  • Contribution Award [Mods]

#2

Posted 12 October 2013 - 08:42 PM Edited by fastman92, 12 October 2013 - 08:44 PM.

{$CLEO}
const
SPECIAL_ACTOR_MODEL_NAME = 'SWEET'
KEY = 34    // page down
end

0000: NOP

:replacePlayerToSpecialActor
wait 0
if
0AB0:   key_pressed KEY  // 0 zero
else_jump @replacePlayerToSpecialActor
023C: load_special_actor SPECIAL_ACTOR_MODEL_NAME as 1 // models 290-299

    while 823D:   not special_actor 1 loaded 
        wait 0
    end
    
09C7: change_player $PLAYER_CHAR model_to #SPECIAL01
wait 500

:restorePlayerModel
wait 0
if
0AB0:   key_pressed KEY
else_jump @restorePlayerModel
0296: unload_special_actor 1
09C7: change_player $PLAYER_CHAR model_to #NULL
wait 500
jump @replacePlayerToSpecialActor
Press (page down) to change player to special actor Sweet and to restore CJ's appearance accordingly.

daniHCF96
  • daniHCF96

    Sanit

  • Members
  • Joined: 21 Sep 2013
  • Spain

#3

Posted 12 October 2013 - 09:44 PM

I don't think that's really what i'm looking for, i don't want to press a key and then change to Sweet, i want to start the game being sweet, without having the possibility of changing character


fastman92
  • fastman92

    фастман92 | ف

  • Members
  • Joined: 28 Jul 2009
  • None
  • Contribution Award [Mods]

#4

Posted 12 October 2013 - 10:53 PM Edited by fastman92, 12 October 2013 - 10:53 PM.

I don't think that's really what i'm looking for, i don't want to press a key and then change to Sweet, i want to start the game being sweet, without having the possibility of changing character

Do it yourself.

Load actor, replace CJ to that actor...
End custom thread.

daniHCF96
  • daniHCF96

    Sanit

  • Members
  • Joined: 21 Sep 2013
  • Spain

#5

Posted 12 October 2013 - 11:21 PM

 

I don't think that's really what i'm looking for, i don't want to press a key and then change to Sweet, i want to start the game being sweet, without having the possibility of changing character

Do it yourself.

Load actor, replace CJ to that actor...
End custom thread.

 

 

I tried this:

 

 

var
 $PLAYER_CHAR: Player
    end // var
03A4: name_thread 'MAIN'
01F0: set_max_wanted_level_to 6
0111: toggle_wasted_busted_check 0
00C0: set_current_time_hours_to 8 minutes_to 0
04E4: unknown_refresh_game_renderer_at 2488.562 -1666.865
03CB: set_rendering_origin_at 2488.562 -1666.865 13.3757   
0053: $PLAYER_CHAR = create_player #NULL at 2488.562 -1666.865 12.8757
023C: load_special_actor 'TENPEN' s 1
038B: load_requested_models
while 823D: NOT special_actor 1 loaded
      0001: wait 0 ms
    end
09C7: change_player $PLAYER_CHAR model_to #SPECIAL01
0001: wait 500 ms

 

 

But when starting the game, CJ spawns at Ganton, and with a really strange texture, deformed,


ZAZ
  • ZAZ

    Kernlochbohrer

  • Feroci
  • Joined: 10 Jan 2005
  • European-Union
  • Contribution Award [Mods]
    Helpfulness Awards [Mods]

#6

Posted 13 October 2013 - 01:21 PM Edited by ZAZ, 13 October 2013 - 01:38 PM.

I tried this:

 

 

var
 $PLAYER_CHAR: Player
    end // var
03A4: name_thread 'MAIN'
01F0: set_max_wanted_level_to 6
0111: toggle_wasted_busted_check 0
00C0: set_current_time_hours_to 8 minutes_to 0
04E4: unknown_refresh_game_renderer_at 2488.562 -1666.865
03CB: set_rendering_origin_at 2488.562 -1666.865 13.3757   
0053: $PLAYER_CHAR = create_player #NULL at 2488.562 -1666.865 12.8757
023C: load_special_actor 'TENPEN' s 1
038B: load_requested_models
while 823D: NOT special_actor 1 loaded
      0001: wait 0 ms
    end
09C7: change_player $PLAYER_CHAR model_to #SPECIAL01
0001: wait 500 ms

 

 

But when starting the game, CJ spawns at Ganton, and with a really strange texture, deformed,

 

 

the script works for me as it should, there's missing something but it works, player appears as Tenpeny

(cleo wasn't installed, with cleo it crashed)

 

the whole script:

DEFINE OBJECTS 1
DEFINE OBJECT SANNY BUILDER 3.09      
DEFINE MISSIONS 0
DEFINE EXTERNAL_SCRIPTS -1 // Use -1 in order not to compile AAA script
DEFINE UNKNOWN_EMPTY_SEGMENT 0
DEFINE UNKNOWN_THREADS_MEMORY 0
//
var
 $PLAYER_CHAR: Player
    end // var
03A4: name_thread 'MAIN'
01F0: set_max_wanted_level_to 6
0111: toggle_wasted_busted_check 0
00C0: set_current_time_hours_to 8 minutes_to 0
04E4: unknown_refresh_game_renderer_at 2488.562 -1666.865
03CB: set_rendering_origin_at 2488.562 -1666.865 13.3757   
0053: $PLAYER_CHAR = create_player #NULL at 2488.562 -1666.865 12.8757
023C: load_special_actor 'TENPEN' s 1
038B: load_requested_models
while 823D: NOT special_actor 1 loaded
      0001: wait 0 ms
    end
09C7: change_player $PLAYER_CHAR model_to #SPECIAL01
0001: wait 500 ms
 
 
016A: fade 1 time 0  
004E: end_thread

Silent
  • Silent

    Chief Fixing Officer

  • GTA Mods Staff
  • Joined: 01 Feb 2010
  • Poland
  • Contribution Award [Mods]
    Best Script/Plugin 2014 [SilentPatch]
    Most Respected 2014
    Most Helpful [Mods] 2014
    Most Helpful [GTA] 2013
    Most Helpful [Mods] 2013
    Most Talented [Modding] 2013
    Best Map 2013 [ViceCityStories PC Edition]
    Best Vehicle 2013 [III Aircraft]
    Most Helpful [Mods] 2012
    Modder of the Year 2012

#7

Posted 13 October 2013 - 01:33 PM

You may aswell release the model (or rather mark is as no longer needed afterwards) + 038B makes 023D check loop useless.

Random fact, as special actors' slots are often used in missions, using a custom code (CLEO required) to change actor's model may be the best idea:

http://www.gta-mods....a-modelu-gracza

For the code, check Dla zaawansowanych section. This
:NAZWA_MODELU
0662: NOP "nazwa_modelu"
0000: NOP
should contain a name of the model you want to set CJ to - in your case, 0662: should hold "TENPEN".

daniHCF96
  • daniHCF96

    Sanit

  • Members
  • Joined: 21 Sep 2013
  • Spain

#8

Posted 14 October 2013 - 05:15 PM

You may aswell release the model (or rather mark is as no longer needed afterwards) + 038B makes 023D check loop useless.

Random fact, as special actors' slots are often used in missions, using a custom code (CLEO required) to change actor's model may be the best idea:

http://www.gta-mods....a-modelu-gracza

For the code, check Dla zaawansowanych section. This

:NAZWA_MODELU
0662: NOP "nazwa_modelu"
0000: NOP
should contain a name of the model you want to set CJ to - in your case, 0662: should hold "TENPEN".

 

 

Maaan i'm still having problems with this, the game continues crashing after the bar loads... I used google translator to translate the website, and used the custom code:

 

.......

.......

0053: $PLAYER_CHAR = create_player #NULL at 2485.22 -1672.941 13.73
07AF: $PLAYER_GROUP = player $PLAYER_CHAR group

:ChangePlayerModel
0A9F: 2@ = current_thread_pointer
000A: 2@ += 0x10
0A8D: 2@ = read_memory 2@ size 4 virtual_protect 0
0062: 2@ -= 1@
000A: 2@ += 0x4
for  3@ = 0  to  7
    0A8E: 4@ = 2@ + 3@
    0A8D: 5@ = read_memory 4@ size 1 virtual_protect 0
    if  and
        0029:   5@ >= 0x41
        002B:   0x5A >= 5@
    then
         000A: 5@ += 0x20
        0A8C: write_memory 4@ size 1 value 5@ virtual_protect 0
    end
end
0AA5: call 0x409D10 num_params 3 pop 3 26 2@ 0
038B: load_requested_models
if  0039:   0@ == 0
then  008B: 2@ = $PLAYER_ACTOR
else  008B: 2@ = $SECOND_PLAYER_ACTOR
end
0A96: 2@ = actor 2@ struct
0A8E: 3@ = 2@ + 0x4D4
0A8D: 4@ = read_memory 2@ size 4 virtual_protect 0
0A8D: 5@ = read_memory 3@ size 4 virtual_protect 0
0A8E: 6@ = 4@ + 0x20
0A8D: 6@ = read_memory 6@ size 4 virtual_protect 0
0AA6: call_method 6@ struct 2@ num_params 0 pop 0
0A8E: 7@ = 2@ + 0x22
0A8C: write_memory 7@ size 2 value 0xFFFF virtual_protect 0
0A8E: 8@ = 4@ + 0x14
0A8D: 8@ = read_memory 8@ size 4 virtual_protect 0
0AA6: call_method 8@ struct 2@ num_params 1 pop 0 0@
0A8C: write_memory 3@ size 4 value 5@ virtual_protect 0
0AB2: ret 0

:NAZWA_MODELU
0662: NOP "265"
0000: NOP

 

:MAIN_002
0AB1: call_scm_func @ChangePlayerModel 2 change_player $PLAYER_CHAR model_to @NAZWA_MODELU
070D: rebuild_player $PLAYER_CHAR  
062A: change_float_stat 21 to 200.0 //FAT

 

 

NAZWA MODELU is Load Model in polish, and in the website it said that you shouldn't use the .dff model name, only the ID. Officer Tenpenny's ID is 265, but it's strange to put it in a "NOP" ocode, i haven't got a clue on what to do about this


Silent
  • Silent

    Chief Fixing Officer

  • GTA Mods Staff
  • Joined: 01 Feb 2010
  • Poland
  • Contribution Award [Mods]
    Best Script/Plugin 2014 [SilentPatch]
    Most Respected 2014
    Most Helpful [Mods] 2014
    Most Helpful [GTA] 2013
    Most Helpful [Mods] 2013
    Most Talented [Modding] 2013
    Best Map 2013 [ViceCityStories PC Edition]
    Best Vehicle 2013 [III Aircraft]
    Most Helpful [Mods] 2012
    Modder of the Year 2012

#9

Posted 15 October 2013 - 12:04 PM

You've done it wrong, it's a SCM function, not a code you put like that. You CALL it, like the example line showed.

Also, use model NAME as specified, not the ID. The article only states you shouldn't include ".dff" in the model name.

[T]
  • [T]

    The Sword Swingin' Surgeon

  • Members
  • Joined: 01 Mar 2009

#10

Posted 01 November 2013 - 08:40 PM

To spawn as tenpenny after the initial switch (like loading the game) just make a sphere that changes the player character to tenpenny at the spawn coords after a save or place a model switch line after the save disk coords.. Simple solution that worked for me rather than trying to f*ck with saves or memory. The only issue is that sometimes entering interiors can bug the model so just place spheres that change the model to tenpenny on the entrance and exit of every enterable building you plan to use..




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users