Quantcast

Jump to content

» «
Photo

[GTA SA] ~ CLEO Script Tutorial ~

631 replies to this topic
kadallxxx
  • kadallxxx

    Player Hater

  • Members
  • Joined: 27 Feb 2013

#541

Posted 27 February 2013 - 02:46 PM

i want god mode. when i click the button "end" the car will run faster. and when i click "del" the car will stop

ZAZ
  • ZAZ

    Kernlochbohrer

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

#542

Posted 27 February 2013 - 04:04 PM

QUOTE (ik0N @ Wednesday, Feb 27 2013, 13:40)
Which opcode is thist:
Ped attack me, if i shot him?

I found only this:
CODE
05E2: AS_actor 1@ kill_actor $PLAYER_ACTOR

but is not good, because the ped is trying to kill me before i shot him... sarcasm.gif

you have to write a script that checks if the actor is damaged by player_actor

MRobinson
  • MRobinson

    Secret Agent

  • Members
  • Joined: 05 Jul 2012

#543

Posted 27 February 2013 - 06:49 PM

ok zaz i learn on my own from now. seems you wont be able to help anymore. cya around. sir...

ZAZ
  • ZAZ

    Kernlochbohrer

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

#544

Posted 27 February 2013 - 08:11 PM

QUOTE (MRobinson @ Wednesday, Feb 27 2013, 19:49)
ok zaz i learn on my own from now. seems you wont be able to help anymore. cya around. sir...

sorry, i didn't noticed that you edited your post
spawn a heli, then give him this codes
CODE
0825: set_helicopter 5@ instant_rotor_start
0727: set_heli 5@ behavior_to_police_heli_and_follow_actor $PLAYER_ACTOR follow_car -1 radius 9.0

TheGodfather.
  • TheGodfather.

    Nobody likes me here...I think...

  • Members
  • Joined: 19 Jun 2012

#545

Posted 28 February 2013 - 03:09 AM

QUOTE (kadallxxx @ Wednesday, Feb 27 2013, 20:16)
i want god mode. when i click the button "end" the car will run faster. and when i click "del" the car will stop

This ain't a request mod thread dude Ask Here : REQUEST MOD THREAD

@ZAZ: U are really a great modder dude..U have contributed a lot in this thread dude..Amazing.. icon14.gif ...btw check ur PM.. smile.gif

MRobinson
  • MRobinson

    Secret Agent

  • Members
  • Joined: 05 Jul 2012

#546

Posted 28 February 2013 - 09:26 AM Edited by MRobinson, 28 February 2013 - 12:41 PM.

QUOTE (ZAZ @ Thursday, Feb 28 2013, 01:41)
QUOTE (MRobinson @ Wednesday, Feb 27 2013, 19:49)
ok zaz i learn on my own from now. seems you wont be able to help anymore. cya around. sir...

sorry, i didn't noticed that you edited your post
spawn a heli, then give him this codes
CODE
0825: set_helicopter 5@ instant_rotor_start
0727: set_heli 5@ behavior_to_police_heli_and_follow_actor $PLAYER_ACTOR follow_car -1 radius 9.0

oh hey wow thanks, but thats what I did and my game crashed sad.gif
do we have to load the police heli too?

ZAZ
  • ZAZ

    Kernlochbohrer

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

#547

Posted 28 February 2013 - 01:16 PM

QUOTE (MRobinson @ Thursday, Feb 28 2013, 10:26)
QUOTE (ZAZ @ Thursday, Feb 28 2013, 01:41)
QUOTE (MRobinson @ Wednesday, Feb 27 2013, 19:49)
ok zaz i learn on my own from now. seems you wont be able to help anymore. cya around. sir...

sorry, i didn't noticed that you edited your post
spawn a heli, then give him this codes
CODE
0825: set_helicopter 5@ instant_rotor_start
0727: set_heli 5@ behavior_to_police_heli_and_follow_actor $PLAYER_ACTOR follow_car -1 radius 9.0

oh hey wow thanks, but thats what I did and my game crashed sad.gif
do we have to load the police heli too?

yes, of course, spawn means this: Spawn a 3D model

MRobinson
  • MRobinson

    Secret Agent

  • Members
  • Joined: 05 Jul 2012

#548

Posted 28 February 2013 - 02:59 PM Edited by MRobinson, 28 February 2013 - 03:59 PM.

QUOTE (ZAZ @ Thursday, Feb 28 2013, 18:46)
QUOTE (MRobinson @ Thursday, Feb 28 2013, 10:26)
QUOTE (ZAZ @ Thursday, Feb 28 2013, 01:41)
QUOTE (MRobinson @ Wednesday, Feb 27 2013, 19:49)
ok zaz i learn on my own from now. seems you wont be able to help anymore. cya around. sir...

sorry, i didn't noticed that you edited your post
spawn a heli, then give him this codes
CODE
0825: set_helicopter 5@ instant_rotor_start
0727: set_heli 5@ behavior_to_police_heli_and_follow_actor $PLAYER_ACTOR follow_car -1 radius 9.0

oh hey wow thanks, but thats what I did and my game crashed sad.gif
do we have to load the police heli too?

yes, of course, spawn means this: Spawn a 3D model

oh hey thanks man. I was working on my mod since 2 weeks, this will be the latest feature, thanks to you. I have not tried it yet. but please visit
http://mohitrobinson...em.blogspot.in/

MRobinson
  • MRobinson

    Secret Agent

  • Members
  • Joined: 05 Jul 2012

#549

Posted 01 March 2013 - 11:18 AM

After trying so much.. what I get is.. a police helicopter... barking like original cop helicopter. but.... it does not chase me. It does not fly in air. all is does it to fall down at the spot I set and bark like a moron on the spot. its very funny to see that... but its not the proper working of the feature. I also set rotor opcode on along with the act like a police heli opcode. Nothing budges.
The feature is very necessary for v4. I wish I could show you a video and also show how that sucks so badly. Please tell me if you know how to make a heli fly in the air... I also set a cop in it.. the cop is neccessary to check if the player actor is in view.
Help me... dozingoff.gif

ZAZ
  • ZAZ

    Kernlochbohrer

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

#550

Posted 01 March 2013 - 11:28 AM

QUOTE (MRobinson @ Friday, Mar 1 2013, 12:18)
After trying so much.. what I get is.. a police helicopter... barking like original cop helicopter. but.... it does not chase me. It does not fly in air. all is does it to fall down at the spot I set and bark like a moron on the spot. its very funny to see that... but its not the proper working of the feature. I also set rotor opcode on along with the act like a police heli opcode. Nothing budges.
The feature is very necessary for v4. I wish I could show you a video and also show how that sucks so badly. Please tell me if you know how to make a heli fly in the air... I also set a cop in it.. the cop is neccessary to check if the player actor is in view.
Help me... dozingoff.gif

post your script

MRobinson
  • MRobinson

    Secret Agent

  • Members
  • Joined: 05 Jul 2012

#551

Posted 01 March 2013 - 11:37 AM Edited by MRobinson, 01 March 2013 - 11:49 AM.

// This file was decompiled using sascm.ini published by Seemann (http://sannybuilder.com/files/SASCM.rar) on 13.10.2007

{$VERSION 3.1.0027}
{$CLEO .cs}

//-------------MAIN---------------
0000: NOP
03A4: name_thread 'HLCHASE'
0001: wait 2000 ms

:HLCHASE_34
0001: wait 0 ms
00D6: if and
0256: player $PLAYER_CHAR defined
010F: player $PLAYER_CHAR wanted_level > 3
004D: jump_if_false @HLCHASE_34
0002: jump @HLCHASE_68

:HLCHASE_68
0001: wait 0 ms
0247: request_model 280
0247: request_model 497
038B: load_requested_models
00D6: if and
0248: model 280 available
0248: model 497 available
004D: jump_if_false @HLCHASE_68
0002: jump @HLCHASE_98

:HLCHASE_98
0001: wait 10000 ms
04C4: create_coordinate 11@ 12@ 13@ from_actor $PLAYER_ACTOR offset 10.0 16.5 10.0
00A5: 5@ = create_car #POLMAV at 11@ 12@ 13@
0129: 4@ = create_actor_pedtype 6 model #LAPD1 in_car 5@ driverseat
0825: set_helicopter 5@ instant_rotor_start
0727: set_heli 5@ behavior_to_police_heli_and_follow_actor $PLAYER_ACTOR follow_car -1 radius 50.0
0002: jump @HLCHASE_148

:HLCHASE_148
0001: wait 30000 ms
0002: jump @HLCHASE_34


this is the 4th cs file by me, anyways.. can you come online at gta mods mania...? then we can chat about it sir.

EDIT: I tested it 12 times. It works often.. I will set the z axis height more.
But I got other small problems regarding that too. Please come online at http://gtamodsmania.forumotions.in/

ZAZ
  • ZAZ

    Kernlochbohrer

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

#552

Posted 01 March 2013 - 11:57 AM

QUOTE (MRobinson @ Friday, Mar 1 2013, 12:37)
// This file was decompiled using sascm.ini published by Seemann (http://sannybuilder....files/SASCM.rar) on 13.10.2007

{$VERSION 3.1.0027}
{$CLEO .cs}

//-------------MAIN---------------
0000: NOP
03A4: name_thread 'HLCHASE'
0001: wait 2000 ms 

:HLCHASE_34
0001: wait 0 ms
00D6: if and
0256:  player $PLAYER_CHAR defined
010F:  player $PLAYER_CHAR wanted_level > 3
004D: jump_if_false @HLCHASE_34
0002: jump @HLCHASE_68

:HLCHASE_68
0001: wait 0 ms
0247: request_model 280 
0247: request_model 497
038B: load_requested_models
00D6: if and
0248: model 280 available
0248: model 497 available
004D: jump_if_false @HLCHASE_68
0002: jump @HLCHASE_98

:HLCHASE_98
0001: wait 10000 ms
04C4: create_coordinate 11@ 12@ 13@ from_actor $PLAYER_ACTOR offset 10.0 16.5 10.0
00A5: 5@ = create_car #POLMAV at 11@ 12@ 13@
0129: 4@ = create_actor_pedtype 6 model #LAPD1 in_car 5@ driverseat
0825: set_helicopter 5@ instant_rotor_start
0727: set_heli 5@ behavior_to_police_heli_and_follow_actor $PLAYER_ACTOR follow_car -1 radius 50.0
0002: jump @HLCHASE_148

:HLCHASE_148
0001: wait 30000 ms
0002: jump @HLCHASE_34

This script must be improved but it works so far. The polmav hovers 50.0 units above of player_actor

MRobinson
  • MRobinson

    Secret Agent

  • Members
  • Joined: 05 Jul 2012

#553

Posted 01 March 2013 - 12:04 PM Edited by MRobinson, 01 March 2013 - 12:27 PM.

CODE

// This file was decompiled using sascm.ini published by Seemann (http://sannybuilder.com/files/SASCM.rar) on 13.10.2007

{$VERSION 3.1.0027}
{$CLEO .cs}

//-------------MAIN---------------
0000: NOP
03A4: name_thread 'HLCHASE'
0001: wait 2000 ms

:HLCHASE_18
0001: wait 0 ms
00D6: if and
0256:   player $PLAYER_CHAR defined
010F:   player $PLAYER_CHAR wanted_level > 3
004D: jump_if_false @HLCHASE_18
0002: jump @HLCHASE_52

:HLCHASE_52
0001: wait 0 ms
0247: load_model #LAPD1
0247: load_model #POLMAV
038B: load_requested_models
00D6: if and
0248:   model #LAPD1 available
0248:   model #POLMAV available
004D: jump_if_false @HLCHASE_52
0002: jump @HLCHASE_96

:HLCHASE_96
0001: wait 50000 ms
04C4: store_coords_to 11@ 12@ 13@ from_actor $PLAYER_ACTOR with_offset 17.0 8.0 30.0
00A5: 5@ = create_car #POLMAV at 11@ 12@ 13@
0129: 4@ = create_actor_pedtype 6 model #LAPD1 in_car 5@ driverseat
0825: set_helicopter 5@ instant_rotor_start
0727: set_heli 5@ behavior_to_police_heli_and_follow_actor $PLAYER_ACTOR follow_car -1 radius 50.0
0002: jump @HLCHASE_189

:HLCHASE_189
0001: wait 5000 ms
00D6: if
09ED:   actor 4@ is_within_field_of_view_actor $PLAYER_ACTOR
01F7: set_player $PLAYER_CHAR ignored_by_cops 0
004D: jump_if_false @HLCHASE_232
0002: jump @HLCHASE_18

:HLCHASE_232
00A6: destroy_car 5@
0249: release_model #POLMAV
0001: wait 50000 ms
0002: jump @HLCHASE_18



here we go for the new script ZAZ, do you suggest any improvements? If you find any bugs first copy the script again. If it doesent works tell me, btw it is in connection with some of my other files bro. www.mohitrobinsoncopsystem.blogspot.com

ZAZ
  • ZAZ

    Kernlochbohrer

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

#554

Posted 01 March 2013 - 12:26 PM

QUOTE (MRobinson @ Friday, Mar 1 2013, 13:04)
CODE

00D6: if
09ED:   actor 5@ is_within_field_of_view_actor $PLAYER_ACTOR
01F7: set_player $PLAYER_CHAR ignored_by_cops 1
5@ isn't an actor
opcode 01F7: isn't a condition
also, this conditional check is uncomplete, read about conditional checks in lesson Scripting/Writing a Thread

your script needs to check if the heli is wrecked
your script needs a cleanup part

here we go:
CODE
{$CLEO .cs}

//-------------MAIN---------------
0000: NOP
03A4: name_thread 'HLCHASE'
0001: wait 2000 ms

:HLCHASE_18
0001: wait 0 ms
if
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @HLCHASE_18
if
010F:   player $PLAYER_CHAR wanted_level > 3
004D: jump_if_false @HLCHASE_18


:HLCHASE_52
0001: wait 0 ms
0247: load_model #LAPD1
0247: load_model #POLMAV
038B: load_requested_models
00D6: if and
0248:   model #LAPD1 available
0248:   model #POLMAV available
004D: jump_if_false @HLCHASE_52
0002: jump @HLCHASE_96

:HLCHASE_96
//0001: wait 50000 ms
04C4: store_coords_to 11@ 12@ 13@ from_actor $PLAYER_ACTOR with_offset 0.0 0.0 30.0
00A5: 5@ = create_car #POLMAV at 11@ 12@ 13@
0129: 4@ = create_actor_pedtype 6 model #LAPD1 in_car 5@ driverseat
0825: set_helicopter 5@ instant_rotor_start
0727: set_heli 5@ behavior_to_police_heli_and_follow_actor $PLAYER_ACTOR follow_car -1 radius 9.0
0002: jump @HLCHASE_189

:HLCHASE_189
0001: wait 0 ms
if
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @HLCHASE_231
if  and
8119:  not   car 5@ wrecked
0205:   actor $PLAYER_ACTOR near_car 5@ radius 200.0 200.0 200.0 flag 0
004D: jump_if_false @HLCHASE_231
//00D6: if
//09ED:   actor 5@ is_within_field_of_view_actor $PLAYER_ACTOR
//01F7: set_player $PLAYER_CHAR ignored_by_cops 1
0002: jump @HLCHASE_189

:HLCHASE_231
0249: release_model #POLMAV
01C3: remove_references_to_car 5@
01C2: remove_references_to_actor 4@
0002: jump @HLCHASE_18

MRobinson
  • MRobinson

    Secret Agent

  • Members
  • Joined: 05 Jul 2012

#555

Posted 01 March 2013 - 12:32 PM Edited by MRobinson, 01 March 2013 - 12:56 PM.

QUOTE (ZAZ @ Friday, Mar 1 2013, 17:56)
QUOTE (MRobinson @ Friday, Mar 1 2013, 13:04)
CODE

00D6: if
09ED:   actor 5@ is_within_field_of_view_actor $PLAYER_ACTOR
01F7: set_player $PLAYER_CHAR ignored_by_cops 1
5@ isn't an actor
opcode 01F7: isn't a condition
also, this conditional check is uncomplete, read about conditional checks in lesson Scripting/Writing a Thread

your script needs to check if the heli is wrecked
your script needs a cleanup part

here we go:
CODE
{$CLEO .cs}

//-------------MAIN---------------
0000: NOP
03A4: name_thread 'HLCHASE'
0001: wait 2000 ms

:HLCHASE_18
0001: wait 0 ms
if
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @HLCHASE_18
if
010F:   player $PLAYER_CHAR wanted_level > 3
004D: jump_if_false @HLCHASE_18


:HLCHASE_52
0001: wait 0 ms
0247: load_model #LAPD1
0247: load_model #POLMAV
038B: load_requested_models
00D6: if and
0248:   model #LAPD1 available
0248:   model #POLMAV available
004D: jump_if_false @HLCHASE_52
0002: jump @HLCHASE_96

:HLCHASE_96
//0001: wait 50000 ms
04C4: store_coords_to 11@ 12@ 13@ from_actor $PLAYER_ACTOR with_offset 0.0 0.0 30.0
00A5: 5@ = create_car #POLMAV at 11@ 12@ 13@
0129: 4@ = create_actor_pedtype 6 model #LAPD1 in_car 5@ driverseat
0825: set_helicopter 5@ instant_rotor_start
0727: set_heli 5@ behavior_to_police_heli_and_follow_actor $PLAYER_ACTOR follow_car -1 radius 9.0
0002: jump @HLCHASE_189

:HLCHASE_189
0001: wait 0 ms
if
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @HLCHASE_231
if  and
8119:  not   car 5@ wrecked
0205:   actor $PLAYER_ACTOR near_car 5@ radius 200.0 200.0 200.0 flag 0
004D: jump_if_false @HLCHASE_231
//00D6: if
//09ED:   actor 5@ is_within_field_of_view_actor $PLAYER_ACTOR
//01F7: set_player $PLAYER_CHAR ignored_by_cops 1
0002: jump @HLCHASE_189

:HLCHASE_231
0249: release_model #POLMAV
01C3: remove_references_to_car 5@
01C2: remove_references_to_actor 4@
0002: jump @HLCHASE_18

corrected actor 4@ before you said, though i think you are scripting it inverse... we have to mean that if the player is not in the view and is out of radius.. then cops ignore it. I dont mean it as a condition anyways. check it again.

// This file was decompiled using sascm.ini published by Seemann (http://sannybuilder.com/files/SASCM.rar) on 13.10.2007

{$VERSION 3.1.0027}
{$CLEO .cs}

//-------------MAIN---------------
0000: NOP
03A4: name_thread 'HLCHASE'
0001: wait 2000 ms
01F7: set_player $PLAYER_CHAR ignored_by_cops 0@

:HLCHASE_18
0001: wait 0 ms
00D6: if and
0039: 0@ == 0
0256: player $PLAYER_CHAR defined
010F: player $PLAYER_CHAR wanted_level > 3
004D: jump_if_false @HLCHASE_18
0002: jump @HLCHASE_52

:HLCHASE_52
0001: wait 0 ms
0247: load_model #LAPD1
0247: load_model #POLMAV
038B: load_requested_models
00D6: if and
0248: model #LAPD1 available
0248: model #POLMAV available
004D: jump_if_false @HLCHASE_52
0002: jump @HLCHASE_96

:HLCHASE_96
0001: wait 50000 ms
04C4: store_coords_to 11@ 12@ 13@ from_actor $PLAYER_ACTOR with_offset 17.0 8.0 30.0
00A5: 5@ = create_car #POLMAV at 11@ 12@ 13@
0129: 4@ = create_actor_pedtype 6 model #LAPD1 in_car 5@ driverseat
0825: set_helicopter 5@ instant_rotor_start
0727: set_heli 5@ behavior_to_police_heli_and_follow_actor $PLAYER_ACTOR follow_car -1 radius 50.0
0002: jump @HLCHASE_189

:HLCHASE_189
0001: wait 0 ms
00D6: if
0256: player $PLAYER_CHAR defined
004D: jump_if_false @HLCHASE_231
00D6: if or
8119: car 5@ wrecked
0205: actor $PLAYER_ACTOR near_car 5@ offset 100.0 100.0 100.0 flag 0
004D: jump_if_false @HLCHASE_189
0002: jump @HLCHASE_231

:HLCHASE_231
0249: release_model #POLMAV
01C3: remove_references_to_car 5@
01C2: remove_references_to_actor 4@
0002: jump @HLCHASE_18

is it fine now bro? one in bold...the game freezes when the helicopter deploys and is out of radius. if I remove it... it freezes before the helicopter arrives.. you are just the boss of scripts.
btw when we are finished.. can we remove our previous posts? coz i dont want to expose my scripts to stealers.

ZAZ
  • ZAZ

    Kernlochbohrer

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

#556

Posted 01 March 2013 - 01:16 PM

you modified this check in a wrong way:
QUOTE
00D6: if or
8119: car 5@ wrecked
0205: actor $PLAYER_ACTOR near_car 5@ offset 100.0 100.0 100.0 flag 0
004D: jump_if_false @HLCHASE_189

read again about conditional checks in lesson Scripting/Writing a Thread

MRobinson
  • MRobinson

    Secret Agent

  • Members
  • Joined: 05 Jul 2012

#557

Posted 01 March 2013 - 01:27 PM

QUOTE (ZAZ @ Friday, Mar 1 2013, 18:46)
you modified this check in a wrong way:
QUOTE
00D6: if or
8119: car 5@ wrecked
0205: actor $PLAYER_ACTOR near_car 5@ offset 100.0 100.0 100.0 flag 0
004D: jump_if_false @HLCHASE_189

read again about conditional checks in lesson Scripting/Writing a Thread

Oh hey thanks ZAZ, minor bug found. mod is working perfectly now. i owe you man.

MRobinson
  • MRobinson

    Secret Agent

  • Members
  • Joined: 05 Jul 2012

#558

Posted 03 March 2013 - 07:22 AM

Hey ZAZ sorry to distub you again..
How do we write in coding...

if player shoots a weapon??(not preferably a melee weapon)

Also, instead of the script we prepared together, I set up random helicopters searching at random places. Also this fixed some more bugs related to my mod.

Regards colgate.gif

TheGodfather.
  • TheGodfather.

    Nobody likes me here...I think...

  • Members
  • Joined: 19 Jun 2012

#559

Posted 03 March 2013 - 07:45 AM

@MR: You can check if the actor/player has weapon armed by :

CODE

if
0491:   actor $PLAYER_ACTOR has_weapon 46


<Sorry for hijacking ZAZ's response tounge.gif >

Anyways ZAZ I was thinking of a suggestion..Why don't u make another new part of the tutorial introducing High Level Scripts in CLEO..

I am sure that would help others as I think HLL is better...And u can make a better tut. than me for sure.. biggrin.gif ..Or u are free to use mine.. smile.gif

MRobinson
  • MRobinson

    Secret Agent

  • Members
  • Joined: 05 Jul 2012

#560

Posted 03 March 2013 - 07:53 AM

QUOTE (arijitsen @ Sunday, Mar 3 2013, 13:15)
@MR: You can check if the actor/player has weapon armed by :

CODE

if
0491:   actor $PLAYER_ACTOR has_weapon 46


hey rj bro this is the code for "if the player has the weapon"
I need the code for if player is shooting the weapon (not armed)
The opcode
02D6: actor $PLAYER_ACTOR fires_weapon 0 in_rectangle_cornerA -3000.0 3000.0 cornerB -3000.0 3000.0
is also not working.

ZAZ
  • ZAZ

    Kernlochbohrer

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

#561

Posted 03 March 2013 - 05:56 PM


Opcode 02E0: checks if player is on foot and shots with a gun or throws grenades, melees are ignored
same for opcde 02D6:
CODE
04C4: store_coords_to 0@ 1@ 2@ from_actor $PLAYER_ACTOR with_offset 0.0 0.0 0.0
0087: 3@ = 0@ // (float)
0087: 4@ = 1@ // (float)
0@ -= 5.0
1@ -= 5.0
3@ += 5.0
4@ += 5.0
if
02D6:   actor $PLAYER_ACTOR fires_weapon 0 in_rectangle_cornerA 0@ 1@ cornerB 3@ 4@
jf @next


this can check if player is firing a specified weapon:
CODE
if and
02D8:   actor $PLAYER_ACTOR current_weapon == 30
00E1:   player 0 pressed_key 17


or with some addintional codes to avoid bugs and glitches:
CODE
if and
09E7:   player $PLAYER_CHAR not_frozen
8965:   not actor $PLAYER_ACTOR swimming
80DF:   not actor $PLAYER_ACTOR driving
02D8:   actor $PLAYER_ACTOR current_weapon == 30
00E1:   player 0 pressed_key 17
jf @next

or together with opcode 02E0:
CODE
if and
02E0:   actor $PLAYER_ACTOR aggressive
02D8:   actor $PLAYER_ACTOR current_weapon == 30  
jf @next



QUOTE (arijitsen @ Sunday, Mar 3 2013, 08:45)
Anyways ZAZ I was thinking of a suggestion..Why don't u make another new part of the tutorial introducing High Level Scripts in CLEO..

I often thought about it, but i'm too lazy atm.

MRobinson
  • MRobinson

    Secret Agent

  • Members
  • Joined: 05 Jul 2012

#562

Posted 04 March 2013 - 11:22 AM

I always wonder ZAZ why u are so... so.. intelligent cry.gif ? where u learnt coding? why can't I ever become like you cryani.gif ?
please tell me how to become like u ZAZ? Thanks for being the SUPER HELPER bro. icon14.gif

bloodhomie21
  • bloodhomie21

    Dyom Designer & User

  • Members
  • Joined: 01 Dec 2012

#563

Posted 05 March 2013 - 12:14 PM

Thanks Man, You've done good
Now I can also create CLEO mods

Thanks smile.gif

bondlover1313
  • bondlover1313

    KITT2000

  • Members
  • Joined: 30 Nov 2008

#564

Posted 11 March 2013 - 08:19 PM

Hey Zaz, The smartest person I know about CLEO coding, I'm trying to edit a cleo file and I know the basics pretty much, but when the file says load model id like 18666 or something like that, how do you know what that is? Is there a list of models anywhere that a person can search for numbers and it gives them a picture or description of that number's model? If there is not, then maybe you can help me with my idea. The file I am modding is designed to replace the license plate of the car I'm driving with that of another, and every time you do it, it clears your wanted level. But there are just 2 specific plates that I wanna transfer between, one would say KNIGHT and the other KNI 667 (From the show Knight Rider). If you have any questions let me know, or if you wanna see what I've got so far just let me know. I would really appreciate your help, thanks.


Thanks, Bests
Bondlover1313 smile.gif

ZAZ
  • ZAZ

    Kernlochbohrer

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

#565

Posted 12 March 2013 - 02:26 PM

QUOTE (bondlover1313 @ Monday, Mar 11 2013, 21:19)
Hey Zaz, The smartest person I know about CLEO coding, I'm trying to edit a cleo file and I know the basics pretty much, but when the file says load model id like 18666 or something like that, how do you know what that is? Is there a list of models anywhere that a person can search for numbers and it gives them a picture or description of that number's model? If there is not, then maybe you can help me with my idea. The file I am modding is designed to replace the license plate of the car I'm driving with that of another, and every time you do it, it clears your wanted level. But there are just 2 specific plates that I wanna transfer between, one would say KNIGHT and the other KNI 667 (From the show Knight Rider). If you have any questions let me know, or if you wanna see what I've got so far just let me know. I would really appreciate your help, thanks.


Thanks, Bests
Bondlover1313 smile.gif


A "must have tool" for mapmodding is the MapEditor
it have a search function to find your object and then view it in 3d
unless animated objects and some others

Basic informations:
Every model (actor, car, weapons, object (Buildings, Landscapes, tuningparts are also objects) must be defined and have an ID number
actors in data\peds.ide
cars in data\vehicles.ide
weapons in data\default.ide
tuningparts in data\ maps\veh_mods\veh_mods.ide

Buildings, Landscapes and other objects in a lot of files separated in different folders of data\ maps folder

data\maps\generic contains ide and ipl files for small objects for the gameplay like doors, hydrant, shark ect...
data\maps\interior contains ide and ipl files for interior rooms and their accessory
data\maps\country contains ide and ipl files for Buildings and Landscapes of the country as well of area51
data\maps\LA contains ide and ipl files for Buildings and Landscapes of Los Santos
data\maps\SF contains ide and ipl files for Buildings and Landscapes of San fierro
data\maps\Vagas contains ide and ipl files for Buildings and Landscapes of Las Venturas
data\maps\leveldes contains ide and ipl files for the seabeds and for the Liberty City interior world

CODE
GTA San Andreas Root Directory
|_anim
|_audio
|
|__data |
. . |__Decision
. . |__Icons
. . |__maps
. .  |
. .  |_country (country ide and ipl)
. .  |_generic  (dynamic and gameplay objects ide)
. .  |_interior  (interior and interior properties ide and ipl)
. .  |_LA  (Los Santos ide and ipl)
. .  |_leveldes (Seabed and LC world and special objects ide and ipl)
. .  |_SF  (San Fierro ide and ipl)
. .  |_vegas  (Las Venturas ide and ipl)
. .  |_veh_mods (vehicle Tuningparts ide)
. .
. .
. .
. .  gta.dat  ("Master file" in txt format: List to load IMG, IDE and IPL files)
. .  default.ide (weapon ide)
. .  peds.ide (pedestrians, charackter ide)
. .  vehicles.ide (vehicles ide)
. .  timecyc.dat (Weather, Game Colouring)
. .  object.dat (dynamic, script and special object settings)
. .  water.dat (water cube coordinates)
. .  weapon.dat (weapon settings)
.
.
.
.
|__models
 .
 .. gta3.img
 .. gta_int.img
 .. cutscene.img
 .. player.img




The ide and ipl files need to be loaded and requires to insert their filepath (relativ to game root directory) into data\gta.dat
Same for img archivs
Exceptions:
gta3.img, gta_int.img, player.img, peds.ide, vehicles.ide, default.ide are loaded automatcal and don't need to add the path in gta.dat

The most important content of ide lines are
Model ID number/Model name/Texture name
these 3 entries, separeted by comma define the model and allocates the dff file with txd file to an ID number

the ide line contains also more entries, which can be different, each if it is a ped, weapon, vehicle or map object

the meaning of the entries for map objects is:

ID#, modelname, Texturepack, viewdistance, flag
example:
CODE
1211, fire_hydrant, dynhydrent, 40, 128


The models itself must be placed in an img archiv and each model must have a *.dff file(3d model), a *.txd file(textures) and a *.col file(collisions model)
A *.col file is an archiv which can contain one more collisions models
the name of the collisions model must be the same as the name of the *.dff file but the *.col file archiv can have any name



The ide files have sections
the normal object definitions are placed between
objs and end
example:
CODE
objs
1211, fire_hydrant, dynhydrent, 40, 128
end


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

The ipl and ide files (Lae.ide, Lae.ipl) are just plain text files and editable with notepad.exe
An advanced texteditor is better and more comfortable, for example sannybuilder or notepad++ can you get for free
A "must have tool" for mapmodding is the MapEditor
read Item_Definition and IPL Definitions

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

Sannybuilder accepts model names like #JETPACK of following files:
data\peds.ide
data\vehicles.ide
data\default.ide
data\ maps\veh_mods\veh_mods.ide

other objects requires to be spawned by ID number




bondlover1313
  • bondlover1313

    KITT2000

  • Members
  • Joined: 30 Nov 2008

#566

Posted 14 March 2013 - 07:40 PM

Wow, ok, thanks I think I am gonna have to give up on that one, I SUCK at modeling. One more question, I am trying to make a script where KITT can be attached to a trailer. I wanted to be able to drive up into the semi, press a key and the car becomes attached to the trailer and I can get out and go to the driver's cab and drive with it and then if I want I can press the same key again and he is free from it, either in the cab/on foot/ or in kitt. This only done so when I drive the SEMI KITT doesn't jump all around in it and falls out backwards. Here's my code so far any help would be appreciated.

CODE
:SEMI_500
if
  Actor.Driving($PLAYER_ACTOR)
else_jump @SEMI_501
if
0AB0: key pressed 122
else_jump @SEMI_500
03C0: $KITT = actor $PLAYER_ACTOR car
00AA: store_coords_to 33@ 32@ 31@ rotation 30@ 29@ from_car $KITT
0681: attach_car $KITT to_car #ARTICT2 with_offset 33@ 32@ 31@ rotation $ROTATION 30@ 29@
jump @SEMI_500

:SEMI_501
if
  Actor.Driving($PLAYER_ACTOR)
if
0AB0: key pressed 122
else_jump @SEMI_500
03C0: $KITT = actor $PLAYER_ACTOR car
00AA: store_coords_to 33@ 32@ 31@ rotation 30@ 29@ from_car $KITT
0681: detach_car $KITT from_car #ARTICT2 with_offset 33@ 32@ 31@ rotation $ROTATION 30@ 29@


Thanks, Bests
Bondlover1313 smile.gif



ZAZ
  • ZAZ

    Kernlochbohrer

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

#567

Posted 16 March 2013 - 09:26 AM

QUOTE (bondlover1313 @ Thursday, Mar 14 2013, 20:40)
Wow, ok, thanks I think I am gonna have to give up on that one, I SUCK at modeling. One more question, I am trying to make a script where KITT can be attached to a trailer. I wanted to be able to drive up into the semi, press a key and the car becomes attached to the trailer and I can get out and go to the driver's cab and drive with it and then if I want I can press the same key again and he is free from it, either in the cab/on foot/ or in kitt. This only done so when I drive the SEMI KITT doesn't jump all around in it and falls out backwards. Here's my code so far any help would be appreciated.


use the trailer-cab opcodes
CODE
0893: put_trailer 3@ on_cab 4@

if
07AB:   trailer 3@ attached_to_cab 4@
then

07AC: detach_trailer 3@ from_cab 4@

bondlover1313
  • bondlover1313

    KITT2000

  • Members
  • Joined: 30 Nov 2008

#568

Posted 16 March 2013 - 05:58 PM

QUOTE (ZAZ @ Saturday, Mar 16 2013, 09:26)
QUOTE (bondlover1313 @ Thursday, Mar 14 2013, 20:40)
Wow, ok, thanks I think I am gonna have to give up on that one, I SUCK at modeling. One more question, I am trying to make a script where KITT can be attached to a trailer. I wanted to be able to drive up into the semi, press a key and the car becomes attached to the trailer and I can get out and go to the driver's cab and drive with it and then if I want I can press the same key again and he is free from it, either in the cab/on foot/ or in kitt. This only done so when I drive the SEMI KITT doesn't jump all around in it and falls out backwards. Here's my code so far any help would be appreciated.


use the trailer-cab opcodes
CODE
0893: put_trailer 3@ on_cab 4@

if
07AB:   trailer 3@ attached_to_cab 4@
then

07AC: detach_trailer 3@ from_cab 4@

I tried that and no such luck. I think I explained what I was trying to do wrong I want it to look something like the first picture I attached here 9likethis.jpg) instead how KITT normally does when I drive the SEMI pics 2 and 3 (NotThis2.jpg and NotThis3). I think that might help with what I am trying to explain. So when I drive the SEMI, KITT inside it will be like the first picture until I press a button and he is free again. Thanks.

P.S. Pics 2 and 3 were taken while I was driving the SEMI. Pic 1 was taken while the SEMI was at a stop.

Thanks, Bests
Bondlover1313 smile.gif

Likethis
user posted image

NotThis 2
user posted image

NotThis3
user posted image

ZAZ
  • ZAZ

    Kernlochbohrer

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

#569

Posted 17 March 2013 - 11:45 AM

ok, you wanna attach the Kitt car to the trailer...
... with this script:
QUOTE
CODE
:SEMI_500
if
 Actor.Driving($PLAYER_ACTOR)
else_jump @SEMI_501
if
0AB0: key pressed 122
else_jump @SEMI_500
03C0: $KITT = actor $PLAYER_ACTOR car
00AA: store_coords_to 33@ 32@ 31@ rotation 30@ 29@ from_car $KITT
0681: attach_car $KITT to_car #ARTICT2 with_offset 33@ 32@ 31@ rotation $ROTATION 30@ 29@
jump @SEMI_500

:SEMI_501
if
 Actor.Driving($PLAYER_ACTOR)
if
0AB0: key pressed 122
else_jump @SEMI_500
03C0: $KITT = actor $PLAYER_ACTOR car
00AA: store_coords_to 33@ 32@ 31@ rotation 30@ 29@ from_car $KITT
0681: detach_car $KITT from_car #ARTICT2 with_offset 33@ 32@ 31@ rotation $ROTATION 30@ 29@


1.) this opcode is wrong:
CODE
00AA: store_coords_to 33@ 32@ 31@ rotation 30@ 29@ from_car $KITT

opcode 00AA have only 4 parameter:
CODE
00AA: store_car 0@ position_to 3@ 4@ 5@


2.) No need to get coords from trailer offset because the attach opcode have offset parameter to attach the car relativ to trailers center

3.) opcode 0681 is wrong because it's to attach an object to car
you must use opcode 0683

4.) you need to insert a car handle instead a model name in opcode 0683 as well in 0681

CODE
0683: attach_car $KITT to_car 1@ with_offset 0.0 0.0 0.0 rotation 0.0 0.0 0.0


Summery: your script is big bullsh*t and don't have enough coding skill to realize your plan

bondlover1313
  • bondlover1313

    KITT2000

  • Members
  • Joined: 30 Nov 2008

#570

Posted 17 March 2013 - 02:53 PM

Well jeez thanks for putting it so plainly, lol. Yeah your right I am a little out of my league here, but I still wanted to try and achieve this. I did what you said and it sort of looked it worked. You said the code wasn't good enough to realize my plan, and I totally agree, but do you have any ideas or advice on how to improve it? Thanks


Thanks, Bests
Bondlover1313 smile.gif




2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users