Edfake 0 Report post Posted January 10, 2009 now there will be a million things wrong with this code, but i need some help to spot the problems. it culd be opticode or just plain wrong. im never good at this math vortex of doom!! its kitts code from MB but converted to SB wich may be the problem. its meant to make a lazer go from the player, to the part the wormhole opens. if you help me spot the problems, i can fix it 10 times faster. thanks (p.s yes i pasted it in within 10 seconds, but i culdnt be botherd to write one from scratch) 04C4: create_coordinate $2 $3 $4 from_actor $PLAYER_ACTOR offset 0.0 2.5 -0.25 04C4: create_coordinate $5 $6 $7 from_actor $PLAYER_ACTOR offset 0.0 150.0 -0.25 0063: $5 -= $2 // floating-point values (never used in VC or GTA 3) 0063: $6 -= $3 // floating-point values (never used in VC or GTA 3) 0063: $7 -= $4 // floating-point values (never used in VC or GTA 3) 0087: $12 = $5 // floating-point values only 0087: $13 = $6 // floating-point values only 0087: $14 = $7 // floating-point values only 0073: $12 /= $9 // floating-point values (never used in VC or GTA 3) 0073: $13 /= $9 // floating-point values (never used in VC or GTA 3) 0073: $14 /= $9 // floating-point values (never used in VC or GTA 3) 0050: gosub @CUTEL_1788 0050: gosub @CUTEL_1788 0050: gosub @CUTEL_1788 0050: gosub @CUTEL_1788 0050: gosub @CUTEL_1788 0050: gosub @CUTEL_1788 0050: gosub @CUTEL_1788 0050: gosub @CUTEL_1788 0050: gosub @CUTEL_1788 0050: gosub @CUTEL_1788 0050: gosub @CUTEL_1788 0050: gosub @CUTEL_1788 0050: gosub @CUTEL_1788 0050: gosub @CUTEL_1788 0050: gosub @CUTEL_1788 jump @CUTEL_1383 :CUTEL_1383 wait 0 0437: scatter_particle 43 5.0 at $WHA $THA $HELL 0 0 0 0437: scatter_particle 43 5.0 at $WHA $THA $HELL 0 0 0 0437: scatter_particle 43 5.0 at $WHA $THA $HELL 0 0 0 0437: scatter_particle 43 5.0 at $WHA $THA $HELL 0 0 0 0437: scatter_particle 43 5.0 at $WHA $THA $HELL 0 0 0 0437: scatter_particle 43 5.0 at $WHA $THA $HELL 0 0 0 0437: scatter_particle 43 5.0 at $WHA $THA $HELL 0 0 0 0437: scatter_particle 43 5.0 at $WHA $THA $HELL 0 0 0 0437: scatter_particle 43 5.0 at $WHA $THA $HELL 0 0 0 0437: scatter_particle 43 5.0 at $WHA $THA $HELL 0 0 0 if 00F5: player $PLAYER_CHAR 0 $WHA $THA $HELL radius 2.0 2.0 2.0 else_jump @CUTEL_1383 return :CUTEL_1788 005b: $2 += $5 // floating-point values (never used in VC or GTA 3) 005b: $3 += $6 // floating-point values (never used in VC or GTA 3) 005b: $4 += $7 // floating-point values (never used in VC or GTA 3) 0437: scatter_particle 0 0.05 at 2@ 3@ 4@ 12@ 13@ 14@ 0087: $0 = $2 // floating-point values only 0087: $1 = $3 // floating-point values only 0087: $2 = $2 // floating-point values only 0087: $11 = $3 // floating-point values only 000B: $0 += 1.5 // floating-point values 000B: $1 += 1.5 // floating-point values 000F: $10 -= 1.5 // floating-point values 000F: $11 -= 1.5 // floating-point values return Share this post Link to post Share on other sites
bluespace88 9 Report post Posted January 11, 2009 a lot ^^; i dunno where to start..... well, first off, change variable names. That will help out lots. You're using variables reserved for other VC stuff that may be manipulated in their own threads. Share this post Link to post Share on other sites
Edfake 0 Report post Posted January 11, 2009 a lot ^^; i dunno where to start..... i knew it, thats the problems with copy, paste, delete car suff. all i really want is a laser to go from PLAYER CHAR to PLAYER CHAR offset 0.0 10.0 0.0 Share this post Link to post Share on other sites
bluespace88 9 Report post Posted January 11, 2009 are you sure you copied it right? o.O Share this post Link to post Share on other sites
Edfake 0 Report post Posted January 12, 2009 are you sure you copied it right? o.O yep, exept i got rid of things like $10, car speed. also, i changed all 3@ to $3 and so on or it will conflict with custom teleporter code Share this post Link to post Share on other sites
bluespace88 9 Report post Posted January 12, 2009 $3 conflicts with vc code that may or may not be manipulated itself in vc's default threads Share this post Link to post Share on other sites
Edfake 0 Report post Posted January 12, 2009 $3 conflicts with vc code that may or may not be manipulated itself in vc's default threads nup i did a turogh search, it doent and i also change evryone like 1@ >$1 and 2@>$2 and so on Share this post Link to post Share on other sites
bluespace88 9 Report post Posted January 12, 2009 its not a good idea to use numbers, cuz vc uses them. I don't know, I don't do scm coding anymore. Share this post Link to post Share on other sites
bluespace88 9 Report post Posted January 12, 2009 that aside, you never initialized $9 Share this post Link to post Share on other sites
Edfake 0 Report post Posted January 12, 2009 that aside, you never initialized $9 no, is it important, i deleated $9 Share this post Link to post Share on other sites
bluespace88 9 Report post Posted January 12, 2009 i think it was for spacing of the particles, me don't remember. 10 and 11 also aren't used. Share this post Link to post Share on other sites
Edfake 0 Report post Posted January 12, 2009 (edited) i think it was for spacing of the particles, me don't remember. 10 and 11 also aren't used. i also deleted 10, because it was speed of car, 11 there just at bottom Edited January 12, 2009 by edfake Share this post Link to post Share on other sites
bluespace88 9 Report post Posted January 12, 2009 0 and 1 serve no purpose Share this post Link to post Share on other sites
Edfake 0 Report post Posted January 12, 2009 0 and 1 serve no purpose what about 4 and 7? Share this post Link to post Share on other sites
bluespace88 9 Report post Posted January 12, 2009 you kinda need the z position =P Share this post Link to post Share on other sites
bluespace88 9 Report post Posted January 12, 2009 and what i'm saying is that they had a purpose before, but somehow its now lost Share this post Link to post Share on other sites
Edfake 0 Report post Posted January 12, 2009 and what i'm saying is that they had a purpose before, but somehow its now lost through my DEL button, hehe. now this is laser code untuched: :LabelKnightLaser 03A4: name_thread 'LaserS' 03C1: 1@ = player $PLAYER_CHAR car 03CF: load_wav 'FUD_10' as 2 :LabelKnightLaserA 0001: wait 0 ms 00D6: if 0 03D0: wav 2 loaded 004D: jump_if_false @LabelKnightLaserA 03D1: play_wav 2 0407: create coordinate 2@ 3@ 4@ from car 1@ offset -10.0 2.5 -0.25 0407: create coordinate 5@ 6@ 7@ from car 1@ offset 10.0 150.0 -0.25 0006: 8@ = -1 053E: 8@ = get_random_car_with_actors -1 in_area 2@ 3@ 5@ 6@ 00D6: if 0 8039: NOT 8@ == -1// integer values 004D: jump_if_false @LabelKnightLaser1A 00D6: if 1 80DC: NOT player $PLAYER_CHAR driving 8@ 8119: NOT car 8@ wrecked 004D: jump_if_false @LabelKnightLaser1A 0407: create coordinate 2@ 3@ 4@ from car 1@ offset 0.0 2.5 -0.25 0407: create coordinate 5@ 6@ 7@ from car 8@ offset 0.0 0.0 -0.25 0002: jump @LabelKnightLaser1B :LabelKnightLaser1A 0407: create coordinate 2@ 3@ 4@ from car 1@ offset 0.0 2.5 -0.25 0407: create coordinate 5@ 6@ 7@ from car 1@ offset 0.0 150.0 -0.25 :LabelKnightLaser1B 0509: unknown 9@ = distance between point 2@ 3@ and point 5@ 6@ 02E3: 10@ = car 1@ speed 0015: 10@ /= 40.0 // floating-point values 000B: 10@ += 0.5 0063: 5@ -= 2@ // floating-point values (never used in VC or GTA 3) 0063: 6@ -= 3@ // floating-point values (never used in VC or GTA 3) 0063: 7@ -= 4@ // floating-point values (never used in VC or GTA 3) 0087: 12@ = 5@ // floating-point values only 0087: 13@ = 6@ // floating-point values only 0087: 14@ = 7@ // floating-point values only 0073: 12@ /= 9@ // floating-point values (never used in VC or GTA 3) 0073: 13@ /= 9@ // floating-point values (never used in VC or GTA 3) 0073: 14@ /= 9@ // floating-point values (never used in VC or GTA 3) 0011: 12@ *= 10@ // floating-point values 0011: 13@ *= 10@ // floating-point values 0011: 14@ *= 10@ // floating-point values 0013: 9@ *= 2.0 // floating-point values 0073: 5@ /= 9@ // floating-point values (never used in VC or GTA 3) 0073: 6@ /= 9@ // floating-point values (never used in VC or GTA 3) 0073: 7@ /= 9@ // floating-point values (never used in VC or GTA 3) 0007: 9@ = 300.0 :LabelKnightLaserA1 0001: wait 0 ms 00D6: if 0 0021: 9@ > 0.0 // floating-point values 004D: jump_if_false @LabelKnightLaserB 000F: 9@ -= 15.0 // integer values 0050: gosub @LabelKnightLaserCh 0050: gosub @LabelKnightLaserCh 0050: gosub @LabelKnightLaserCh 0050: gosub @LabelKnightLaserCh 0050: gosub @LabelKnightLaserCh 0050: gosub @LabelKnightLaserCh 0050: gosub @LabelKnightLaserCh 0050: gosub @LabelKnightLaserCh 0050: gosub @LabelKnightLaserCh 0050: gosub @LabelKnightLaserCh 0050: gosub @LabelKnightLaserCh 0050: gosub @LabelKnightLaserCh 0050: gosub @LabelKnightLaserCh 0050: gosub @LabelKnightLaserCh 0050: gosub @LabelKnightLaserCh 0002: jump @LabelKnightLaserA1 :LabelKnightLaserCh 005b: 2@ += 5@ // floating-point values (never used in VC or GTA 3) 005b: 3@ += 6@ // floating-point values (never used in VC or GTA 3) 005b: 4@ += 7@ // floating-point values (never used in VC or GTA 3) 0437: scatter_particle 0 0.05 at 2@ 3@ 4@ 12@ 13@ 14@ 0087: 0@ = 2@ // floating-point values only 0087: 1@ = 3@ // floating-point values only 0087: 10@ = 2@ // floating-point values only 0087: 11@ = 3@ // floating-point values only 000B: 0@ += 1.5 // floating-point values 000B: 1@ += 1.5 // floating-point values 000F: 10@ -= 1.5 // floating-point values 000F: 11@ -= 1.5 // floating-point values 0006: 8@ = -1 053E: 8@ = get_random_car_with_actors -1 in_area 0@ 1@ 10@ 11@ 00D6: if 0 8039: NOT 8@ == -1// integer values 004D: jump_if_false @LabelKnightLaserChR 00D6: if 1 8137: NOT car 8@ id == #ZEBRA 8119: NOT car 8@ wrecked 004D: jump_if_false @LabelKnightLaserChR 00D6: if 0 01AF: car 8@ 0 ()near_point 2@ 3@ 4@ radius 1.5 1.5 1.5 004D: jump_if_false @LabelKnightLaserChR 020B: explode_car 8@ 0002: jump @LabelKnightLaserB :LabelKnightLaserB 040D: unload_wav 2 :LabelKnightLaserC 004F: create_thread @LabelWeapons 004E: end_thread :LabelKnightLaserChR 0051: return and im just trying to get the laser only, no blow ups, no aming, just from x y z to x2 y2 z2 Share this post Link to post Share on other sites
bluespace88 9 Report post Posted January 12, 2009 ok, so 0, 1, 10, and 11 were to get an area around the point to see if any cars were nearby, so don't need them. 9 is used to find the unit vector from (2,3,4) to (5,6,7), so you need the distance then. Might want to play around with how many gosubs, as this laser is meant to fire to 150 meters ahead and only stop when theres a car in the way. Some more stuff, but that should get you started. Share this post Link to post Share on other sites
Edfake 0 Report post Posted January 12, 2009 ok, so 0, 1, 10, and 11 were to get an area around the point to see if any cars were nearby, so don't need them. 9 is used to find the unit vector from (2,3,4) to (5,6,7), so you need the distance then. Might want to play around with how many gosubs, as this laser is meant to fire to 150 meters ahead and only stop when theres a car in the way. kk, delete anny thing that has to do with 0, 1, 10 and 11 and experiment with rest. thanks yet again blue, i call again if it doesnt work. Share this post Link to post Share on other sites
bluespace88 9 Report post Posted January 12, 2009 9 is very important. btw, rename it. Add something like edfake after it, because I remember some of the digits were used by vc Share this post Link to post Share on other sites