Quantcast

Jump to content

» «
Photo

[Cleo] Tire spikes.

17 replies to this topic
JT_Mix
  • JT_Mix

    Insert Title Here

  • Members
  • Joined: 19 Apr 2007

#1

Posted 23 February 2009 - 07:15 PM

Is it possible for you to deploy tire spikes with cleo?
if so has anyone got the code?

thanks

ZAZ
  • ZAZ

    Kernlochbohrer

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

#2

Posted 23 February 2009 - 10:53 PM

QUOTE (JT_Mix @ Feb 23 2009, 19:15)
Is it possible for you to deploy tire spikes with cleo?
if so has anyone got the code?

thanks

you mean TEMP_STINGER2 of mission Puncture Wounds ?
I believe its not done as cleo. Its a bit of work.
Needs to place the object TEMP_STINGER2 on street and check if a car is at same coord
then deflate its tire
CODE
04FE: deflate_tire 1 on_car 0@

PatrickW
  • PatrickW

    GTA Juggernaut

  • Moderator
  • Joined: 07 Jan 2004
  • Netherlands

#3

Posted 24 February 2009 - 07:36 PM Edited by PatrickW, 24 February 2009 - 07:38 PM.

Some years ago I created such a mod for Vice City (Stinger Drop Mod), demonj0e converted it to San Andreas. It's not a cleo script though, and that might be a bit hard as it makes extensive use of small threads and I don't think CLEO-scripts allow that.

2pacproducer2
  • 2pacproducer2

    Mack Pimp

  • Members
  • Joined: 12 Jul 2008

#4

Posted 24 February 2009 - 07:39 PM

no, the script is pretty short, and using not so complicated speech. I think that could be writen as CLEO.

PatrickW
  • PatrickW

    GTA Juggernaut

  • Moderator
  • Joined: 07 Jan 2004
  • Netherlands

#5

Posted 24 February 2009 - 07:43 PM

I'm not an expert in the limitations of CLEO-scripts, but I was under the impression that you couldn't start new threads from within them.
Not based on experience, but on this text from the sannybuiulder CLEO helppages:
QUOTE (sannybuilderhelp >> CLEO3 scripts)
One file – one thread. Each CLEO-script must be made as a single thread compiled in a single file. If you need more threads for your script, use the opcodes 004F or 0A92, depending of where is that additional thread located - in the main.scm or in a separate cs-file.


But maybe an option would be to have the small "stringer-thread" in a seperate CLEO-file, and start that from the sniffer-thread with opcode 0A92. Certainly worth a try.

PatrickW
  • PatrickW

    GTA Juggernaut

  • Moderator
  • Joined: 07 Jan 2004
  • Netherlands

#6

Posted 24 February 2009 - 09:12 PM Edited by PatrickW, 24 February 2009 - 10:33 PM.

Stinger Drop Mod for San Andreas (CLEO3 version)
Thanx to demonj0e for making the SA conversion of the original Stinger Drop Mod.

stinger_drop.txt
CODE
{$CLEO .cs}

:stinger_sniff_thread
03A4: name thread "ST_SNIF"

:stinger_sniff_loop
0001: wait  100 ms
00D6: if 0
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @stinger_sniff_loop  
00D6: if 1
00E1:   key pressed  0  17  
00DF:   actor $PLAYER_ACTOR driving
004D: jump_if_false @stinger_sniff_loop    
03C0: 10@ = actor $PLAYER_ACTOR car
0407: create coordinate 0@ 1@ 2@ from car 10@ offset  0.0 -2.5  1.0
0174: 3@ = car 10@ z_angle
0009: 3@ +=  90.0;; floating-point values
02CE: 2@ = ground z 0@ 1@ 2@
000B: 2@ += 0.1
0A92: create_custom_thread "stinger.s" 0@ 1@ 2@ 3@
0001: wait  500 ms
0002: jump @stinger_sniff_loop



stinger.txt
CODE
{$CLEO .s}
:Stinger_thread                              
0004: 32@ = 0  
029B: 7@ = init_object 2899 at 0@ 1@ 2@
0177: set object 7@ z angle to  3@
01C7: remove_object_from_mission_cleanup_list  7@
0007: 4@ = 0@
000F: 4@ -= 3.0
000B: 0@ += 3.0
0007: 5@ = 1@
000F: 5@ -= 3.0
000B: 1@ += 3.0  

repeat  
 0001: wait  250 ms
 0007: 6@ = -1
 053E: 6@ = get_random_car_with_model -1 in_rectangle_cornerA 4@ 5@ cornerB 0@ 1@
 if NOT   6@ ==  -1;; integer values
 then
   04FE: deflate_tire  0 on_car 6@
   04FE: deflate_tire  1 on_car 6@
   04FE: deflate_tire  2 on_car 6@
   04FE: deflate_tire  3 on_car 6@
 end
until 32@ > 10000
0108: destroy object 7@
0A93: end_custom_thread



Compile both files in your CLEO directory.
Start a new game, and drop stingers with "FIRE" in any vehicle.

cj360
  • cj360

  • Members
  • Joined: 19 Sep 2007

#7

Posted 24 February 2009 - 09:29 PM

You can make sperate threads in cleo bc7 did it in his mod Where would I find the ID for#TEMP_STINGER2? I don't remember

cj360
  • cj360

  • Members
  • Joined: 19 Sep 2007

#8

Posted 24 February 2009 - 09:34 PM

You beat me to it tounge.gif
You can make sperate threads in cleo bc7 did it in his mod
sry for double post blush.gif

JT_Mix
  • JT_Mix

    Insert Title Here

  • Members
  • Joined: 19 Apr 2007

#9

Posted 24 February 2009 - 09:34 PM

crashes game.

PatrickW
  • PatrickW

    GTA Juggernaut

  • Moderator
  • Joined: 07 Jan 2004
  • Netherlands

#10

Posted 24 February 2009 - 10:05 PM Edited by PatrickW, 24 February 2009 - 10:35 PM.

QUOTE (cj360 @ Feb 24 2009, 22:29)
You can make sperate threads in cleo bc7 did it in his mod Where would I find the ID for#TEMP_STINGER2? I don't remember

The ID of the stinger can be found in the large table at the top of a standard main.scm.
I guess not, afterall smile.gif


@JT_Mix: Did you try it with a default SA main.scm or with a modded one ?

ZAZ
  • ZAZ

    Kernlochbohrer

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

#11

Posted 24 February 2009 - 10:21 PM Edited by ZAZ, 25 February 2009 - 04:51 PM.

data\maps\leveldes\levelxre.ide :
2899, temp_stinger2, temp_stinger, 100, 128
CODE
029B: 7@ = init_object 2899 at 0@ 1@ 2@

PatrickW
  • PatrickW

    GTA Juggernaut

  • Moderator
  • Joined: 07 Jan 2004
  • Netherlands

#12

Posted 24 February 2009 - 10:34 PM

I stand corrected. That is indeed the correct value. Edited it in my post above..

ZAZ: cookie.gif

Seemann
  • Seemann

    Ruhe

  • Members
  • Joined: 03 Sep 2004
  • Russia

#13

Posted 25 February 2009 - 04:07 AM Edited by Seemann, 25 February 2009 - 04:35 AM.

CLEO scripts only use global IDs of models. Use the Ctrl+Alt+H feature to convert a model name to ID and vice versa.

Like this:
user posted image

PatrickW
  • PatrickW

    GTA Juggernaut

  • Moderator
  • Joined: 07 Jan 2004
  • Netherlands

#14

Posted 25 February 2009 - 03:01 PM

Thanx for the tip, seeman smile.gif

Wouldn't it be possible to also support this "translation" for CLEO-scripts during compilation ?
So that you can simply use the symbolic name "#TEMP_STINGER2" in CLEO-scripts also ?

Seemann
  • Seemann

    Ruhe

  • Members
  • Joined: 03 Sep 2004
  • Russia

#15

Posted 25 February 2009 - 04:27 PM

Yea, that would be useful, however I'm a supporter of that a scripter should know how the things work and why the code is compiled in a certain way. Anyway, added on the todo list. wink.gif

ZAZ
  • ZAZ

    Kernlochbohrer

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

#16

Posted 25 February 2009 - 05:00 PM

QUOTE (Seemann @ Feb 25 2009, 16:27)
Yea, that would be useful, however I'm a supporter of that a scripter should know how the things work and why the code is compiled in a certain way. Anyway, added on the todo list. wink.gif

todo list. wink.gif ?? you will release a new version ?? smile.gif
and for gta4, is there anything in work or will it stay by lua? or maybe a lua editer ?

Seemann
  • Seemann

    Ruhe

  • Members
  • Joined: 03 Sep 2004
  • Russia

#17

Posted 25 February 2009 - 06:19 PM

Sanny Builder and CLEO are far from completion. I still have in mind a lot of features to add for both. So, yea, new version will eventually come. As for GTA 4... let it be surprise! cool.gif

coin-god
  • coin-god

    High Roller

  • $outh $ide Hoodz
  • Joined: 18 Mar 2007

#18

Posted 25 February 2009 - 11:27 PM

QUOTE (Seemann @ Feb 25 2009, 15:19)
Sanny Builder and CLEO are far from completion. I still have in mind a lot of features to add for both. So, yea, new version will eventually come. As for GTA 4... let it be surprise! cool.gif

Oh.. im impatient to see teh new stuff tounge.gif




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users