#1 24-08-2010 19:31

braduz
Registered: 22-08-2010
Posts: 5

How do you set actors positions?

So far:

{$CLEO .cs}
:DEMOTEXT
03A4: name_thread "test"
wait 1000

:DEMOTEXT_1
wait 0
if
0256: player $PLAYER_CHAR defined
0129: 1@ = create_actor_pedtype 23 model #WMOMIB
0129: 2@ = create_actor_pedtype 23 model #WMOMIB
0129: 3@ = create_actor_pedtype 23 model #WMOMIB
0129: 4@ = create_actor_pedtype 23 model #WMOMIB
0129: 5@ = create_actor_pedtype 23 model #WMOMIB
0A93: end_custom_thread

But I need to set their positions

Offline

#2 24-08-2010 19:42

3Doomer
From: КаZан
Registered: 14-05-2008
Posts: 659
Website

Re: How do you set actors positions?

Why did you cut the opcode???
It's for creating actors in car:

0129: 41@ = create_actor_pedtype 23 model #SPECIAL02 in_car 35@ driverseat

You must use another:

009A: 2@ = create_actor_pedtype 4 model #MALE01 at 0.0 0.0 0.0

GIMS developer

Offline

#3 24-08-2010 23:17

braduz
Registered: 22-08-2010
Posts: 5

Re: How do you set actors positions?

{$CLEO .cs}
:DEMOTEXT
03A4: name_thread "test"
wait 1000

:DEMOTEXT_1
wait 0
if
0256: player $PLAYER_CHAR defined
009A: 1@ = create_actor_pedtype 4 model #WMOMIB at -2552.9502,-300.3968,26.1107
009A: 2@ = create_actor_pedtype 4 model #WMOMIB at -2553.5691,-304.8354,26.1374
009A: 3@ = create_actor_pedtype 4 model #WMOMIB at -2560.7734,-297.5293,29.4281
009A: 4@ = create_actor_pedtype 4 model #WMOMIB at -2557.0779,-297.3231,29.4281
009A: 5@ = create_actor_pedtype 4 model #WMOMIB at -2556.8064,-308.1158,29.4281
009A: 6@ = create_actor_pedtype 4 model #WMOMIB at -2560.6057,-308.1154,29.4281
009A: 7@ = create_actor_pedtype 4 model #WMOMIB at -2625.1453,-308.5279,22.3376
009A: 8@ = create_actor_pedtype 4 model #WMOMIB at -2625.1367,-302.4276,22.2090
009A: 9@ = create_actor_pedtype 4 model #WMOMIB at -2620.9072,-293.5685,22.1984
009A: 10@ = create_actor_pedtype 4 model #WMOMIB at -2613.5566,-259.9180,19.1717
009A: 11@ = create_actor_pedtype 4 model #WMOMIB at -2621.0857,-256.3839,18.8610
009A: 12@ = create_actor_pedtype 4 model #WMOMIB at -2630.8018,-242.9615,18.3560
009A: 13@ = create_actor_pedtype 4 model #WMOMIB at -2627.9829,-234.8933,18.4085
0A93: end_custom_thread

Not enough params error sad

Offline

#4 25-08-2010 07:00

3Doomer
From: КаZан
Registered: 14-05-2008
Posts: 659
Website

Re: How do you set actors positions?

you must use " " instead of "," between the cooordinates


GIMS developer

Offline

#5 25-08-2010 11:18

braduz
Registered: 22-08-2010
Posts: 5

Re: How do you set actors positions?

{$CLEO .cs}
:DEMOTEXT
03A4: name_thread "test"
wait 1000

:DEMOTEXT_1
wait 0
if
0256: player $PLAYER_CHAR defined
009A: 1@ = create_actor_pedtype 4 model #WMOMIB at -2552.9502 -300.3968 26.1107
009A: 2@ = create_actor_pedtype 4 model #WMOMIB at -2553.5691 -304.8354 26.1374
009A: 3@ = create_actor_pedtype 4 model #WMOMIB at -2560.7734 -297.5293 29.4281
009A: 4@ = create_actor_pedtype 4 model #WMOMIB at -2557.0779 -297.3231 29.4281
009A: 5@ = create_actor_pedtype 4 model #WMOMIB at -2556.8064 -308.1158 29.4281
009A: 6@ = create_actor_pedtype 4 model #WMOMIB at -2560.6057 -308.1154 29.4281
009A: 7@ = create_actor_pedtype 4 model #WMOMIB at -2625.1453 -308.5279 22.3376
009A: 8@ = create_actor_pedtype 4 model #WMOMIB at -2625.1367 -302.4276 22.2090
009A: 9@ = create_actor_pedtype 4 model #WMOMIB at -2620.9072 -293.5685 22.1984
009A: 10@ = create_actor_pedtype 4 model #WMOMIB at -2613.5566 -259.9180 19.1717
009A: 11@ = create_actor_pedtype 4 model #WMOMIB at -2621.0857 -256.3839 18.8610
009A: 12@ = create_actor_pedtype 4 model #WMOMIB at -2630.8018 -242.9615 18.3560
009A: 13@ = create_actor_pedtype 4 model #WMOMIB at -2627.9829 -234.8933 18.4085
0A93: end_custom_thread

Wtf it crashes my gta sa >.>

Offline

#7 25-08-2010 11:45

braduz
Registered: 22-08-2010
Posts: 5

Re: How do you set actors positions?

Thanks!
Now it doesnt crash smile
but it doesnt work, the actor aint there

:DEMOTEXT
03A4: name_thread "test"
wait 1000

:DEMOTEXT_1
wait 0
if
0256: player $PLAYER_CHAR defined
0247: load_model #WMOMIB
038B: load_requested_models

:MODEL_LOAD
00D6: if
8248:   not model #WMOMIB available
004D: jump_if_false @MODEL_SPAWN
0001: wait 0 ms
0002: jump @MODEL_LOAD

:MODEL_SPAWN
10@ = Actor.Create(CIVFEMALE, #WMOMIB, -2552.9502, -300.3968, 26.1107)

//Here you do what you want to do with the actor.

0249: release_model #WMOMIB
0A93: end_custom_thread

Last edited by braduz (25-08-2010 11:45)

Offline

#8 25-08-2010 12:01

3Doomer
From: КаZан
Registered: 14-05-2008
Posts: 659
Website

Re: How do you set actors positions?

May be, you've set the wrong coords?

===

You shouldn't name every thread, when it's not needed to close it externally(by other script).

So, that'll be better:

{$CLEO .cs}
wait 1000

:DEMOTEXT_1
wait 100
if
0256: player $PLAYER_CHAR defined
jf @DEMOTEXT_1
0247: load_model #WMOMIB

:MODEL_LOAD
wait 100
if
0248:   model #WMOMIB available
jf @MODEL_LOAD

:MODEL_SPAWN
00@ = Actor.Create(CIVFEMALE, #WMOMIB, -2552.9502, -300.3968, 26.1107)
0249: release_model #WMOMIB
0A93: end_custom_thread

And this is an ideal syntax, which is more convenient for understanding:

{$CLEO .cs}
wait 1000
while not player.Defined($PLAYER_CHAR) //cycle for waiting player defined
    wait 100
end
model.Load(#WMOMIB)
while not model.Available(#WMOMIB)
    wait 100
end
actor.Create(0@,CIVFEMALE,#WMOMIB,-2552.9502,-300.3968,26.1107)
model.Destroy(#WMOMIB)
0A93: end_custom_thread

Also, if an actor is too far from the player, he'll just fall down through the ground(collision is calculated on fixed distance from the player)
In that case, you should lock an actor using

actor.LockInCurrentPosition(0@,true)

until the player gets closer(smth about 200m in radius)
Or you can just create an actor when the player is closer than ~200m

Last edited by 3Doomer (25-08-2010 12:06)


GIMS developer

Offline

Board footer

Powered by FluxBB