Quantcast

Jump to content

» «
Photo

Actor Refuses to Spawn

4 replies to this topic
Indi
  • Indi

    "Party's over, kid!"

  • Andolini Mafia Family
  • Joined: 22 Nov 2008
  • Wales

#1

Posted 12 June 2014 - 01:38 AM Edited by Indi, 12 June 2014 - 01:39 AM.

Hi,

 

I've tried to spawn an actor by following Dutchy's tutorial but it is not working for some very strange reason, I've checked the code more than twice and the compiler doesn't show me any debug errors:

{
  use macro (Ctrl+J) "headsa"
  to insert a file header      
}                                                          
 
thread 'MAIN'
 var
  $PLAYER_CHAR: Player
 end // var
01F0: set_max_wanted_level_to 6
set_wb_check_to 0
00C0: set_current_time 8 0
04E4: unknown_refresh_game_renderer_at 2488.5601 -1666.84
Camera.SetAtPos(2488.5601, -1666.84, 13.38)
$PLAYER_CHAR = Player.Create(#NULL, 2488.5601, -1666.84, 13.38)
$PLAYER_ACTOR = Actor.EmulateFromPlayer($PLAYER_CHAR)
07AF: $PLAYER_GROUP = player $PLAYER_CHAR group
Camera.SetBehindPlayer
set_weather 0          
wait 0 ms
$PLAYER_CHAR.SetClothes("PLAYER_FACE", "HEAD", Head)
$PLAYER_CHAR.SetClothes("JEANSDENIM", "JEANS", Legs)                          
$PLAYER_CHAR.SetClothes("SNEAKERBINCBLK", "SNEAKER", Shoes)
$PLAYER_CHAR.SetClothes("VEST", "VEST", Torso)
$PLAYER_CHAR.Build
$PLAYER_CHAR.CanMove = True
fade 1 (out) 0 ms                    
select_interior 0
0629: change_stat 181 (islands unlocked) to 4
016C: restart_if_wasted at 2027.77 -1420.52 15.99 angle 137.0 for_town_number 0
016D: restart_if_busted at 1550.68 -1675.49 14.51 angle 90.0 for_town_number 0
0180: set_on_mission_flag_to $ONMISSION // Note: your missions have to use the variable defined here ($ONMISSION)
03E6: remove_text_box
// put your create_thread commands here
 
:MAIN_LOOP
0001: wait $DEFAULT_WAIT_TIME ms
00BF: $TIME_HOURS = current_time_hours, $TIME_MINS = current_time_minutes
0002: jump @MAIN_LOOP 
 
// put your mods (threads) here 
create_thread @MODEL
 
:MODEL
thread "MODEL"  
 
// Load models
0247: load_model #WMYBMX
038B: load_requested_models
 
:MODEL_LOAD
00D6: if
8248:  not model #WMYBMX available
004D: else_jump @MODEL_SPAWN
0001: wait 0 ms
0002: jump @MODEL_LOAD
 
:MODEL_SPAWN
10@ = Actor.Create(CIVMALE, #WMYBMX, 2498.5593, -1677.4386, 13.3528)
Actor.Angle(10@) = 1.2767
 
//Here you say what you want to do with the actor.
 
0249: release_model #WMYBMX
 
end_thread

Thanks.  I have also changed the co-ordinates to custom positioning by using the Co-ords Manager.


Thedissagreement
  • Thedissagreement

    my first and best year at modding!

  • Members
  • Joined: 01 Jun 2011
  • None

#2

Posted 12 June 2014 - 08:58 AM

Im guessing the entire purpose of the script to you is to make the player spawn in a different location, if thats the case here is a script i tested myself...

 

 

{$VERSION 3.1.0027}
 
//-------------MAIN---------------
thread 'MAIN' 
01F0: set_max_wanted_level_to 6 
set_wb_check_to 0 
00C0: set_current_time_hours_to 8 minutes_to 0 
04E4: unknown_refresh_game_renderer_at 2488.56 -1666.84 
Camera.SetAtPos(2488.56, -1666.84, 13.38)
$PLAYER_CHAR = Player.Create(#NULL, 2488.56, -1666.84, 13.38)
$PLAYER_ACTOR = Actor.EmulateFromPlayer($PLAYER_CHAR)
07AF: $PLAYER_GROUP = player $PLAYER_CHAR group 
Camera.SetBehindPlayer
set_weather 0 
wait 0 
Player.SetClothes($PLAYER_CHAR, "PLAYER_FACE", "HEAD", Head)
Player.SetClothes($PLAYER_CHAR, "JEANSDENIM", "JEANS", Legs)
Player.SetClothes($PLAYER_CHAR, "SNEAKERBINCBLK", "SNEAKER", Shoes)
Player.SetClothes($PLAYER_CHAR, "VEST", "VEST", Torso)
Player.Build($PLAYER_CHAR)
Player.CanMove($PLAYER_CHAR) = True
fade 1 0 
select_interior 0 
0629: change_integer_stat 181 to 4 
016C: restart_if_wasted_at 2027.77 -1420.52 15.99 angle 137.0 town_number 0 
016D: restart_if_busted_at 1550.68 -1675.49 14.51 angle 90.0 town_number 0 
0180: set_on_mission_flag_to $ONMISSION // Note: your missions have to use the variable defined here 
$DEFAULT_WAIT_TIME = 250 
03E6: remove_text_box 
 
:MAIN_297
wait $DEFAULT_WAIT_TIME 
00BF: $TIME_HOURS = current_time_hours, $TIME_MINS = current_time_minutes 
jump @MAIN_297 
 
*Copy this script EXACTLY into a new sanny builder file and hit save as (it will save it as text) then click compile and it will save it as xxx.scm (rename xxx to main) then replace the main.scm you made with the main.scm in data/scripts/ (but make sure you have a backup!!!)
BTW u can't do missions after you do this. ENJOY ;)

Indi
  • Indi

    "Party's over, kid!"

  • Andolini Mafia Family
  • Joined: 22 Nov 2008
  • Wales

#3

Posted 12 June 2014 - 10:58 PM

Sadly not, appreciate the help though.  I wanted a pedestrian (actor) to spawn at specific co-ordinates.


Ashwin.Star
  • Ashwin.Star

    i'll be back someday

  • Members
  • Joined: 14 Nov 2010
  • India

#4

Posted 13 June 2014 - 07:12 AM

The create thread opcode you have use is at wrong place & will not be read by the Game,

i am talking about this one "create_thread @MODEL"

Place this opcode at right after the Text_Box code,

here 

"03E6: remove_text_box

// put your create_thread commands here"


Indi
  • Indi

    "Party's over, kid!"

  • Andolini Mafia Family
  • Joined: 22 Nov 2008
  • Wales

#5

Posted 13 June 2014 - 10:15 PM

Yep, that worked.

 

Thanks Ashwin.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users