dtd mods Posted January 20, 2009 Share Posted January 20, 2009 hey ZAZ i have a question. How can i init the object so the shark moves and attacks you if you are in the sea. I do some experiments but it not moves good . Tell me how the shark attacks cj and swim in the sea because i use the code above and it doesnt swim well and also how can i add a check if object $shark is near player radius 0.5,then throw shark object agaist player? can you help me? plz CODE //-------------MAIN--------------- 0000: NOP :NONAME_2 0001: wait 0 ms 00D6: if 0256: player $PLAYER_CHAR defined 004D: jump_if_false @NONAME_2 0247: load_model 1608 038B: load_requested_models :NONAME_58 0001: wait 0 ms 00D6: if 0102: actor $PLAYER_ACTOR in_sphere 320.6818 -1781.109 4.782 radius 1.2 1.2 30.0 sphere 1 stopped_on_foot 004D: jump_if_false @NONAME_58 0107: [email protected] = create_object 1608 at 344.252 -1781.124 5.2 09CA: set_object [email protected] immunities BP 1 FP 1 EP 1 CP 1 MP 1 :NONAME_148 0001: wait 25 ms 00D6: if 0256: player $PLAYER_CHAR defined 004D: jump_if_false @NONAME_240 034E: move_object [email protected] to 320.6818 -1781.109 4.782 speed 0.1 0.1 0.02 flag 0 01BB: store_object [email protected] position_to [email protected] [email protected] [email protected] 029B: [email protected] = init_object 1608 at 0.0 0.0 50.0 00D6: if 0021: [email protected] > 13.0 004D: jump_if_false @NONAME_148 :NONAME_240 0108: destroy_object 1608 0002: jump @NONAME_2 Link to comment Share on other sites More sharing options...
coin-god Posted January 21, 2009 Share Posted January 21, 2009 If you want to check if the player is the ater use: 04AD: actor $PLAYER_ACTOR in_water If you want to know all that stuff from ZAZ mod, decompile it and study it yourself. Thats much better. Link to comment Share on other sites More sharing options...
ZAZ Posted January 21, 2009 Share Posted January 21, 2009 hey ZAZ i have a question. How can i init the object so the shark moves and attacks you if you are in the sea. I do some experiments but it not moves good . Tell me how the shark attacks cj and swim in the sea because i use the code above and it doesnt swim well and also how can i add a check if object $shark is near player radius 0.5,then throw shark object agaist player? can you help me? plz sharks moving around CJ needs to calculate coords of player circle use cosine for x coord and sinus for y coord of a defined radius look in killersharkscript for this part: :Sharks_9000B: [email protected] += 1.0 // floating-point values 000F: [email protected] -= 1.0 // floating-point values//000F: [email protected] -= 0.01 // floating-point values000B: [email protected] += 0.01 // floating-point values0087: [email protected] = [email protected] // floating-point values only0087: [email protected] = [email protected] // floating-point values only0087: [email protected] = [email protected] // floating-point values only02F6: [email protected] = cosine [email protected] // sinus swapped with cosine0013: [email protected] *= 1.0 // floating-point values (never used in VC or GTA 3) 006B: [email protected] *= [email protected] // floating-point values02F7: [email protected] = sinus [email protected] // cosine swapped with sinus 0013: [email protected] *= 1.0 // floating-point values (never used in VC or GTA 3)006B: [email protected] *= [email protected] // floating-point values005B: [email protected] += [email protected] // floating-point values005B: [email protected] += [email protected] // floating-point values034E: move_object [email protected] to [email protected] [email protected] [email protected] speed 0.3 0.3 0.3 flag 0000F: [email protected] -= 180.0 // floating-point values0177: set_object [email protected] z_angle_to [email protected]: [email protected] += 180.0 // floating-point values0087: [email protected] = [email protected] // floating-point values only0087: [email protected] = [email protected] // floating-point values only0087: [email protected] = [email protected] // floating-point values only02F6: [email protected] = cosine [email protected] // sinus swapped with cosine0013: [email protected] *= 1.0 // floating-point values (never used in VC or GTA 3) 006B: [email protected] *= [email protected] // floating-point values02F7: [email protected] = sinus [email protected] // cosine swapped with sinus 0013: [email protected] *= 1.0 // floating-point values (never used in VC or GTA 3)006B: [email protected] *= [email protected] // floating-point values005B: [email protected] += [email protected] // floating-point values005B: [email protected] += [email protected] // floating-point values000F: [email protected] -= 180.0 // floating-point values034E: move_object [email protected] to [email protected] [email protected] [email protected] speed 0.3 0.3 0.3 flag 0000B: [email protected] += 180.0 // floating-point values0177: set_object [email protected] z_angle_to [email protected]: -90.0 > [email protected] // floating-point values004D: jump_if_false @Sharks_70172: [email protected] = actor $PLAYER_ACTOR z_angle0007: [email protected] = 270.0 // floating-point values0007: [email protected] = 0.0 // floating-point values0002: jump @Sharks_7 CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
dtd mods Posted January 21, 2009 Author Share Posted January 21, 2009 (edited) hey ZAZ i have a question. How can i init the object so the shark moves and attacks you if you are in the sea. I do some experiments but it not moves good . Tell me how the shark attacks cj and swim in the sea because i use the code above and it doesnt swim well and also how can i add a check if object $shark is near player radius 0.5,then throw shark object agaist player? can you help me? plz sharks moving around CJ needs to calculate coords of player circle use cosine for x coord and sinus for y coord of a defined radius look in killersharkscript for this part: :Sharks_9000B: [email protected] += 1.0 // floating-point values 000F: [email protected] -= 1.0 // floating-point values//000F: [email protected] -= 0.01 // floating-point values000B: [email protected] += 0.01 // floating-point values0087: [email protected] = [email protected] // floating-point values only0087: [email protected] = [email protected] // floating-point values only0087: [email protected] = [email protected] // floating-point values only02F6: [email protected] = cosine [email protected] // sinus swapped with cosine0013: [email protected] *= 1.0 // floating-point values (never used in VC or GTA 3) 006B: [email protected] *= [email protected] // floating-point values02F7: [email protected] = sinus [email protected] // cosine swapped with sinus 0013: [email protected] *= 1.0 // floating-point values (never used in VC or GTA 3)006B: [email protected] *= [email protected] // floating-point values005B: [email protected] += [email protected] // floating-point values005B: [email protected] += [email protected] // floating-point values034E: move_object [email protected] to [email protected] [email protected] [email protected] speed 0.3 0.3 0.3 flag 0000F: [email protected] -= 180.0 // floating-point values0177: set_object [email protected] z_angle_to [email protected]: [email protected] += 180.0 // floating-point values0087: [email protected] = [email protected] // floating-point values only0087: [email protected] = [email protected] // floating-point values only0087: [email protected] = [email protected] // floating-point values only02F6: [email protected] = cosine [email protected] // sinus swapped with cosine0013: [email protected] *= 1.0 // floating-point values (never used in VC or GTA 3) 006B: [email protected] *= [email protected] // floating-point values02F7: [email protected] = sinus [email protected] // cosine swapped with sinus 0013: [email protected] *= 1.0 // floating-point values (never used in VC or GTA 3)006B: [email protected] *= [email protected] // floating-point values005B: [email protected] += [email protected] // floating-point values005B: [email protected] += [email protected] // floating-point values000F: [email protected] -= 180.0 // floating-point values034E: move_object [email protected] to [email protected] [email protected] [email protected] speed 0.3 0.3 0.3 flag 0000B: [email protected] += 180.0 // floating-point values0177: set_object [email protected] z_angle_to [email protected]: -90.0 > [email protected] // floating-point values004D: jump_if_false @Sharks_70172: [email protected] = actor $PLAYER_ACTOR z_angle0007: [email protected] = 270.0 // floating-point values0007: [email protected] = 0.0 // floating-point values0002: jump @Sharks_7 THANKS MY FRIEND! THE OPCODES 000F: 005B: 000B: AND 02F7: WHAT DOES IT DO? Edited January 21, 2009 by dtd mods Link to comment Share on other sites More sharing options...
ZAZ Posted January 24, 2009 Share Posted January 24, 2009 hey ZAZ i have a question. How can i init the object so the shark moves and attacks you if you are in the sea. I do some experiments but it not moves good . Tell me how the shark attacks cj and swim in the sea because i use the code above and it doesnt swim well and also how can i add a check if object $shark is near player radius 0.5,then throw shark object agaist player? can you help me? plz sharks moving around CJ needs to calculate coords of player circle use cosine for x coord and sinus for y coord of a defined radius look in killersharkscript for this part: :Sharks_9000B: [email protected] += 1.0 // floating-point values 000F: [email protected] -= 1.0 // floating-point values//000F: [email protected] -= 0.01 // floating-point values000B: [email protected] += 0.01 // floating-point values0087: [email protected] = [email protected] // floating-point values only0087: [email protected] = [email protected] // floating-point values only0087: [email protected] = [email protected] // floating-point values only02F6: [email protected] = cosine [email protected] // sinus swapped with cosine0013: [email protected] *= 1.0 // floating-point values (never used in VC or GTA 3) 006B: [email protected] *= [email protected] // floating-point values02F7: [email protected] = sinus [email protected] // cosine swapped with sinus 0013: [email protected] *= 1.0 // floating-point values (never used in VC or GTA 3)006B: [email protected] *= [email protected] // floating-point values005B: [email protected] += [email protected] // floating-point values005B: [email protected] += [email protected] // floating-point values034E: move_object [email protected] to [email protected] [email protected] [email protected] speed 0.3 0.3 0.3 flag 0000F: [email protected] -= 180.0 // floating-point values0177: set_object [email protected] z_angle_to [email protected]: [email protected] += 180.0 // floating-point values0087: [email protected] = [email protected] // floating-point values only0087: [email protected] = [email protected] // floating-point values only0087: [email protected] = [email protected] // floating-point values only02F6: [email protected] = cosine [email protected] // sinus swapped with cosine0013: [email protected] *= 1.0 // floating-point values (never used in VC or GTA 3) 006B: [email protected] *= [email protected] // floating-point values02F7: [email protected] = sinus [email protected] // cosine swapped with sinus 0013: [email protected] *= 1.0 // floating-point values (never used in VC or GTA 3)006B: [email protected] *= [email protected] // floating-point values005B: [email protected] += [email protected] // floating-point values005B: [email protected] += [email protected] // floating-point values000F: [email protected] -= 180.0 // floating-point values034E: move_object [email protected] to [email protected] [email protected] [email protected] speed 0.3 0.3 0.3 flag 0000B: [email protected] += 180.0 // floating-point values0177: set_object [email protected] z_angle_to [email protected]: -90.0 > [email protected] // floating-point values004D: jump_if_false @Sharks_70172: [email protected] = actor $PLAYER_ACTOR z_angle0007: [email protected] = 270.0 // floating-point values0007: [email protected] = 0.0 // floating-point values0002: jump @Sharks_7 THANKS MY FRIEND! THE OPCODES 000F: 005B: 000B: AND 02F7: WHAT DOES IT DO? 000F: substract a Float value from a LocalVariable Float value [email protected] is the z_angle for the shark [email protected] -= 180.0 is z_angle for the second shark on the opposite site when objects moving in a circle need also to turn the objects z_angle [email protected] is the z_angle for the circle to move 005B: add a LocalVariable Float to a LocalVariable Float value 000B: add a Float value to a LocalVariable Float value 02F7 requires the knowlege about math function sinus and cosine of a triangle http://www.mathe-online.at/mathint/wfun/grafiken/sincos2.gif to get a point on the circle can used the sinus funktion with the z_angle with 02F7 in gta you get a point on the circle, WITH RADIUS 1.0 multiplikate then the result with 5.0 and you get a point on the circle, WITH RADIUS 5.0 I used a variable value for the radius 006B: [email protected] *= [email protected] // floating-point values but I set it at beginning to 30.5 0007: [email protected] = 30.5 // floating-point values CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
dtd mods Posted January 25, 2009 Author Share Posted January 25, 2009 hey ZAZ i have a question. How can i init the object so the shark moves and attacks you if you are in the sea. I do some experiments but it not moves good . Tell me how the shark attacks cj and swim in the sea because i use the code above and it doesnt swim well and also how can i add a check if object $shark is near player radius 0.5,then throw shark object agaist player? can you help me? plz sharks moving around CJ needs to calculate coords of player circle use cosine for x coord and sinus for y coord of a defined radius look in killersharkscript for this part: :Sharks_9000B: [email protected] += 1.0 // floating-point values 000F: [email protected] -= 1.0 // floating-point values//000F: [email protected] -= 0.01 // floating-point values000B: [email protected] += 0.01 // floating-point values0087: [email protected] = [email protected] // floating-point values only0087: [email protected] = [email protected] // floating-point values only0087: [email protected] = [email protected] // floating-point values only02F6: [email protected] = cosine [email protected] // sinus swapped with cosine0013: [email protected] *= 1.0 // floating-point values (never used in VC or GTA 3) 006B: [email protected] *= [email protected] // floating-point values02F7: [email protected] = sinus [email protected] // cosine swapped with sinus 0013: [email protected] *= 1.0 // floating-point values (never used in VC or GTA 3)006B: [email protected] *= [email protected] // floating-point values005B: [email protected] += [email protected] // floating-point values005B: [email protected] += [email protected] // floating-point values034E: move_object [email protected] to [email protected] [email protected] [email protected] speed 0.3 0.3 0.3 flag 0000F: [email protected] -= 180.0 // floating-point values0177: set_object [email protected] z_angle_to [email protected]: [email protected] += 180.0 // floating-point values0087: [email protected] = [email protected] // floating-point values only0087: [email protected] = [email protected] // floating-point values only0087: [email protected] = [email protected] // floating-point values only02F6: 28@ = cosine [email protected] // sinus swapped with cosine0013: [email protected] *= 1.0 // floating-point values (never used in VC or GTA 3) 006B: [email protected] *= [email protected] // floating-point values02F7: [email protected] = sinus [email protected] // cosine swapped with sinus 0013: [email protected] *= 1.0 // floating-point values (never used in VC or GTA 3)006B: [email protected] *= [email protected] // floating-point values005B: [email protected] += [email protected] // floating-point values005B: [email protected] += [email protected] // floating-point values000F: [email protected] -= 180.0 // floating-point values034E: move_object [email protected] to [email protected] [email protected] [email protected] speed 0.3 0.3 0.3 flag 0000B: [email protected] += 180.0 // floating-point values0177: set_object [email protected] z_angle_to [email protected]: -90.0 > [email protected] // floating-point values004D: jump_if_false @Sharks_70172: [email protected] = actor $PLAYER_ACTOR z_angle0007: [email protected] = 270.0 // floating-point values0007: [email protected] = 0.0 // floating-point values0002: jump @Sharks_7 THANKS MY FRIEND! THE OPCODES 000F: 005B: 000B: AND 02F7: WHAT DOES IT DO? 000F: substract a Float value from a LocalVariable Float value [email protected] is the z_angle for the shark [email protected] -= 180.0 is z_angle for the second shark on the opposite site when objects moving in a circle need also to turn the objects z_angle [email protected] is the z_angle for the circle to move 005B: add a LocalVariable Float to a LocalVariable Float value 000B: add a Float value to a LocalVariable Float value 02F7 requires the knowlege about math function sinus and cosine of a triangle http://www.mathe-online.at/mathint/wfun/grafiken/sincos2.gif to get a point on the circle can used the sinus funktion with the z_angle with 02F7 in gta you get a point on the circle, WITH RADIUS 1.0 multiplikate then the result with 5.0 and you get a point on the circle, WITH RADIUS 5.0 I used a variable value for the radius 006B: [email protected] *= [email protected] // floating-point values but I set it at beginning to 30.5 0007: [email protected] = 30.5 // floating-point values thanks for helping me Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now