Quantcast

Jump to content

» «
Photo

[GTA SA] ~ CLEO Script Tutorial ~

640 replies to this topic
oseas12345
  • oseas12345

    Player Hater

  • Members
  • Joined: 25 Sep 2010

#121

Posted 25 September 2010 - 06:11 PM Edited by oseas12345, 26 September 2010 - 11:13 AM.

Hi,Im newbie here so im gonna ask that is really easy for all of you.(and not for me) blush.gif blush.gif blush.gif

How can i change the particle of this (this is superman flying cleo)
I just get it in everywhere and it work's fine but i want to change it's particle to a laser just like in the cleo "mop"
the own that is color blue and to use it is to left click.
can you teach me how to do that

thx and sorry for my bad english blush.gif whatsthat.gif mercie_blink.gif mercie_blink.gif


ZAZ
  • ZAZ

    Kernlochbohrer

  • Feroci
  • Joined: 10 Jan 2005
  • European-Union

#122

Posted 26 September 2010 - 09:41 AM Edited by ZAZ, 02 June 2011 - 05:16 AM.

QUOTE (oseas12345 @ Sep 25 2010, 18:11)
Hi,Im newbie here so im gonna ask that is really easy for all of you.(and not for me)

How can i change the particle of this (this is superman flying cleo)

This is a tutorial and not the superCJ discussion topic
-------------------------------------------------------------------------------------------------------------------------------------------

Particle Effects
related themes:
Special opcodes to show particles
LIGHT and shadow


Basicly it's very easy to show a particle effect.
You must just know that it requires always a supportive opcode to make the particle visible
Try at first the simple script below
press backspace to show the explosion_large effect
opcode 04C4: gets the coords of 10.5 units infront of player
opcode 064B: apply the particle effect
opcode 064F: makes it visible
CODE
{$CLEO .cs}
:ParticleEffect
03A4: name_thread 'PRTEFCT'

:PRTEFCT_01
0001: wait  0 ms
if
0256: player $PLAYER_CHAR defined
004D: jump_if_false @PRTEFCT_01
if
0AB0:   key_pressed 8//-----------------------press Backspace
004D: jump_if_false @PRTEFCT_01
04C4: create_coordinate 1@ 2@ 3@ from_actor $PLAYER_ACTOR offset 0.0 10.5  0.3
064B: 0@ = create_particle "explosion_large"  at 1@ 2@ 3@ type 4
064F: make_temp_particle_visible_and_remove_references 0@
wait  250
0002: jump @PRTEFCT_01


The string entry of the second parameter of opcode 064B: is the name of the particle effect
These names are defined in GTASA\models\effects.fxp
Read more about effects.fxp at particle effects tutorial
For easy use you will find the particle names in Sanny Builder Help: SCM Documentation: GTA SA: Particle effects
--------------------------------------------------------------------------------------------------------

Now the details:
There are a lot different opcodes related to show particles
And there are 2 kinds of particles: temporary particles and permanent particles
The PLAYMODE: -definition of each effect.fxs in effects.fxp declares if the particles live is temporary or permanent

------------------
PLAYMODE: 0
------------------

Example: look for the fxs-data of blood_heli in effects.fxp
it beginns with this head:
CODE
FX_SYSTEM_DATA:
109

FILENAME: X:\SA\FxTools\Data\effects\gta_pc\systems/script/blood_heli.fxs
NAME: blood_heli
LENGTH: 3.000
LOOPINTERVALMIN: 0.000
LENGTH: 0.000
PLAYMODE: 0

Playmode 0 is shown for a moment, temporary, can run in a loop for some cases
use it in connection with this opcode:
CODE
064F: make_temp_particle_visible_and_remove_references 0@


Example script:
CODE
{$CLEO .cs}
:ParticleEffect_Playmode_0
//Playmode_0 is shown for a moment, temporary, can run in a loop for some cases
03A4: name_thread 'PRTEFCT'

:PRTEFCT_01
0001: wait  0 ms
if
0256: player $PLAYER_CHAR defined
004D: jump_if_false @PRTEFCT_01
if
0AB0:   key_pressed 1//-----------------------press left mouse button
004D: jump_if_false @PRTEFCT_01
04C4: create_coordinate 1@ 2@ 3@ from_actor $PLAYER_ACTOR offset 0.0 3.5  0.3
064B: 0@ = create_particle "blood_heli"  at 1@ 2@ 3@ type 4
064F: make_temp_particle_visible_and_remove_references 0@
wait  1250
0002: jump @PRTEFCT_01


-------------------------------------
PLAYMODE: 1 or PLAYMODE: 2
-------------------------------------

Example: look for the fxs-data of fire in effects.fxp
it beginns with this head:
CODE
FX_SYSTEM_DATA:
109

FILENAME: X:\SA\FxTools\Data\effects\gta_pc\systems/code/fire.fxs
NAME: fire
LENGTH: 1.000
LOOPINTERVALMIN: 0.000
LENGTH: 0.000
PLAYMODE: 2

Playmode 1 or 2 are durable till they will be removed (delete_particle)
can cause bugs and trails by speed if attached to vehicle
show it in connection with this opcode:
CODE
064C: make_particle 7@ visible


and remove it at any time with this opcode:
CODE
0650: delete_particle 7@


Example script:
CODE
{$CLEO .cs}
:Partcl_Playmode_1_or_2
03A4: name_thread 'PRT'
//Playmode 1 or 2 are durable till the will be removed (delete_particle)
//can cause bugs and trail by speed if attached to vehicle

:Partcl_01
0001: wait  0 ms
00D6: if 0
0256: player $PLAYER_CHAR defined
004D: jump_if_false @Partcl_01
if
0AB0:   key_pressed 2//-----------------------press right mouse button
004D: jump_if_false @Partcl_01
04C4: create_coordinate 1@ 2@ 3@ from_actor $PLAYER_ACTOR offset 0.0 3.5  0.3
064B: 7@ = create_particle "fire"  at 1@ 2@ 3@ type 4
064C: make_particle 7@ visible
0001: wait  1000 ms

:Partcl_03
0001: wait  0 ms
00D6: if 0
0256: player $PLAYER_CHAR defined
004D: jump_if_false @Partcl_03
if
0AB0:   key_pressed 2//-----------------------press right mouse button
004D: jump_if_false @Partcl_03
0650: delete_particle 7@  
0001: wait  1000 ms
0002: jump @Partcl_01


----------------------
type, mode, flag
----------------------
the opcodes to apply particles have as last parameter an integer value for type, mode or flag
this parameter seems to have none effect, it doesn't matter if you set the type to 1, 2, 3, 4 or 5


-----------------------------------------------
Several opcodes to apply particle effects
-----------------------------------------------
There exist opcodes to apply particles at absolute coords as well as opcodes to attach particles to actor, vehicle or object

A part of the opcodes to attach particle to actor, vehicle or object have the extension to insert coords for the orientation
But not all particles will have a orientation. The most particles are shown as a 2d animation on screen
For a few particles is it possible to define the orientation like "spraycan", "gunflash", "tank_fire" and some others
The coord entries of the attach_particle are always relative to actor-, vehicle- or object- center

simple opcode to show particle at absolute coords
CODE
064B: 0@ = create_particle "explosion_large"  at 1@ 2@ 3@ type 4


opcodes to attach particle to actor, vehicle or object
CODE
0669: 0@ = attach_particle "petrolcan" to_actor $PLAYER_ACTOR offset 0.05  0.0  -0.05  2
066B: 0@ = attach_particle "explosion_tiny" to_car 5@ with_offset 0.0 -2.5 1.5 flag 1
066D: 0@ = attach_particle "SMOKE_FLARE" to_object 6@ with_offset 0.0 0.0 0.1 flag 1


opcodes to attach particle to actor, vehicle or object with orientation
CODE
066A: 0@ = attach_particle "spraycan" to_actor $PLAYER_ACTOR with_offset 0.05  0.1  0.5 rotation 5.05  0.1  1.05 flag 1
066C: 0@ = attach_particle "gunflash" to_car 5@ with_offset 0.0 -2.5 1.5 rotation -5.0 -2.5 1.5 flag 1
066E: create_particle "tank_fire" attached_to_object 6@ with_offset 0.0 0.0 0.5 rotation 5.0 0.0 0.5 flag 1 handle_as 0@


supportive opcode to change the attachment of opcode 0669: as well as opcode 066A:
from actor center to head
CODE
0883: attach_particle 0@ to_actor $PLAYER_ACTOR mode 5


supportive opcode to make the particle visible
CODE
064C: make_particle 0@ visible  
064F: make_temp_particle_visible_and_remove_references 0@


opcodes to remove particles
CODE
0976: destroy_particle 0@
064E: stop_particle 0@
0650: destroy_particle 0@



------------------------------------------
script examples with attach_particle
------------------------------------------
1. attach_particle "petrolcan" to_actor
"petrolcan" is a PLAYMODE: 1 -particle (permanent) without orientation
press Backspace to show the particle, wait a second then press again Backspace to remove the particle
CODE
{$CLEO .cs}
:ParticleEffect_at_Actor
03A4: name_thread 'ACTPTEF'

:ACTPTEF_01
0001: wait  0 ms
if
0256: player $PLAYER_CHAR defined
004D: jump_if_false @ACTPTEF_01
if
0AB0:   key_pressed 8//-----------------------press Backspace
004D: jump_if_false @ACTPTEF_01
0669: 0@ = attach_particle "petrolcan" to_actor $PLAYER_ACTOR offset 0.05  0.0  -0.05  2
064C: make_particle 0@ visible
0001: wait  1000 ms

:ACTPTEF_03
0001: wait  0 ms
if
0256: player $PLAYER_CHAR defined
004D: jump_if_false @ACTPTEF_03
if
0AB0:   key_pressed 8//-----------------------press Backspace
004D: jump_if_false @ACTPTEF_03
0976: destroy_particle 0@  
0001: wait  1000 ms
0002: jump @ACTPTEF_01


2. attach_particle "EXHALE" to_actor
"EXHALE" is a PLAYMODE: 0 -particle (temporary) with long duration and without orientation
The supportive opcode 0883: changes the attachment of opcode 0669: from actor center to head
press Backspace to show the particle
CODE
{$CLEO .cs}
:ParticleEffect_at_Actor
03A4: name_thread 'ACTPTEF'

:ACTPTEF_01
0001: wait  0 ms
if
0256: player $PLAYER_CHAR defined
004D: jump_if_false @ACTPTEF_01
if
0AB0:   key_pressed 8//-----------------------press Backspace
004D: jump_if_false @ACTPTEF_01
0669: 0@ = attach_particle "EXHALE" to_actor $PLAYER_ACTOR offset 0.05  0.1  -0.05  2
0883: attach_particle 0@ to_actor $PLAYER_ACTOR mode 5
064F: make_temp_particle_visible_and_remove_references 0@
0001: wait  1000 ms
0002: jump @ACTPTEF_01


3. attach_particle "spraycan" to_actor
"spraycan" is a PLAYMODE: 2 -particle (permanent) with orientation
press Backspace to show the particle, wait a second then press again Backspace to remove the particle
CODE
{$CLEO .cs}
:ParticleEffect_at_Actor
03A4: name_thread 'ACTPTEF'

:ACTPTEF_01
0001: wait  0 ms
if
0256: player $PLAYER_CHAR defined
004D: jump_if_false @ACTPTEF_01
if
0AB0:   key_pressed 8//-----------------------press Backspace
004D: jump_if_false @ACTPTEF_01
066A: 0@ = attach_particle "spraycan" to_actor $PLAYER_ACTOR with_offset 0.05  0.1  0.5 rotation 5.05  0.1  1.05 flag 1  
064C: make_particle 0@ visible
0001: wait  1000 ms

:ACTPTEF_03
0001: wait  0 ms
if
0256: player $PLAYER_CHAR defined
004D: jump_if_false @ACTPTEF_03
if
0AB0:   key_pressed 8//-----------------------press Backspace
004D: jump_if_false @ACTPTEF_03
0976: destroy_particle 0@  
0001: wait  1000 ms
0002: jump @ACTPTEF_01


4. attach_particle "explosion_tiny" to_car
"explosion_tiny" is a PLAYMODE: 0 -particle (temporary) without orientation
enter a vehicle then press Backspace to show the particle
CODE
{$CLEO .cs}
:ParticleEffect_at_vehicle
03A4: name_thread 'VEHPTEF'

:VEHPTEF_2
0001: wait 0 ms
00D6: if
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @VEHPTEF_2
if
00DF:   actor $PLAYER_ACTOR driving
004D: jump_if_false @VEHPTEF_2
03C0: 5@ = actor $PLAYER_ACTOR car

:VEHPTEF_10
0001: wait 250 ms
00D6: if
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @VEHPTEF_20
if and
8119:   not car 5@ wrecked
00DF:   actor $PLAYER_ACTOR driving  
004D: jump_if_false @VEHPTEF_20
066B: 0@ = attach_particle "explosion_tiny" to_car 5@ with_offset 0.0 -2.5 1.5 flag 1
064F: make_temp_particle_visible_and_remove_references 0@                                              
jump @VEHPTEF_10

:VEHPTEF_20
01C3: remove_references_to_car 1@ // Like turning a car into any random car
0002: jump @VEHPTEF_2


5. attach_particle "gunflash" to_car
"gunflash" is a PLAYMODE: 0 -particle (temporary) with orientation
enter a vehicle then press Backspace to show the particle
CODE
{$CLEO .cs}
:ParticleEffect_at_vehicle
03A4: name_thread 'VEHPTEF'

:VEHPTEF_2
0001: wait 0 ms
00D6: if
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @VEHPTEF_2
if
00DF:   actor $PLAYER_ACTOR driving
004D: jump_if_false @VEHPTEF_2
03C0: 5@ = actor $PLAYER_ACTOR car

:VEHPTEF_10
0001: wait 0 ms
00D6: if
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @VEHPTEF_20
if and
8119:   not car 5@ wrecked
00DF:   actor $PLAYER_ACTOR driving  
004D: jump_if_false @VEHPTEF_20
066C: 0@ = attach_particle "gunflash" to_car 5@ with_offset 0.0 -2.5 1.5 rotation -5.0 -2.5 1.5 flag 1
064F: make_temp_particle_visible_and_remove_references 0@                                              
jump @VEHPTEF_10

:VEHPTEF_20
01C3: remove_references_to_car 1@ // Like turning a car into any random car
0002: jump @VEHPTEF_2


6. attach_particle "SMOKE_FLARE" to_object
"SMOKE_FLARE" is a PLAYMODE: 2 -particle (permanent) without orientation
press Backspace to spawn an object and show the attached particle, wait a second then press again Backspace to remove the particle and the object
CODE
{$CLEO .cs}
:ParticleEffect_at_Object
03A4: name_thread 'OBJPTEF'
//1598, beachball, beachball, 50, 128

:OBJPTEF_01
0001: wait  0 ms
if
0256: player $PLAYER_CHAR defined
004D: jump_if_false @OBJPTEF_01
if
0AB0:   key_pressed 8//-----------------------press Backspace  
004D: jump_if_false @OBJPTEF_01
0247: request_model 1598

:OBJPTEF_02
0001: wait  0 ms
if
0248:   model 1598 available
004D: jump_if_false @OBJPTEF_02
04C4: create_coordinate 11@ 12@ 13@ from_actor $PLAYER_ACTOR offset 0.0 2.5 0.0
0107: 6@ = create_object 1598 at  11@ 12@ 13@
066D: 0@ = attach_particle "SMOKE_FLARE" to_object 6@ with_offset 0.0 0.0 0.5 flag 1
064C: make_particle 0@ visible
0249: release_model 1598
0001: wait  1000 ms

:OBJPTEF_03
0001: wait  0 ms
if
0256: player $PLAYER_CHAR defined
004D: jump_if_false @OBJPTEF_03
if
0AB0:   key_pressed 8//-----------------------press Backspace
004D: jump_if_false @OBJPTEF_03
0976: destroy_particle 0@  
0108: destroy_object 6@
0001: wait  1000 ms
0002: jump @OBJPTEF_01


7. create_particle "tank_fire" attached_to_object
"tank_fire" is a PLAYMODE: 0 -particle (temporary) with orientation
hold Backspace to spawn an object and show the attached particle, particle and object disappear if backspace is not pressed
CODE
{$CLEO .cs}
:ParticleEffect_at_Object
03A4: name_thread 'OBJPTEF'
//1598, beachball, beachball, 50, 128

:OBJPTEF_01
0001: wait  0 ms
if
0256: player $PLAYER_CHAR defined
004D: jump_if_false @OBJPTEF_01
if
0AB0:   key_pressed 8//-----------------------press Backspace  
004D: jump_if_false @OBJPTEF_01
0247: request_model 1598

:OBJPTEF_02
0001: wait  0 ms
if
0248:   model 1598 available
004D: jump_if_false @OBJPTEF_02
04C4: create_coordinate 11@ 12@ 13@ from_actor $PLAYER_ACTOR offset 0.0 2.5 0.0
0107: 6@ = create_object 1598 at  11@ 12@ 13@
0249: release_model 1598

:OBJPTEF_03
0001: wait  250 ms
if
0256: player $PLAYER_CHAR defined
004D: jump_if_false @OBJPTEF_04
if
0AB0:   key_pressed 8//-----------------------press Backspace
004D: jump_if_false @OBJPTEF_04
066E: create_particle "tank_fire" attached_to_object 6@ with_offset 0.0 0.0 0.5 rotation 5.0 0.0 0.5 flag 1 handle_as 0@
064F: make_temp_particle_visible_and_remove_references 0@
jump @OBJPTEF_03

:OBJPTEF_04
0108: destroy_object 6@
0001: wait  1000 ms
0002: jump @OBJPTEF_01




Extension to 2. attach_particle "" to_actor
The supportive opcode 0883: changes the attachment of opcode 0669: from actor center to a bone
ceedj figured out the bone values and made a list
CODE

066A: 0@ = attach_particle "flamethrower" to_actor $PLAYER_ACTOR with_offset 0.0  0.0  0.0 rotation 0.0  13.0  0.0 flag 1  
0883: attach_particle 0@ to_actor $PLAYER_ACTOR mode <?>

Attach Particle To Actor Flag:

0 - Root 1
1 - Root 2
2 - Spine 1
3 - Spine 2
4 - Neck
5 - Head
6 - Head 2
7 - Head 3
8 - Head 4 (2,3, 4 - eyes or brow maybe?)
21 - Chest Area
22 - Right Shoulder
23 - Right Elbow
24 - Right Wrist
25 - Right Hand
26 - Right Hand/Finger?
31 - Chest Area
32 - Left Shoulder
33 - Left Elbow
34 - Left Wrist
35 - Left Hand
36 - Left Hand/Finger?
41 - Left Hip
42 - Left Knee
43 - Left Heel
44 - Left Foot
51 - Right Hip
52 - Right Knee
53 - Right Heel
54 - Right Foot


opcode 066A: supports rotation parameter which allows to give the particle a direction
This requires an effect which moves in a direction like the "flamethrower"
Attached to bones show the particles moving in different direction
because the bones have different oriention of it's x,y,z-axis in relation to the actor center
Watch to the results by using the testscript below
The flamethrower moves allways to offset 13.0 of Y direction of the bone
The script starts with 0 - Root 1 and add 1 after key_press for the bone value till 60

CODE
{$CLEO .cs}
:Flamethrower_at_Actor_bone
03A4: name_thread 'FLAMEPB'
1@ = 0

:FLAMEPB_01
0001: wait  0 ms
if
0256: player $PLAYER_CHAR defined
004D: jump_if_false @FLAMEPB_01
if
0AB0:   key_pressed 8//-----------------------press Backspace
004D: jump_if_false @FLAMEPB_01

066A: 0@ = attach_particle "flamethrower" to_actor $PLAYER_ACTOR with_offset 0.0  0.0  0.0 rotation 0.0  13.0  0.0 flag 1  
0883: attach_particle 0@ to_actor $PLAYER_ACTOR mode 1@
064C: make_particle 0@ visible
0001: wait  1000 ms

:FLAMEPB_03
0001: wait  0 ms
if
0256: player $PLAYER_CHAR defined
004D: jump_if_false @FLAMEPB_03
03F0: enable_text_draw 1
045A: text_draw_1number  250.0  80.0 'NUMBER' 1@    // value
if
0AB0:   key_pressed 8//-----------------------press Backspace
004D: jump_if_false @FLAMEPB_03
0976: destroy_particle 0@  
0001: wait  500 ms
1@ += 1
if
1@ > 60
004D: jump_if_false @FLAMEPB_01
1@ = 0
0002: jump @FLAMEPB_01




related themes:
Special opcodes to show particles
LIGHT and shadow


oseas12345
  • oseas12345

    Player Hater

  • Members
  • Joined: 25 Sep 2010

#123

Posted 26 September 2010 - 11:14 AM

thank u very much for this
i really appreciate it!!!

ZAZ
  • ZAZ

    Kernlochbohrer

  • Feroci
  • Joined: 10 Jan 2005
  • European-Union

#124

Posted 27 September 2010 - 05:39 PM Edited by ZAZ, 21 October 2010 - 06:42 PM.

----------------------------------------
Special opcodes to show particles
----------------------------------------

There exist some special opcodes to show predefined particles without parameter for particle name
They show the particle temporary for a very short time
It needs to run these opcodes in a loop otherwise you can't see it


1.
08EB: create_sparks_at 1@ 2@ 3@ velocity_direction 0.0 5.0 20.0 density 100
Sparks are only as sub-fxs-data available in effects.fxp
I assume that the sparks of opcode 08EB: are programmed in the exe without using any texture

opcode 08EB: have 7 parameter
parameter 1,2,3 = x,y,z - float, absolute coords for spawning
parameter 4,5,6 = x,y,z - float, coords for orientation are relative to the sparks spawn position
parameter 7 = density - integer

bigger coords for orientation let's the sparks enlarge

Example script below shows the sparks with maximum density
press backspace to show the sparks infront of player
CODE
{$CLEO .cs}
:Particle_Sparks
03A4: name_thread 'PRTSPRK'

:PRTSPRK_01
0001: wait  0 ms
if
0256: player $PLAYER_CHAR defined
004D: jump_if_false @PRTSPRK_01
if
0AB0:   key_pressed 8//-----------------------press Backspace
004D: jump_if_false @PRTSPRK_01
04C4: create_coordinate 1@ 2@ 3@ from_actor $PLAYER_ACTOR offset 0.0 3.5  0.3
08EB: create_sparks_at 1@ 2@ 3@ velocity_direction 0.0 5.0 20.0 density 100
jump @PRTSPRK_01


2.
058A: create_gun_flash_from 1@ 2@ 3@ to 11@ 12@ 13@
opcode 058A: shows the particle "gunflash" but in this case it requires absulte coords for spawning and for orientation
opcode 058A: have 6 parameter
parameter 1,2,3 = x,y,z - float, absolute coords for spawning
parameter 4,5,6 = x,y,z - float, absolute coords for orientation

Example script below shows the gunflash with same orientation like player orientation
press backspace to show the gunflash infront of player
CODE
{$CLEO .cs}
:Particle_GunFlash
03A4: name_thread 'PRTGFLS'

:PRTGFLS_01
0001: wait  0 ms
if
0256: player $PLAYER_CHAR defined
004D: jump_if_false @PRTGFLS_01
if
0AB0:   key_pressed 8//-----------------------press Backspace
004D: jump_if_false @PRTGFLS_01
04C4: create_coordinate 1@ 2@ 3@ from_actor $PLAYER_ACTOR offset 0.0 1.5  0.3
04C4: create_coordinate 11@ 12@ 13@ from_actor $PLAYER_ACTOR offset 0.0 10.5  0.3
058A: create_gun_flash_from 1@ 2@ 3@ to 11@ 12@ 13@
jump @PRTGFLS_01



3.
09B8: create_blood_gush_at 1@ 2@ 3@ with_offset 0.0 3.0 0.0 density 80 on_actor $PLAYER_ACTOR
opcode 09B8: shows blood particle based on the prt_blood.fxs but the PLAYMODE: 2 isn't relevant
It is also shown in red color in contrast to the prt_blood in normal particle opcodes, which is colorless
opcode 09B8: have 8 parameter
parameter 1,2,3 = x,y,z - float, absolute coords for spawning
parameter 4,5,6 = x,y,z - float, coords for orientation are relative to the blood spawn position
but the orientation itself of the movement is in absolute direction of the unit circle
parameter 7 = density
parameter 8 = actor handle to assigne the particle to an actor
press backspace to show the blood_gush infront of player
CODE
{$CLEO .cs}
:Particle_Blood_Gush
03A4: name_thread 'PTBLOOD'

:PTBLOOD_01
0001: wait  0 ms
if
0256: player $PLAYER_CHAR defined
004D: jump_if_false @PTBLOOD_01
if
0AB0:   key_pressed 8//-----------------------press Backspace
004D: jump_if_false @PTBLOOD_01
04C4: create_coordinate 1@ 2@ 3@ from_actor $PLAYER_ACTOR offset 0.2 0.0  0.5
09B8: create_blood_gush_at 1@ 2@ 3@ with_offset 0.0 3.0 3.0 density 80 on_actor $PLAYER_ACTOR
jump @PTBLOOD_01




4.
04D5: create_corona_at 1@ 2@ 3@ radius 1.5 type 2 flare 1 RGB 247 206 12
opcode 04D5: shows textures of GTASA\models\particle.txd as soft light source
opcode 04D5: have 9 parameter
parameter 1,2,3 = x,y,z - float, absolute coords for spawning
parameter 4 = size, float
parameter 5 = type, integer, change textur
parameter 6 = shows flare, bol 0/1
parameter 7,8,9 = color: integer values for Red-Green-Blue
press backspace to show 4 different coronas infront of player
CODE
{$CLEO .cs}
:Corona_1
03A4: name_thread 'CORA'

:Corona_3
0001: wait 0 ms
if
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @Corona_3
00D6: if
0AB0:   key_pressed 8//-----------------------press Backspace
004D: jump_if_false @Corona_3
04C4: create_coordinate 1@ 2@ 3@ from_actor $PLAYER_ACTOR offset -5.0  7.0  2.2
04D5: create_corona_at 1@ 2@ 3@ radius 1.5 type 1 flare 1 RGB 150  0  255
04C4: create_coordinate 4@ 5@ 6@ from_actor $PLAYER_ACTOR offset -2.0  7.0  3.2
04D5: create_corona_at 4@ 5@ 6@ radius 1.5 type 2 flare 1 RGB 247 206 12
04C4: create_coordinate 7@ 8@ 9@ from_actor $PLAYER_ACTOR offset 3.0  7.0  5.2
04D5: create_corona_at 7@ 8@ 9@ radius 1.5 type 3 flare 0 RGB 255 7 7
04C4: create_coordinate 10@ 11@ 12@ from_actor $PLAYER_ACTOR offset 6.0  7.0  3.2
04D5: create_corona_at 10@ 11@ 12@ radius 1.5 type 4 flare 0 RGB 3 3 255
0002: jump @Corona_3



5.
016F: create_particle 1 rotation_factor 0.0 size 180.0 intensity 250 flags 0 0 0 at 1@ 2@ 3@
opcode 016F: makes shadow on the ground
opcode 016F: have 10 parameter
parameter 1 = intensity category, integer, 1 = dark shadow / 2 = weak shadow
parameter 2 = rotation_factor (unknown), float
parameter 3 = size, float
parameter 4 = intensity, float
parameter 5,6,7 = flags (not tested)
parameter 8,9,10 = x,y,z - float, absolute coords for spawning
press backspace to make shadow on the ground
CODE
{$CLEO .cs}
:Particle_Shadow
03A4: name_thread 'PTSHAD'

:PTSHAD_01
0001: wait  0 ms
if
0256: player $PLAYER_CHAR defined
004D: jump_if_false @PTSHAD_01
if
0AB0:   key_pressed 8//-----------------------press Backspace
004D: jump_if_false @PTSHAD_01
04C4: create_coordinate 1@ 2@ 3@ from_actor $PLAYER_ACTOR offset 0.0 0.0  0.0
016F: create_particle 1 rotation_factor 0.0 size 180.0 intensity 250 flags 0 0 0 at 1@ 2@ 3@
jump @PTSHAD_01




6.
095C: create_smoke_at 1@ 2@ 3@ velocity 0.0 1.0 7.0 RGBA 0.0 0.0 0.0 1.0 size 0.1 last_factor 0.02//black
opcode 095C: shows smoke based on the prt_smoke_huge.fxs but the PLAYMODE: 2 isn't relevant

opcode 095C: have 12 parameter (only floats):
parameter 1,2,3 = x,y,z - absolute coord for spawning
parameter 4,5,6 = x,y,z - coords for orientation are relative to the smoke spawn position
parameter 7,8,9,10 = color: Red-Green-Blue-Alpha
parameter 11 = value for the start size
parameter 12 = value for the end size

the smoke appears with the start size and ends with the end size

Example script below shows the smoke in 8 different colors and in different size
and with different movementspeed because bigger coords for orientation let's the smoke move faster
press backspace to show the smoke
opcode 04C4: gets the coords of 3.5 units infront of player
opcode 095C: apply the smoke
CODE
{$CLEO .cs}
:Particle_Smoke
03A4: name_thread 'PRTSMOK'

:PRTSMOKE_01
0001: wait  0 ms
if
0256: player $PLAYER_CHAR defined
004D: jump_if_false @PRTSMOKE_01
if
0AB0:   key_pressed 8//-----------------------press Backspace
004D: jump_if_false @PRTSMOKE_01
04C4: create_coordinate 1@ 2@ 3@ from_actor $PLAYER_ACTOR offset 0.0 3.5  0.3
33@ = 0

:PRTSMOKE_02_black
wait 0
if
3000 > 33@
jf @PRTSMOKE_03_blue
095C: create_smoke_at 1@ 2@ 3@ velocity 0.0 1.0 7.0 RGBA 0.0 0.0  0.0  1.0 size 0.1 last_factor 0.02//black
jump @PRTSMOKE_02_black

:PRTSMOKE_03_blue
wait 0
if
6000 > 33@
jf @PRTSMOKE_04_green
095C: create_smoke_at 1@ 2@ 3@ velocity 0.0 0.0 50.0 RGBA 0.0  0.0  1.0 1.0 size 0.5 last_factor 0.02//blue
jump @PRTSMOKE_03_blue

:PRTSMOKE_04_green
wait 0
if
9000 > 33@
jf @PRTSMOKE_05_red
095C: create_smoke_at 1@ 2@ 3@ velocity 0.0 0.0 10.0 RGBA 0.0 1.0  0.0  1.0 size 1.0 last_factor 0.02//green
jump @PRTSMOKE_04_green

:PRTSMOKE_05_red
wait 0
if
12000 > 33@
jf @PRTSMOKE_06_yellow
095C: create_smoke_at 1@ 2@ 3@ velocity 0.0 0.0 1.0 RGBA 1.0 0.0  0.0  1.0 size 5.5 last_factor 0.02//red
jump @PRTSMOKE_05_red

:PRTSMOKE_06_yellow
wait 0
if
15000 > 33@
jf @PRTSMOKE_07_turquoise
095C: create_smoke_at 1@ 2@ 3@ velocity 0.0 0.0 20.0 RGBA 1.0 1.0  0.0  1.0 size 9.5 last_factor 0.02//yellow
jump @PRTSMOKE_06_yellow

:PRTSMOKE_07_turquoise
wait 0
if
18000 > 33@
jf @PRTSMOKE_08_pink
095C: create_smoke_at 1@ 2@ 3@ velocity 0.0 0.0 20.0 RGBA 0.0 1.0  1.0  1.0 size 0.5 last_factor 0.02//turquoise
jump @PRTSMOKE_07_turquoise

:PRTSMOKE_08_pink
wait 0
if
21000 > 33@
jf @PRTSMOKE_09_white
095C: create_smoke_at 1@ 2@ 3@ velocity 0.0 0.0 20.0 RGBA 1.0 0.0  1.0  1.0 size 0.5 last_factor 0.02//pink
jump @PRTSMOKE_08_pink

:PRTSMOKE_09_white
wait 0
if
24000 > 33@
jf @PRTSMOKE_01
095C: create_smoke_at 1@ 2@ 3@ velocity 0.0 0.0 20.0 RGBA 1.0 1.0 1.0 1.0 size 0.5 last_factor 0.02//white
jump @PRTSMOKE_09_white



related theme:
LIGHT and shadow


jtr007
  • jtr007

    Sup?

  • Members
  • Joined: 29 Dec 2009

#125

Posted 28 September 2010 - 06:55 AM

Wow, thanks ZAZ for that partical tut, biggrin.gif

Nice tuts. Keep up the great work mate icon14.gif

hellya2011
  • hellya2011

    Hellya2011

  • Members
  • Joined: 23 Sep 2009

#126

Posted 03 October 2010 - 01:03 AM

hey zaz can you help me? i am trying to attach the effect "sparycan" to a weapon so when i press backspace it appears... what is the code for doing that? Plz Help zaz or someone nervous.gif

ZAZ
  • ZAZ

    Kernlochbohrer

  • Feroci
  • Joined: 10 Jan 2005
  • European-Union

#127

Posted 03 October 2010 - 10:17 AM Edited by ZAZ, 21 October 2010 - 06:37 PM.

______
--------/
LIGHT
---------,
"""""""""

We have some lights in gtasa which have 3 facts

1. it have a sourcelight
2. it have a corona, beam or textur performance
3. it illuminate the environment

The lights which I know with these 3 facts are
-Carheadlight: modding by setting headlight-dummies in car-3d model editor
-policelight: same like above but only for emergency and police cars
-fire: modding only by create fire, using particle fire don't illuminate the enviremant
-explosion : modding only by create explosion , using particle explosion don't illuminate the enviremant
-some streetlamps
-traffic lights

The 3.fact, illuminate the environment is the fascinating aspect
try to make a screenshot of your car and you will see that you must consider the orientation (z-angle) of your car and of the camera view. Another vehicles light must illuminate your car, or trafficlight or some street lamps. It seems manipulated from traffic if you're standing in a backyard with a lamp

Mapmodding:
I know 2 methods
Export Lights, Particles for SA, via MaxScript
these lights, also possible for peds, didn't satisfy the 3.fact, illuminate the environment in my tests


[3ds max]Model prelighting, with much colors
This illuminate the model itself full but the enviroment only a little bit

Effects of effects.fxp in scripts, read more in CLEO Script Tutorial>>Particle Effects
these light didn't satisfy the 3.fact, illuminate the environment in my tests


09E5: create_flash_light have the effect of the 3.fact, illuminate the environment unless the ground
but it havn't the 1. and 2. effect, no source and no beams
take the script below to illuminate cars and peds by keypress 9

CODE
{$CLEO .cs}
:Flash_Light_Illumination
thread 'FLHILLU'

:FLHILLU_11
wait 0
if
0AB0:   key_pressed 57//     key 9
jf @FLHILLU_11

:FLHILLU_46
wait 0
if
  Player.Defined($PLAYER_CHAR)
jf @FLHILLU_46
if
0AB0:   key_pressed 57//     key 9
jf @FLHILLU_141
04C4: store_coords_to 1@ 2@ 3@ from_actor $PLAYER_ACTOR with_offset 0.0 0.0 1.0
09E5: create_flash_light_at 1@ 2@ 3@ RGB_mask 255 255 255 radius 200.0
jump @FLHILLU_46

:FLHILLU_141
wait 0
if
  Player.Defined($PLAYER_CHAR)
jf @FLHILLU_141
04C4: store_coords_to 1@ 2@ 3@ from_actor $PLAYER_ACTOR with_offset 0.0 0.0 1.0
09E5: create_flash_light_at 1@ 2@ 3@ RGB_mask 255 255 255 radius 200.0
if
0AB0:   key_pressed 57//     key 9
jf @FLHILLU_141

:FLHILLU_229
wait 0
if
0AB0:   key_pressed 57//     key 9
jf @FLHILLU_11
jump @FLHILLU_229




Opcode create_searchlight illuminates the ground and shows white beams
script below creates search light above Player by keypress 8
CODE
{$CLEO .cs}
:WhiteSearchLightLamp
thread 'WSLAMP'

:WhitSrchLght_11
wait 0
if
0256: player $PLAYER_CHAR defined
jf @WhitSrchLght_11  
if
0AB0:   key_pressed 56//     8 key
jf @WhitSrchLght_11
04C4: store_coords_to 1@ 2@ 3@ from_actor $PLAYER_ACTOR with_offset 0.0 0.0 70.0
04C4: store_coords_to 4@ 5@ 6@ from_actor $PLAYER_ACTOR with_offset 0.0 0.0 -0.5
06B1: 10@ = create_searchlight_at 1@ 2@ 3@ radius 5.0 target 4@ 5@ 6@ radius 71.0
06B6: set_searchlight 10@ follow_actor $PLAYER_ACTOR speed 1.2  
wait 1000

:WhitSrchLght_46
wait 0
if
0256: player $PLAYER_CHAR defined
jf @WhitSrchLght_47
if
0AB0:   key_pressed 56//     8 key
jf @WhitSrchLght_46

:WhitSrchLght_47
06B2: destroy_searchlight 10@
wait 1000
jump @WhitSrchLght_11




________

shadow
________


016F: create_particle 1 makes shadow on the ground
script below makes shadow at player by holding backspace key

CODE
{$CLEO .cs}
:Particle_Shadow
03A4: name_thread 'PTSHAD'

:PTSHAD_01
0001: wait  0 ms
if
0256: player $PLAYER_CHAR defined
004D: jump_if_false @PTSHAD_01
if
0AB0:   key_pressed 8//-----------------------press Backspace
004D: jump_if_false @PTSHAD_01
04C4: create_coordinate 1@ 2@ 3@ from_actor $PLAYER_ACTOR offset 0.0 0.0  0.0
016F: create_particle 1 rotation_factor 0.0 size 180.0 intensity 250 flags 0 0 0 at 1@ 2@ 3@
jump @PTSHAD_01



----------------------------------------------------------------------------------------------------------------------------------------------

----------------------------------------------------------------------------------------------------------------------------------------------

QUOTE (hellya2011 @ Oct 3 2010, 01:03)
hey zaz can you help me? i am trying to attach the effect "sparycan" to a weapon so when i press backspace it appears... what is the code for doing that? Plz Help zaz or someone  nervous.gif

opcode 0883: assignes the particles attachment to_actor to a bone
this let the particle appear at player_actors hand:
CODE
066A: 0@ = attach_particle "spraycan" to_actor $PLAYER_ACTOR with_offset -0.301  -0.2  0.17 rotation -5.5  -3.5  0.0 flag 1  
0883: attach_particle 0@ to_actor $PLAYER_ACTOR on_bone 26
064C: make_particle 0@ visible


It needs different offsets for each weapon

The script below attaches particle "spraycan" to player_actor hand
by using pistols or smg and pressing RMB or fire- or aim- button
But only for Silenced pistol and MP5 it looks good
for the other weapons it needs other offsets
also for using on bike or in car while driveby with mouseview
CODE
{$CLEO .cs}
:Spraycan_at_ActorHand
03A4: name_thread 'SPRAYWP'

:SPRAYWP_01
0001: wait  0 ms
if
0256: player $PLAYER_CHAR defined
004D: jump_if_false @SPRAYWP_01
if  or
00E1:   key_pressed  0  17
00E1:   key_pressed  0  6
0AB0:   key_pressed 2//  -- RMB  
004D: jump_if_false @SPRAYWP_01
if
8965:   not actor $PLAYER_ACTOR swimming
004D: jump_if_false @SPRAYWP_01
if or
02D8:   actor $PLAYER_ACTOR current_weapon == 22
02D8:   actor $PLAYER_ACTOR current_weapon == 23
02D8:   actor $PLAYER_ACTOR current_weapon == 24
004D: jump_if_false @SPRAYWP_02
066A: 0@ = attach_particle "spraycan" to_actor $PLAYER_ACTOR with_offset -0.1  -0.22  0.13 rotation -1.5  -3.5  0.0 flag 1  
0883: attach_particle 0@ to_actor $PLAYER_ACTOR mode 26
064C: make_particle 0@ visible
0002: jump @SPRAYWP_13

:SPRAYWP_02
if
02D8:   actor $PLAYER_ACTOR current_weapon == 29
004D: jump_if_false @SPRAYWP_03
0002: jump @SPRAYWP_10

:SPRAYWP_03
if or
02D8:   actor $PLAYER_ACTOR current_weapon == 32
02D8:   actor $PLAYER_ACTOR current_weapon == 28
004D: jump_if_false @SPRAYWP_01
if or
00E1:   key_pressed  0  17
0AB0:   key_pressed 2//  -- RMB
004D: jump_if_false @SPRAYWP_01
if
0449:   actor $PLAYER_ACTOR in_a_car
004D: jump_if_false @SPRAYWP_01

:SPRAYWP_10
066A: 0@ = attach_particle "spraycan" to_actor $PLAYER_ACTOR with_offset -0.301  -0.2  0.17 rotation -5.5  -3.5  0.0 flag 1  
0883: attach_particle 0@ to_actor $PLAYER_ACTOR on_bone 26
064C: make_particle 0@ visible

:SPRAYWP_13
0001: wait  0 ms
if
0256: player $PLAYER_CHAR defined
004D: jump_if_false @SPRAYWP_15
if  or
00E1:   key_pressed  0  17
00E1:   key_pressed  0  6
0AB0:   key_pressed 2//  -- RMB  
004D: jump_if_false @SPRAYWP_15
if
8965:   not actor $PLAYER_ACTOR swimming
004D: jump_if_false @SPRAYWP_15
if or
02D8:   actor $PLAYER_ACTOR current_weapon == 22
02D8:   actor $PLAYER_ACTOR current_weapon == 23
02D8:   actor $PLAYER_ACTOR current_weapon == 24
02D8:   actor $PLAYER_ACTOR current_weapon == 28
02D8:   actor $PLAYER_ACTOR current_weapon == 29
02D8:   actor $PLAYER_ACTOR current_weapon == 32
004D: jump_if_false @SPRAYWP_15
0002: jump @SPRAYWP_13

:SPRAYWP_15
0976: destroy_particle 0@  
0001: wait  1000 ms
0002: jump @SPRAYWP_01

hellya2011
  • hellya2011

    Hellya2011

  • Members
  • Joined: 23 Sep 2009

#128

Posted 03 October 2010 - 04:05 PM

QUOTE (ZAZ @ Oct 3 2010, 10:17)
QUOTE (hellya2011 @ Oct 3 2010, 01:03)
hey zaz can you help me? i am trying to attach the effect "sparycan" to a weapon so when i press backspace it appears... what is the code for doing that? Plz Help zaz or someone  nervous.gif

opcode 0883: assignes the particles attachment to_actor to a bone
this let the particle appear at player_actors hand:
CODE
066A: 0@ = attach_particle "spraycan" to_actor $PLAYER_ACTOR with_offset -0.301  -0.2  0.17 rotation -5.5  -3.5  0.0 flag 1  
0883: attach_particle 0@ to_actor $PLAYER_ACTOR on_bone 26
064C: make_particle 0@ visible


It needs different offsets for each weapon

The script below attaches particle "spraycan" to player_actor hand
by using pistols or smg and pressing RMB or fire- or aim- button
But only for Silenced pistol and MP5 it looks good
for the other weapons it needs other offsets
also for using on bike or in car while driveby with mouseview
CODE
{$CLEO .cs}
:Spraycan_at_ActorHand
03A4: name_thread 'SPRAYWP'

:SPRAYWP_01
0001: wait  0 ms
if
0256: player $PLAYER_CHAR defined
004D: jump_if_false @SPRAYWP_01
if  or
00E1:   key_pressed  0  17
00E1:   key_pressed  0  6
0AB0:   key_pressed 2//  -- RMB  
004D: jump_if_false @SPRAYWP_01
if
8965:   not actor $PLAYER_ACTOR swimming
004D: jump_if_false @SPRAYWP_01
if or
02D8:   actor $PLAYER_ACTOR current_weapon == 22
02D8:   actor $PLAYER_ACTOR current_weapon == 23
02D8:   actor $PLAYER_ACTOR current_weapon == 24
004D: jump_if_false @SPRAYWP_02
066A: 0@ = attach_particle "spraycan" to_actor $PLAYER_ACTOR with_offset -0.1  -0.22  0.13 rotation -1.5  -3.5  0.0 flag 1  
0883: attach_particle 0@ to_actor $PLAYER_ACTOR mode 26
064C: make_particle 0@ visible
0002: jump @SPRAYWP_13

:SPRAYWP_02
if
02D8:   actor $PLAYER_ACTOR current_weapon == 29
004D: jump_if_false @SPRAYWP_03
0002: jump @SPRAYWP_10

:SPRAYWP_03
if or
02D8:   actor $PLAYER_ACTOR current_weapon == 32
02D8:   actor $PLAYER_ACTOR current_weapon == 28
004D: jump_if_false @SPRAYWP_01
if or
00E1:   key_pressed  0  17
0AB0:   key_pressed 2//  -- RMB
004D: jump_if_false @SPRAYWP_01
if
0449:   actor $PLAYER_ACTOR in_a_car
004D: jump_if_false @SPRAYWP_01

:SPRAYWP_10
066A: 0@ = attach_particle "spraycan" to_actor $PLAYER_ACTOR with_offset -0.301  -0.2  0.17 rotation -5.5  -3.5  0.0 flag 1  
0883: attach_particle 0@ to_actor $PLAYER_ACTOR on_bone 26
064C: make_particle 0@ visible

:SPRAYWP_13
0001: wait  0 ms
if
0256: player $PLAYER_CHAR defined
004D: jump_if_false @SPRAYWP_15
if  or
00E1:   key_pressed  0  17
00E1:   key_pressed  0  6
0AB0:   key_pressed 2//  -- RMB  
004D: jump_if_false @SPRAYWP_15
if
8965:   not actor $PLAYER_ACTOR swimming
004D: jump_if_false @SPRAYWP_15
if or
02D8:   actor $PLAYER_ACTOR current_weapon == 22
02D8:   actor $PLAYER_ACTOR current_weapon == 23
02D8:   actor $PLAYER_ACTOR current_weapon == 24
02D8:   actor $PLAYER_ACTOR current_weapon == 28
02D8:   actor $PLAYER_ACTOR current_weapon == 29
02D8:   actor $PLAYER_ACTOR current_weapon == 32
004D: jump_if_false @SPRAYWP_15
0002: jump @SPRAYWP_13

:SPRAYWP_15
0976: destroy_particle 0@  
0001: wait  1000 ms
0002: jump @SPRAYWP_01

thanks for the help ZAZ

oseas12345
  • oseas12345

    Player Hater

  • Members
  • Joined: 25 Sep 2010

#129

Posted 06 October 2010 - 08:20 AM

hey ZAZ,I have a question, dozingoff.gif dozingoff.gif dozingoff.gif
1.how can i change the color of a particle?

2.how can i put the "prt_spark" to Cj?(ex.Back,head,arms etc.) happy.gif

thank u

ZAZ
  • ZAZ

    Kernlochbohrer

  • Feroci
  • Joined: 10 Jan 2005
  • European-Union

#130

Posted 06 October 2010 - 05:18 PM Edited by ZAZ, 06 October 2010 - 05:59 PM.

QUOTE (oseas12345 @ Oct 6 2010, 08:20)
hey ZAZ,I have a question, dozingoff.gif   dozingoff.gif   dozingoff.gif
1.how can i change the color of a particle?

2.how can i put the "prt_spark" to Cj?(ex.Back,head,arms etc.) happy.gif

thank u

1. in models\effects.fxp
did you read the particle effects tutorial ?
it shows where to find the color data

This is the color data of the colored PmC effects:


neonblue neonred neonyellow
FX_INFO_COLOUR_DATA:
TIMEMODEPRT: 1
RED:
FX_INTERP_DATA:
LOOPED: 0
NUM_KEYS: 2
FX_KEYFLOAT_DATA:
TIME: 0.000
VAL: 7.000
FX_KEYFLOAT_DATA:
TIME: 1.000
VAL: 7.000
GREEN:
FX_INTERP_DATA:
LOOPED: 0
NUM_KEYS: 2
FX_KEYFLOAT_DATA:
TIME: 0.000
VAL: 7.000
FX_KEYFLOAT_DATA:
TIME: 1.000
VAL: 7.000
BLUE:
FX_INTERP_DATA:
LOOPED: 0
NUM_KEYS: 2
FX_KEYFLOAT_DATA:
TIME: 0.000
VAL: 255.000
FX_KEYFLOAT_DATA:
TIME: 1.000
VAL: 255.000
ALPHA:
FX_INTERP_DATA:
LOOPED: 0
NUM_KEYS: 2
FX_KEYFLOAT_DATA:
TIME: 0.000
VAL: 255.000
FX_KEYFLOAT_DATA:
TIME: 1.000
VAL: 0.000
FX_INFO_COLOUR_DATA:
TIMEMODEPRT: 1
RED:
FX_INTERP_DATA:
LOOPED: 0
NUM_KEYS: 2
FX_KEYFLOAT_DATA:
TIME: 0.000
VAL: 255.000
FX_KEYFLOAT_DATA:
TIME: 1.000
VAL: 255.000
GREEN:
FX_INTERP_DATA:
LOOPED: 0
NUM_KEYS: 2
FX_KEYFLOAT_DATA:
TIME: 0.000
VAL: 7.000
FX_KEYFLOAT_DATA:
TIME: 1.000
VAL: 7.000
BLUE:
FX_INTERP_DATA:
LOOPED: 0
NUM_KEYS: 2
FX_KEYFLOAT_DATA:
TIME: 0.000
VAL: 7.000
FX_KEYFLOAT_DATA:
TIME: 1.000
VAL: 7.000
ALPHA:
FX_INTERP_DATA:
LOOPED: 0
NUM_KEYS: 2
FX_KEYFLOAT_DATA:
TIME: 0.000
VAL: 255.000
FX_KEYFLOAT_DATA:
TIME: 1.000
VAL: 0.000
FX_INFO_COLOUR_DATA:
TIMEMODEPRT: 1
RED:
FX_INTERP_DATA:
LOOPED: 0
NUM_KEYS: 2
FX_KEYFLOAT_DATA:
TIME: 0.000
VAL: 255.000
FX_KEYFLOAT_DATA:
TIME: 1.000
VAL: 255.000
GREEN:
FX_INTERP_DATA:
LOOPED: 0
NUM_KEYS: 2
FX_KEYFLOAT_DATA:
TIME: 0.000
VAL: 210.000
FX_KEYFLOAT_DATA:
TIME: 1.000
VAL: 210.000
BLUE:
FX_INTERP_DATA:
LOOPED: 0
NUM_KEYS: 2
FX_KEYFLOAT_DATA:
TIME: 0.000
VAL: 7.000
FX_KEYFLOAT_DATA:
TIME: 1.000
VAL: 7.000
ALPHA:
FX_INTERP_DATA:
LOOPED: 0
NUM_KEYS: 2
FX_KEYFLOAT_DATA:
TIME: 0.000
VAL: 255.000
FX_KEYFLOAT_DATA:
TIME: 1.000
VAL: 0.000


the effect shows the texture-alphachannel in the defined colors if it's set to 255.00

It shows the image of the textur if your decrease the alpha value




texture-alphachannel image of the textur
ALPHA:
FX_INTERP_DATA:
LOOPED: 0
NUM_KEYS: 2
FX_KEYFLOAT_DATA:
TIME: 0.000
VAL: VAL: 255.000
FX_KEYFLOAT_DATA:
TIME: 1.000
VAL: 0.000
ALPHA:
FX_INTERP_DATA:
LOOPED: 0
NUM_KEYS: 2
FX_KEYFLOAT_DATA:
TIME: 0.000
VAL: VAL: 132.000
FX_KEYFLOAT_DATA:
TIME: 1.000
VAL: 20.000


----------------------------------------------------------------


2.
take the spraycanscript from above
and change just the particlenames
replace 2x "spraycan" with "prt_spark"
both are PLAYMODE: 2 - particles
modify the position is your work
It needs different offsets for each weapon

opcode 0883: assignes the particles attachment to_actor to a bone
this let the particle appear at player_actors hand:
CODE
066A: 0@ = attach_particle "spraycan" to_actor $PLAYER_ACTOR with_offset -0.301  -0.2  0.17 rotation -5.5  -3.5  0.0 flag 1  
0883: attach_particle 0@ to_actor $PLAYER_ACTOR on_bone 26
064C: make_particle 0@ visible


attach_particle .. on_bone 26 = is at hand or lower arm
attach_particle .. on_bone 5 = head, i think
find out yourself


ergic
  • ergic

    Player Hater

  • Members
  • Joined: 06 Aug 2010

#131

Posted 07 October 2010 - 10:33 AM

hi can someone help me in gta san andreas how can i make a car spawn in an area or how can i select a area to make a car spawn and make it drive by a pls help me

oseas12345
  • oseas12345

    Player Hater

  • Members
  • Joined: 25 Sep 2010

#132

Posted 07 October 2010 - 10:35 AM

thank you for this now i can complete my cleo
thank you very much!!!

ZAZ
  • ZAZ

    Kernlochbohrer

  • Feroci
  • Joined: 10 Jan 2005
  • European-Union

#133

Posted 07 October 2010 - 03:33 PM

QUOTE (oseas12345 @ Oct 7 2010, 10:35)
thank you for this now i can complete my cleo
thank you very much!!!

nice, looking forward to me

QUOTE (ergic @ Oct 7 2010, 10:33)
hi can someone help me in gta san andreas how can i make a car spawn in an area or how can i select a area to make a car spawn and make it drive by a  pls help me

read the complete first lesson of this tutorial and try the example scripts
then read Car Drive Tutorial

ergic
  • ergic

    Player Hater

  • Members
  • Joined: 06 Aug 2010

#134

Posted 08 October 2010 - 09:56 AM

QUOTE (ZAZ @ Oct 7 2010, 15:33)
QUOTE (ergic @ Oct 7 2010, 10:33)
hi can someone help me in gta san andreas how can i make a car spawn in an area or how can i select a area to make a car spawn and make it drive by a  pls help me

read the complete first lesson of this tutorial and try the example scripts
then read Car Drive Tutorial

yeah i already read this but how can i change the spawn location and remove the marker how can i make it that when i go at an area the car instanly spawns and being drive by a ped pls make a code for me T.T i want it to spawn the car in some small towns

ZAZ
  • ZAZ

    Kernlochbohrer

  • Feroci
  • Joined: 10 Jan 2005
  • European-Union

#135

Posted 09 October 2010 - 06:38 AM

QUOTE (ergic @ Oct 8 2010, 09:56)
QUOTE (ZAZ @ Oct 7 2010, 15:33)
QUOTE (ergic @ Oct 7 2010, 10:33)
hi can someone help me in gta san andreas how can i make a car spawn in an area or how can i select a area to make a car spawn and make it drive by a  pls help me

read the complete first lesson of this tutorial and try the example scripts
then read Car Drive Tutorial

yeah i already read this but how can i change the spawn location and remove the marker how can i make it that when i go at an area the car instanly spawns and being drive by a ped pls make a code for me T.T i want it to spawn the car in some small towns

You're question sounds like a request and not to get help for writing a script.
You can download an actor-driveby script at my Webpage
Learning mission coding means, use the brain.
And if you're a N00b, you need first praxis by writing small simple scripts
to see what your script do ingame. For example, show a text by keypress or spawn a car
like in the script "3dModels" of first lesson.
There you will find the conditional check if player_actor is in a defined location:
CODE
if
00FF:   actor $PLAYER_ACTOR  1 (in-sphere)near_point_on_foot 2491.5  -1667.5  13.35 radius  1.0  1.0  1.0
004D: jump_if_false @3dModels_2

It shows a sphere (red marker) because the second parameter is set to 1 :
actor $PLAYER_ACTOR 1 (in-sphere)near_point_on_foot
It don't show a sphere if you set this param to zero:
actor $PLAYER_ACTOR 0 (in-sphere)near_point_on_foot

The last 3 params specify the size of the check-location
There are a lot similar opcodes to check a location, use sannybuilders opcode search
And there are other methods to specify a location or area for the spawning.

Well, I allready posted 2 example Drivbyscripts, two weeks ago in the mission coding forum: click here

DRIVEBY
2 scripts, first one to let player drive a car and do driveby at same time
the other one creates a car and two gangster, doing driveby against player

press backspace while in car to start driveby
CODE
{$CLEO .cs}
:DRIVEBYsingle_01
thread 'DVBY'

:DRIVBYsingle_3
wait 0
if
  Player.Defined($PLAYER_CHAR)
jf @DRIVBYsingle_3
if and
84A7:   not actor $PLAYER_ACTOR driving_boat
84C8:   not actor $PLAYER_ACTOR driving_flying_vehicle
  Actor.Driving($PLAYER_ACTOR)
0AB0:   key_pressed 8//--- Backspace
jf @DRIVBYsingle_3
jump @DRIVBYsingle_7

:DRIVBYsingle_7
Player.CanMove($PLAYER_CHAR) = False
03BF: set_player $PLAYER_CHAR ignored_by_everyone 1
03C0: 5@ = actor $PLAYER_ACTOR car
Car.SetMaxSpeed(5@, 0.0)
Car.SetImmunities(5@, 0, 0, 0, 0, 0)
0A30: repair_car 5@
Car.Health(5@) = 5000
Car.DoorStatus(5@) = 0
053F: set_car 5@ tires_vulnerability 0
Camera.SetBehindPlayer
Camera.Restore_WithJumpCut
1@ = 0
wait 500
Car.LockInCurrentPosition(5@) = True
Model.Load(#TEC9)

:DRIVBYsingle_13
wait 0
if
  Model.Available(#TEC9)
jf @DRIVBYsingle_13
0633: AS_actor $PLAYER_ACTOR exit_car
wait 2000
01B2: give_actor $PLAYER_ACTOR weapon 32 ammo 99999 // Load the weapon model before using this
wait 250
05CB: AS_actor $PLAYER_ACTOR enter_car 5@ as_driver 0 ms
Model.Destroy(#TEC9)
03BF: set_player $PLAYER_CHAR ignored_by_everyone 0
wait 250
Player.CanMove($PLAYER_CHAR) = True

:DRIVBYsingle_20
wait 50
if
  Player.Defined($PLAYER_CHAR)
jf @DRIVBYsingle_50
if and
  not Car.Wrecked(5@)
82BF:   not car 5@ sunk
jf @DRIVBYsingle_50
if
  Actor.Driving($PLAYER_ACTOR)
jf @DRIVBYsingle_50
if
 1@ == 0
jf @DRIVBYsingle_30
wait 0
0A30: repair_car 5@
Car.Health(5@) = 5000
Car.LockInCurrentPosition(5@) = False
Car.DoorStatus(5@) = 4
wait 1000
0713: actor $PLAYER_ACTOR driveby_actor -1 car -1 point 0.0 0.0 0.0 radius 300.0 8 0 firing_rate 100
1@ = 1
wait 1000
jump @DRIVBYsingle_20

:DRIVBYsingle_30
if or
00E1:   player 0 pressed_key 15
0AB0:   key_pressed 53
jf @DRIVBYsingle_20
Car.SetMaxSpeed(5@, 0.0)
Car.DoorStatus(5@) = 0
0633: AS_actor $PLAYER_ACTOR exit_car
wait 1000
jump @DRIVBYsingle_50

:DRIVBYsingle_50
0501: set_player $PLAYER_CHAR driveby_mode 1
1@ = 0
Car.LockInCurrentPosition(5@) = False
Car.RemoveReferences(5@)
jump @DRIVBYsingle_3


go to street and wait a moment till car with actors arrive
CODE
{$CLEO .cs}
:DriveBY_actor
thread 'DVBYACT'

:DVBYACT_11
wait 0
if
  Player.Defined($PLAYER_CHAR)
jf @DVBYACT_11
if
84A9:   not actor $PLAYER_ACTOR driving_heli
84C8:   not actor $PLAYER_ACTOR driving_flying_vehicle
84A7:   not actor $PLAYER_ACTOR driving_boat
89AE:   not actor $PLAYER_ACTOR driving_train
jf @DVBYACT_11
077E: get_active_interior_to 20@
if and
 $ONMISSION == 0
 20@ == 0
jf @DVBYACT_11
04C4: store_coords_to 11@ 12@ 13@ from_actor $PLAYER_ACTOR with_offset -100.0 50.0 0.0
04C4: store_coords_to 14@ 15@ 16@ from_actor $PLAYER_ACTOR with_offset 100.0 200.0 0.0
053E: 0@ = get_random_car_with_model -1 in_rectangle_cornerA 11@ 12@ cornerB 14@ 15@
if
  not 0@ == -1
jf @DVBYACT_11
0407: store_coords_to 1@ 2@ 3@ from_car 0@ with_offset 0.0 0.0 0.0
4@ = Car.Angle(0@)
Model.Load(#VWMYCR)
Model.Load(#BMYDRUG)
Model.Load(#SAVANNA)
Model.Load(#MP5LNG)

:DVBYACT_243
wait 0
if and
  Model.Available(#VWMYCR)
  Model.Available(#BMYDRUG)
  Model.Available(#SAVANNA)
  Model.Available(#MP5LNG)
jf @DVBYACT_243
5@ = Car.Create(#SAVANNA, 1@, 2@, 3@)
Car.Angle(5@) = 4@
Car.Health(5@) = 1000
053F: set_car 5@ tires_vulnerability 0
Car.Destroy(0@)
0129: 7@ = create_actor_pedtype 7 model #VWMYCR in_car 5@ driverseat
01C8: 8@ = create_actor_pedtype 7 model #BMYDRUG in_car 5@ passenger_seat 0
Actor.Health(7@) = 1000
Actor.Health(8@) = 1000
0446: set_actor 7@ immune_to_headshots 0
0446: set_actor 8@ immune_to_headshots 0
9@ = Marker.CreateAboveActor(7@)
00AE: set_car 5@ traffic_behaviour_to 2
Car.SetToPsychoDriver(5@)
Car.SetImmunities(5@, 1, 1, 1, 1, 1)
Model.Destroy(#VWMYCR)
Model.Destroy(#BMYDRUG)
Model.Destroy(#SAVANNA)
01B2: give_actor 8@ weapon 29 ammo 99999 // Load the weapon model before using this
Actor.WeaponAccuracy(8@) = 100
0713: actor 8@ driveby_actor $PLAYER_ACTOR car -1 point 0.0 0.0 0.0 radius 5000.0 4 1 firing_rate 40
Car.SetDriverBehaviour(5@, KillThePlayer)
Car.SetMaxSpeed(5@, 15.0)
33@ = 0
29@ = 0
28@ = 0

:DVBYACT_521
wait 0
if
  Player.Defined($PLAYER_CHAR)
jf @DVBYACT_1539
077E: get_active_interior_to 20@
if and
 20@ == 0
 $ONMISSION == 0
  not Car.Wrecked(5@)
81F4:   not car 5@ flipped
jf @DVBYACT_1539
if or
 29@ == 0
 29@ == 1
 29@ == 2
jf @DVBYACT_1053
jump @DVBYACT_703
if
03CE:   car 5@ stuck
jf @DVBYACT_703
if or
 29@ == 0
 29@ == 1
jf @DVBYACT_703
06C7: AS_actor 7@ driver_of_car 5@ perform_action 14 timelimit 500
wait 500
Car.SetDriverBehaviour(5@, KillThePlayer)
Car.SetMaxSpeed(5@, 50.0)
29@ = 2

:DVBYACT_703
if
 29@ == 0
jf @DVBYACT_782
if or
 10000 > 33@
0202:   actor $PLAYER_ACTOR near_car 5@ radius 70.0 70.0 flag 0
jf @DVBYACT_1539
Car.SetImmunities(5@, 0, 0, 0, 0, 0)
29@ = 1

:DVBYACT_782
if
0202:   actor $PLAYER_ACTOR near_car 5@ radius 15.0 15.0 flag 0
jf @DVBYACT_878
if or
 29@ == 0
 29@ == 1
jf @DVBYACT_1053
if
  not Actor.Driving($PLAYER_ACTOR)
jf @DVBYACT_1053
Car.SetMaxSpeed(5@, 0.0)
29@ = 2
jump @DVBYACT_1053

:DVBYACT_878
if
0202:   actor $PLAYER_ACTOR near_car 5@ radius 17.0 17.0 flag 0
jf @DVBYACT_965
if or
 29@ == 0
 29@ == 2
jf @DVBYACT_1053
Car.SetDriverBehaviour(5@, KillThePlayer)
Car.SetMaxSpeed(5@, 50.0)
29@ = 1
jump @DVBYACT_1053

:DVBYACT_965
if or
 29@ == 1
 29@ == 2
jf @DVBYACT_1053
if or
 10000 > 33@
0202:   actor $PLAYER_ACTOR near_car 5@ radius 50.0 50.0 flag 0
jf @DVBYACT_1539
Car.SetDriverBehaviour(5@, KillThePlayer)
Car.SetMaxSpeed(5@, 50.0)
29@ = 0

:DVBYACT_1053
if and
  not Actor.Dead(7@)
  not Actor.Dead(8@)
jf @DVBYACT_1140
if or
 29@ == 0
 29@ == 1
 29@ == 2
jf @DVBYACT_1140
if and
  Actor.InCar(7@, 5@)
  Actor.InCar(8@, 5@)
jf @DVBYACT_1140
jump @DVBYACT_521

:DVBYACT_1140
if
  not Actor.Dead(7@)
jf @DVBYACT_1335
wait 250
if
  Actor.InCar(7@, 5@)
jf @DVBYACT_1200
Car.SetMaxSpeed(5@, 0.0)
0633: AS_actor 7@ exit_car
wait 1000

:DVBYACT_1200
if or
 29@ == 0
 29@ == 1
 29@ == 2
 29@ == 4
jf @DVBYACT_1335
if or
 28@ == 0
 28@ == 2
jf @DVBYACT_1335
if
  not Actor.Dead(7@)
jf @DVBYACT_1335
01B2: give_actor 7@ weapon 29 ammo 99999 // Load the weapon model before using this
Actor.WeaponAccuracy(7@) = 50
05E2: AS_actor 7@ kill_actor $PLAYER_ACTOR
0446: set_actor 7@ immune_to_headshots 1
29@ = 3
28@ += 1
jump @DVBYACT_521

:DVBYACT_1335
if
  not Actor.Dead(8@)
jf @DVBYACT_1511
wait 250
if
  Actor.InCar(8@, 5@)
jf @DVBYACT_1395
Car.SetMaxSpeed(5@, 0.0)
0633: AS_actor 8@ exit_car
wait 1000

:DVBYACT_1395
if or
 29@ == 0
 29@ == 1
 29@ == 2
 29@ == 3
jf @DVBYACT_1511
if or
 28@ == 0
 28@ == 1
jf @DVBYACT_1511
if
  not Actor.Dead(8@)
jf @DVBYACT_1511
05E2: AS_actor 8@ kill_actor $PLAYER_ACTOR
0446: set_actor 8@ immune_to_headshots 1
29@ = 4
28@ += 1
jump @DVBYACT_521

:DVBYACT_1511
if or
  not Actor.Dead(7@)
  not Actor.Dead(8@)
jf @DVBYACT_1539
jump @DVBYACT_521

:DVBYACT_1539
Model.Destroy(#MP5LNG)
Marker.Disable(9@)
Actor.RemoveReferences(7@)
Actor.RemoveReferences(8@)
Car.SetImmunities(5@, 0, 0, 0, 0, 0)
Car.RemoveReferences(5@)
jump @DVBYACT_11


ergic
  • ergic

    Player Hater

  • Members
  • Joined: 06 Aug 2010

#136

Posted 11 October 2010 - 09:54 AM

thanlk you this realy helped me a lot ^^ sorry if im realy annoying

kal-el5676
  • kal-el5676

    Zombie Killa

  • Members
  • Joined: 02 Nov 2008

#137

Posted 13 October 2010 - 03:55 AM

Ok, super weird/dumb question. Why don't my helicopter spawns ever work?

Example:
CODE
014B: $RAINDANCE = init_parked_car_generator #RAINDANC color -1 -1 -1 alarm 0 door_lock 0 0 10000 at 994.148 -1669.127 9.4978 angle 10.6334
014C: set_parked_car_generator $RAINDANCE cars_to_generate_to 101


It compiles but they never show up. EVER.

Silent
  • Silent

    Moderating Cookie Monster

  • Feroci
  • Joined: 01 Feb 2010
  • Poland
  • Most Helpful [GTA] 2013
    Most Helpful [Modding] 2013
    Most Talented [Modding] 2013
    Best Map 2013 "ViceCityStories PC Edition"
    Best Vehicle 2013 "III Aircraft"
    Most Helpful [Modding] 2012
    Modder of the Year 2012

#138

Posted 13 October 2010 - 01:22 PM

CODE
014B: $PARKED_RHINO = init_parked_car_generator #RHINO color -1 -1 force_spawn 1 alarm 0 door_lock 0 unknown_ipl_11 0 10000 at 2435.302 -1671.848 12.8007 angle 90.0


change force_spawn from -1 to 1.

You should update sascm.ini and opcodes.txt from Opcode DB tounge.gif

kal-el5676
  • kal-el5676

    Zombie Killa

  • Members
  • Joined: 02 Nov 2008

#139

Posted 13 October 2010 - 01:34 PM Edited by kal-el5676, 13 October 2010 - 01:43 PM.

Thanks. Still doesn't work though. tounge.gif

EDIT: It does work, but i need to start a new game?

Silent
  • Silent

    Moderating Cookie Monster

  • Feroci
  • Joined: 01 Feb 2010
  • Poland
  • Most Helpful [GTA] 2013
    Most Helpful [Modding] 2013
    Most Talented [Modding] 2013
    Best Map 2013 "ViceCityStories PC Edition"
    Best Vehicle 2013 "III Aircraft"
    Most Helpful [Modding] 2012
    Modder of the Year 2012

#140

Posted 13 October 2010 - 01:53 PM

If this is done in CLEO, then not. If you've pasted that line into main.scm, sadly you have to start a new game.

kal-el5676
  • kal-el5676

    Zombie Killa

  • Members
  • Joined: 02 Nov 2008

#141

Posted 13 October 2010 - 02:11 PM

Yeah, it's cleo. But they never spawn on my saved game and always do in a new game. cry.gif

ZAZ
  • ZAZ

    Kernlochbohrer

  • Feroci
  • Joined: 10 Jan 2005
  • European-Union

#142

Posted 22 October 2010 - 11:58 AM

QUOTE (kal-el5676 @ Oct 13 2010, 03:55)
Ok, super weird/dumb question. Why don't my helicopter spawns ever work?

Example:
CODE
014B: $RAINDANCE = init_parked_car_generator #RAINDANC color -1 -1 -1 alarm 0 door_lock 0 0 10000 at 994.148 -1669.127 9.4978 angle 10.6334
014C: set_parked_car_generator $RAINDANCE cars_to_generate_to 101


It compiles but they never show up. EVER.

You should use local variables in cleo scripts: 0@ = init_parked_car_generator
Your savegame seems to be corrupted. Start a unmodded gtasa installation and make a savegame. Then put the cleo files and scripts inthere and load that savegame
use 0A95: enable_thread_saving

Where should the RAINDANC be ?
the y,x,z coords are in a building in LS - Verona Beach
increase the z- height to 30.0 to generate the heli on the roof

script below installs an pareked car generator to spawn RAINDANC on roof in LS
and teleports the player as soon as he is outside near the heli
you must first leave this area, far enough, and then come back
CODE
{$CLEO .cs}
:PARKCAR_2
03A4: name_thread 'PARKCAR'
0001: wait  3000 ms
0A95: enable_thread_saving
014B: 0@ = init_parked_car_generator #RAINDANC color -1 -1 -1 alarm 0 door_lock 0 0 10000 at 994.148 -1669.127 30.4978 angle 10.6334
014C: set_parked_car_generator 0@ cars_to_generate_to 101

:PARKCAR_4
wait 1000
077E: get_active_interior_to 29@
if
0039:   29@ == 0
jf @PARKCAR_4
wait 4000
00A1: put_actor $PLAYER_ACTOR at 990.148 -1665.127 30.4978
0A93: end_custom_thread

rapsis2x2
  • rapsis2x2

    Player Hater

  • Members
  • Joined: 10 Dec 2009

#143

Posted 22 October 2010 - 03:40 PM

I must read ALL that? Man, scripting is some serious sh*t.

rooood
  • rooood

    Player Hater

  • Members
  • Joined: 23 Oct 2010

#144

Posted 23 October 2010 - 03:02 AM Edited by rooood, 23 October 2010 - 07:22 PM.

ZAZ (or anyone who knows how to solve my problem), I need some help on a car dealer script.
I'm doing a test drive funcionality and to end it the player must bring hte car back to the dealer.
So far so good, but I want the player to exit the car and enter the dealer (Wang Cars on San Fierro) running.
I'm using scm paths (I used them without problems to drive a car), but I can't use it to make the player walk or run following the path (he always go straight to the last point on the path, OR tries to walk on a native SA path, idk).

So, how I'm supposed to use the opcode 05D8 to do this?

I'm using it as 05D8: AS_assign_scmpath to_actor $PLAYER_ACTOR flags 7 3, but the player is running towards the glass wall.

Btw, code for the path points:

CODE
05D6: clear_scmpath
05D7: add_point_to_scmpath  -1966.6013 294.0324 35.4687
05D7: add_point_to_scmpath  -1962.5699 293.9888 35.4687
05D7: add_point_to_scmpath  -1955.0 303.0 35.4687
05D8: AS_assign_scmpath to_actor $PLAYER_ACTOR flags 7 3

EDIT: Tested with only the first point and it worked (it was just a straight line though).
tested with the 2 first points and something bizarre happenned: Actor ran to first point but instead of keeping running forward to the next point (which is basically ahead of the 1st one) he turn back and stopped at a random point way off the specified coordinates.
And when I put all 3 points he just goes straight to the last point.
When i tested with 1 and 2 points, I updated last parameter to 1 and 2, respectively.

ZAZ
  • ZAZ

    Kernlochbohrer

  • Feroci
  • Joined: 10 Jan 2005
  • European-Union

#145

Posted 25 October 2010 - 05:13 PM

QUOTE (rapsis2x2 @ Oct 22 2010, 15:40)
I must read ALL that? Man, scripting is some serious sh*t.

No, you must read the first lesson (first post)
then make your first attemts
then read the next posts and test the example scripts
then write your own small scripts and test it just to get praxis
you need praxis in writing and testing scripts



QUOTE (rooood @ Oct 23 2010, 03:02)
ZAZ (or anyone who knows how to solve my problem), I need some help on a car dealer script.
I'm doing a test drive funcionality and to end it the player must bring hte car back to the dealer.
So far so good, but I want the player to exit the car and enter the dealer (Wang Cars on San Fierro) running.
I'm using scm paths (I used them without problems to drive a car), but I can't use it to make the player walk or run following the path (he always go straight to the last point on the path, OR tries to walk on a native SA path, idk).

So, how I'm supposed to use the opcode 05D8 to do this?

I'm using it as 05D8: AS_assign_scmpath to_actor $PLAYER_ACTOR flags 7 3, but the player is running towards the glass wall.

Btw, code for the path points:

CODE
05D6: clear_scmpath
05D7: add_point_to_scmpath  -1966.6013 294.0324 35.4687
05D7: add_point_to_scmpath  -1962.5699 293.9888 35.4687
05D7: add_point_to_scmpath  -1955.0 303.0 35.4687
05D8: AS_assign_scmpath to_actor $PLAYER_ACTOR flags 7 3

EDIT: Tested with only the first point and it worked (it was just a straight line though).
tested with the 2 first points and something bizarre happenned: Actor ran to first point but instead of keeping running forward to the next point (which is basically ahead of the 1st one) he turn back and stopped at a random point way off the specified coordinates.
And when I put all 3 points he just goes straight to the last point.
When i tested with 1 and 2 points, I updated last parameter to 1 and 2, respectively.

my grafichardware is defect, can't test anything ingame
play around with the flag values
CODE
05D6: clear_scmpath
05D7: add_point_to_scmpath  24@ 25@ 26@
05D7: add_point_to_scmpath  21@ 22@ 23@
05D8: AS_assign_scmpath to_actor 0@(30@,12i) flags  4  2

EdUaRdO - Brazil
  • EdUaRdO - Brazil

    Brazilian Scripter

  • Members
  • Joined: 14 Nov 2010

#146

Posted 14 November 2010 - 02:08 AM

Awesome work ZAZ....this is very helpfull for all icon14.gif

ZAZ
  • ZAZ

    Kernlochbohrer

  • Feroci
  • Joined: 10 Jan 2005
  • European-Union

#147

Posted 19 November 2010 - 03:26 PM

QUOTE (EdUaRdO - Brazil @ Nov 14 2010, 02:08)
Awesome work ZAZ....this is very helpfull for all icon14.gif

thanks EdUaRdO, nice website

EdUaRdO - Brazil
  • EdUaRdO - Brazil

    Brazilian Scripter

  • Members
  • Joined: 14 Nov 2010

#148

Posted 19 November 2010 - 10:06 PM Edited by EdUaRdO - Brazil, 01 December 2010 - 01:18 AM.

biggrin.gif

EdUaRdO - Brazil
  • EdUaRdO - Brazil

    Brazilian Scripter

  • Members
  • Joined: 14 Nov 2010

#149

Posted 01 December 2010 - 01:17 AM

QUOTE (ZAZ @ Nov 19 2010, 15:26)
QUOTE (EdUaRdO - Brazil @ Nov 14 2010, 02:08)
Awesome work ZAZ....this is very helpfull for all  icon14.gif

thanks EdUaRdO, nice website

Hey ZAZ, you know how to block scripts cleo or prevent it from being decompiled? Why has not some that decompiles Sanny .. was wondering if there's any way to do this .. Tnks

ZAZ
  • ZAZ

    Kernlochbohrer

  • Feroci
  • Joined: 10 Jan 2005
  • European-Union

#150

Posted 01 December 2010 - 05:16 PM Edited by ZAZ, 01 December 2010 - 05:33 PM.

QUOTE (EdUaRdO - Brazil @ Dec 1 2010, 01:17)
QUOTE (ZAZ @ Nov 19 2010, 15:26)
QUOTE (EdUaRdO - Brazil @ Nov 14 2010, 02:08)
Awesome work ZAZ....this is very helpfull for all  icon14.gif

thanks EdUaRdO, nice website

Hey ZAZ, you know how to block scripts cleo or prevent it from being decompiled? Why has not some that decompiles Sanny .. was wondering if there's any way to do this .. Tnks

add three unused codelines at the scriptend and then try to find it with hexeditor in the compiled cleo script
you should look for dots before the global variable list start and change one dot with three letters




2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users