astr1 Posted February 1, 2007 Author Share Posted February 1, 2007 you do not have to throw your code away ,and no one suggested it Well they did say to start over, so thats kind of throwing it away what u need to do is to break it down ,for example,spawn the actors and the car infront of you = break 1when you see this works move on to the next section,and so on,that way you check your code on the fly and have much more chances to be able to debug problems,you will know what labels are newly added, and if the code worked to certain point and now its not, its pretty obvious where's the problem at. Yes, I'm gonna try this after I understand smaller codes, Like what KN suggested. Link to comment Share on other sites More sharing options...
astr1 Posted February 2, 2007 Author Share Posted February 2, 2007 Double post.... .Ok iv been messings around with coding and I made a code: It places ken at a sertain spot, and it creates a sphere and a marker pn the map, when you walk into the sphere it will raise you money but at the same time it raises your wanted level. Now that's what I have done and now this is what I want to add to add to it though I cannot work out how ->.To keep the money you earnt from ken you must arrive at a sertain point and if you do not make it and get wasted or busted you lose the money you earnt plus and you lose $250 too. Also when you kill ken it disables the marker on the map, disables the sphere on the map and when you walk to the position you do not get any money. Here's my code: :Label031FA703BC: $53D = create_sphere 109.197 -810.519 9.482 1.502A8: $53E = create_marker 5 at 108.696 -811.667 9.482:Label031FD60006: [email protected] = 0 \\ integer values:Label031FDD0001: wait 50 ms00D6: if 280E0: NOT player $PLAYER_CHAR driving004D: jump_if_false ££Label031FDD00D6: if 00039: [email protected] == 1 \\ integer values004D: jump_if_false ££Label0320130296: unload_special_actor 10009B: destroy_actor_instantly [email protected]: [email protected] = 0 \\ integer values:Label032013023C: load_special_actor 10 "IGKEN"038B: load_requested_models:Label0320210001: wait 0 ms00D6: if 0023D: special_actor 10 loaded004D: jump_if_false ££Label032021009A: [email protected] = create_actor 4 #SPECIAL10 at 108.696 -811.667 9.4820192: set_actor [email protected] objective_to_stand_still0006: [email protected] = 1 \\ integer values:Label0320580001: wait 20 ms00D6: if 21004D: jump_if_false ££Label0320580002: jump ££Label031FDD:Label03206E0001: wait 50 ms00D6: if 000F6: player $PLAYER_CHAR 0 ()near_point_on_foot 109.197 -810.519 9.482 radius 1.4 1.8 1.5004D: jump_if_false ££Label03206E0109: player $PLAYER_CHAR money += 25010D: set_player $PLAYER_CHAR wanted_level_to 10002: jump ££Label0320B7:Label0320B70001: wait 3000 ms00D6: if 000F6: player $PLAYER_CHAR 0 ()near_point_on_foot 109.197 -810.519 9.482 radius 1.4 1.8 1.5004D: jump_if_false ££Label0320B70109: player $PLAYER_CHAR money += 50010D: set_player $PLAYER_CHAR wanted_level_to 20002: jump ££Label032101:Label0321010001: wait 3000 ms00D6: if 000F6: player $PLAYER_CHAR 0 ()near_point_on_foot 109.197 -810.519 9.482 radius 1.4 1.8 1.5004D: jump_if_false ££Label0321010109: player $PLAYER_CHAR money += 75010D: set_player $PLAYER_CHAR wanted_level_to 30002: jump ££Label03214B:Label03214B0001: wait 3000 ms00D6: if 000F6: player $PLAYER_CHAR 0 ()near_point_on_foot 109.197 -810.519 9.482 radius 1.4 1.8 1.5004D: jump_if_false ££Label03214B0109: player $PLAYER_CHAR money += 100010D: set_player $PLAYER_CHAR wanted_level_to 40002: jump ££Label032195:Label0321950001: wait 4000 ms00D6: if 000F6: player $PLAYER_CHAR 0 ()near_point_on_foot 109.197 -810.519 9.482 radius 1.4 1.8 1.5004D: jump_if_false ££Label0321950109: player $PLAYER_CHAR money += 125010D: set_player $PLAYER_CHAR wanted_level_to 50002: jump ££Label0321DF:Label0321DF0001: wait 4000 ms00D6: if 000F6: player $PLAYER_CHAR 0 ()near_point_on_foot 109.197 -810.519 9.482 radius 1.4 1.8 1.5004D: jump_if_false ££Label0321DF0109: player $PLAYER_CHAR money += 150010D: set_player $PLAYER_CHAR wanted_level_to 60002: jump ££Label0321DF LABELS: 004F: create_thread ££Label031FD6 004F: create_thread ££Label03206E 004F: create_thread ££Label031FA7 BTW: You will probably notice that I used rockstar labels.Well for some reason when I wrote in normal Labels (that I made up) and then if I exited out of mission_builder and then entered it again they were replaced with R labels. Link to comment Share on other sites More sharing options...
Freakingfreak Posted February 3, 2007 Share Posted February 3, 2007 :Label0320580001: wait 20 ms00D6: if 21004D: jump_if_false ££Label0320580002: jump ££Label031FDD whats with that again ? if you are doing the same mistakes again and again peeps will be less eager to help,pay more attention to your code m8. :Label0320B70001: wait 3000 ms00D6: if 000F6: player $PLAYER_CHAR 0 ()near_point_on_foot 109.197 -810.519 9.482 radius 1.4 1.8 1.5004D: jump_if_false ££Label0320B70109: player $PLAYER_CHAR money += 50010D: set_player $PLAYER_CHAR wanted_level_to 20002: jump ££Label032101:Label0321010001: wait 3000 ms00D6: if 000F6: player $PLAYER_CHAR 0 ()near_point_on_foot 109.197 -810.519 9.482 radius 1.4 1.8 1.5004D: jump_if_false ££Label0321010109: player $PLAYER_CHAR money += 75010D: set_player $PLAYER_CHAR wanted_level_to 30002: jump ££Label03214B:Label03214B you dont need to use 0002: jump ££label if the label is the next one ahead ,the code going there anyways. :Label03206E0001: wait 50 ms00D6: if 000F6: player $PLAYER_CHAR 0 ()near_point_on_foot 109.197 -810.519 9.482 radius 1.4 1.8 1.5004D: jump_if_false ££Label03206E0109: player $PLAYER_CHAR money += 25010D: set_player $PLAYER_CHAR wanted_level_to 10002: jump ££Label0320B7:Label0320B70001: wait 3000 ms00D6: if 000F6: player $PLAYER_CHAR 0 ()near_point_on_foot 109.197 -810.519 9.482 radius 1.4 1.8 1.5004D: jump_if_false ££Label0320B70109: player $PLAYER_CHAR money += 50010D: set_player $PLAYER_CHAR wanted_level_to 20002: jump ££Label032101:Label0321010001: wait 3000 ms00D6: if 000F6: player $PLAYER_CHAR 0 ()near_point_on_foot 109.197 -810.519 9.482 radius 1.4 1.8 1.5004D: jump_if_false ££Label0321010109: player $PLAYER_CHAR money += 75010D: set_player $PLAYER_CHAR wanted_level_to 30002: jump ££Label03214B:Label03214B0001: wait 3000 ms00D6: if 000F6: player $PLAYER_CHAR 0 ()near_point_on_foot 109.197 -810.519 9.482 radius 1.4 1.8 1.5004D: jump_if_false ££Label03214B0109: player $PLAYER_CHAR money += 100010D: set_player $PLAYER_CHAR wanted_level_to 40002: jump ££Label032195:Label0321950001: wait 4000 ms00D6: if 000F6: player $PLAYER_CHAR 0 ()near_point_on_foot 109.197 -810.519 9.482 radius 1.4 1.8 1.5004D: jump_if_false ££Label0321950109: player $PLAYER_CHAR money += 125010D: set_player $PLAYER_CHAR wanted_level_to 50002: jump ££Label0321DF:Label0321DF0001: wait 4000 ms00D6: if 000F6: player $PLAYER_CHAR 0 ()near_point_on_foot 109.197 -810.519 9.482 radius 1.4 1.8 1.5004D: jump_if_false ££Label0321DF0109: player $PLAYER_CHAR money += 150010D: set_player $PLAYER_CHAR wanted_level_to 60002: jump ££Label0321DF why all this labels are for the same spot ? this way the code is locked if you are not near point 109.197 -810.519 9.482 , and according to what you want to do it should be (pseudo code): :Label0320B70001: wait 250 ms <--- changed to shorter wait ,so u wouldnt have to wait 3000 ms till its activated00D6: if 000F6: player $PLAYER_CHAR 0 ()near_point_on_foot 109.197 -810.519 9.482 radius 1.4 1.8 1.5004D: jump_if_false ££Label0320B7$mission1_money = 250 0109: player $PLAYER_CHAR money += $mission1_money 010D: set_player $PLAYER_CHAR wanted_level_to 2disable marker/sphere make new sphere in new destination :Label032101 <---- check to see if player arrived at new destination 0001: wait 500 ms00D6: if 080F6: NOT player $PLAYER_CHAR 0 ()near_point_on_foot --->new destination <--- radius 1.4 1.8 1.5004D: jump_if_false ££continue from here :Label032102 <----- check to see if ken is dead 0001: wait 500 ms00D6: if 0 if ken dead 004D: jump_if_false ££Label032103remove reference to kendisable marker/sphere $mission1_money * -1 player money + $mission1_moneyjump whatever :Label032103 <-----check to see if player still definedwait 500 if 0 player actor defined jump if false Label032104jump 032101 <----- back to loop start :Label032104$mission1_money * -1 player money + $mission1_moneyjump whatever thats pretty much the blueprint of what you want to do ,good luck . BTW: You will probably notice that I used rockstar labels.Well for some reason when I wrote in normal Labels (that I made up) and then if I exited out of mission_builder and then entered it again they were replaced with R labels. thats because you are working with the scm,while u should work on the source which is txt . Link to comment Share on other sites More sharing options...
astr1 Posted February 4, 2007 Author Share Posted February 4, 2007 (edited) whats with that again ? if you are doing the same mistakes again and again peeps will be less eager to help,pay more attention to your code m8. You know this is a different code then I was doing before, right? Label0320B7 0001: wait 3000 ms 00D6: if 0 00F6: player $PLAYER_CHAR 0 ()near_point_on_foot 109.197 -810.519 9.482 radius 1.4 1.8 1.5 004D: jump_if_false ££Label0320B7 0109: player $PLAYER_CHAR money += 50 010D: set_player $PLAYER_CHAR wanted_level_to 2 0002: jump ££Label032101 :Label032101 0001: wait 3000 ms 00D6: if 0 00F6: player $PLAYER_CHAR 0 ()near_point_on_foot 109.197 -810.519 9.482 radius 1.4 1.8 1.5 004D: jump_if_false ££Label032101 0109: player $PLAYER_CHAR money += 75 010D: set_player $PLAYER_CHAR wanted_level_to 3 0002: jump ££Label03214B :Label03214B you dont need to use 0002: jump ££label if the label is the next one ahead ,the code going there anyways. :Label03206E0001: wait 50 ms00D6: if 000F6: player $PLAYER_CHAR 0 ()near_point_on_foot 109.197 -810.519 9.482 radius 1.4 1.8 1.5004D: jump_if_false ££Label03206E0109: player $PLAYER_CHAR money += 25010D: set_player $PLAYER_CHAR wanted_level_to 10002: jump ££Label0320B7:Label0320B70001: wait 3000 ms00D6: if 000F6: player $PLAYER_CHAR 0 ()near_point_on_foot 109.197 -810.519 9.482 radius 1.4 1.8 1.5004D: jump_if_false ££Label0320B70109: player $PLAYER_CHAR money += 50010D: set_player $PLAYER_CHAR wanted_level_to 20002: jump ££Label032101:Label0321010001: wait 3000 ms00D6: if 000F6: player $PLAYER_CHAR 0 ()near_point_on_foot 109.197 -810.519 9.482 radius 1.4 1.8 1.5004D: jump_if_false ££Label0321010109: player $PLAYER_CHAR money += 75010D: set_player $PLAYER_CHAR wanted_level_to 30002: jump ££Label03214B:Label03214B0001: wait 3000 ms00D6: if 000F6: player $PLAYER_CHAR 0 ()near_point_on_foot 109.197 -810.519 9.482 radius 1.4 1.8 1.5004D: jump_if_false ££Label03214B0109: player $PLAYER_CHAR money += 100010D: set_player $PLAYER_CHAR wanted_level_to 40002: jump ££Label032195:Label0321950001: wait 4000 ms00D6: if 000F6: player $PLAYER_CHAR 0 ()near_point_on_foot 109.197 -810.519 9.482 radius 1.4 1.8 1.5004D: jump_if_false ££Label0321950109: player $PLAYER_CHAR money += 125010D: set_player $PLAYER_CHAR wanted_level_to 50002: jump ££Label0321DF:Label0321DF0001: wait 4000 ms00D6: if 000F6: player $PLAYER_CHAR 0 ()near_point_on_foot 109.197 -810.519 9.482 radius 1.4 1.8 1.5004D: jump_if_false ££Label0321DF0109: player $PLAYER_CHAR money += 150010D: set_player $PLAYER_CHAR wanted_level_to 60002: jump ££Label0321DF why all this labels are for the same spot ? this way the code is locked if you are not near point 109.197 -810.519 9.482 , and according to what you want to do it should be (pseudo code): :Label0320B70001: wait 250 ms <--- changed to shorter wait ,so u wouldnt have to wait 3000 ms till its activated00D6: if 000F6: player $PLAYER_CHAR 0 ()near_point_on_foot 109.197 -810.519 9.482 radius 1.4 1.8 1.5004D: jump_if_false ££Label0320B7$mission1_money = 250 0109: player $PLAYER_CHAR money += $mission1_money 010D: set_player $PLAYER_CHAR wanted_level_to 2disable marker/sphere make new sphere in new destination :Label032101 <---- check to see if player arrived at new destination 0001: wait 500 ms00D6: if 080F6: NOT player $PLAYER_CHAR 0 ()near_point_on_foot --->new destination <--- radius 1.4 1.8 1.5004D: jump_if_false ££continue from here :Label032102 <----- check to see if ken is dead 0001: wait 500 ms00D6: if 0 if ken dead 004D: jump_if_false ££Label032103remove reference to kendisable marker/sphere $mission1_money * -1 player money + $mission1_moneyjump whatever :Label032103 <-----check to see if player still definedwait 500 if 0 player actor defined jump if false Label032104jump 032101 <----- back to loop start :Label032104$mission1_money * -1 player money + $mission1_moneyjump whatever thats pretty much the blueprint of what you want to do ,good luck. I'm really lost in what your trying to say here, I'f you could please right, if not I'l just have to look carefully at it. Thanks thats because you are working with the scm,while u should work on the source which is txt. Well I do it all the time but its different this time 004F: create_thread ££INIT;; your created thread, to go with the others :INIT 0006: [email protected] = 0;; this sets our LOCAL INTEGER (aka, our "switch") to zero, so we can check if we've created an actor already. This line of code only gets run once, to ensure that the variable we'll be using ([email protected]) is properly initialized. I've read that you can do this in the create_thread opcode, but I can't find any docs on it at the moment, so we'll do this the "safe" way for now. :MODEL 0001: wait 50 ms 00D6: if 2 80E0: NOT player $PLAYER_CHAR driving 00E1: key_pressed 0 4; Action key (centers camera) 00E1: key pressed 0 6; Aim/Target key 004D: jump if false ££MODEL 00D6: if 0 0039: [email protected] == 1;; this checks if we have already created an actor, and if not, to jump to :LOAD instead 004D: jump if false ££LOAD 0296: unload_special_actor 10;; releases the model so we can delete it 009B: destroy_actor_instantly [email protected];; this deletes the actor if created previously so we can create a new one 0006: [email protected] = 0;; this sets our LOCAL INTEGER (aka setli, or our "switch") to zero, so we can go ahead and create a new actor without trying to pile them up :LOAD 023C: load_special_actor 10 "IGKEN" 038B: load_requested_models :PLACE 0001: wait 0 ms 00D6: if 0 023D: special_actor 10 loaded 004D: jump_if_false ££PLACE 009A: [email protected] = create actor 4 #SPECIAL10 at 108.696 -811.667 9.482 0192: set actor [email protected] objective to stand still 0006: [email protected] = 1;; this is setli, like above, except we're setting our switch to 1, so the code knows that the actor is created. :PAUSE 0001: wait 20 ms 00D6: if 21 80E1: NOT key_pressed 0 4 80E1: NOT key pressed 0 6 004D: jump if false ££PAUSE 0002: jump ££MODEL How do I change it to a normal ped (wMYPI), Iv been messing around alot with it but it doesn't seem to work, also how do I make it so when you walk to 109.197 -810.519 9.482 it displays a message "00BC: text_highpriority "TYPE_HERE" 10000 ms 1 "MESSAGE_HERE" and then after 4000ms it goes away. I thought the code would look some what like this :CAMERA054C: use_GXT_table "TYPE_HERE"00F6: player $PLAYER_CHAR 0 ()near_point_on_foot 109.197 -810.519 9.482 radius 1.4 1.8 1.500BC: text_highpriority "TYPE_HERE" 10000 ms 1 "MESSAGE HERE"0001: wait 3000 ms03D5: remove_text "TYPE_HERE" "MESSAGE HERE" but it crashes when I press "Start New Game" ,so how do I fix, Thanks Edited February 6, 2007 by astr1 Link to comment Share on other sites More sharing options...
astr1 Posted February 6, 2007 Author Share Posted February 6, 2007 ^^^^^. Anyone? Link to comment Share on other sites More sharing options...
Freakingfreak Posted February 6, 2007 Share Posted February 6, 2007 You know this is a different code then I was doing before, right? yes i know this is a different code,but in this code you made the same mistake that you did in your previous code, more ever,it was among the first things that ceedj corrected you about ,read the first replay to this thread again . I'm really lost in what your trying to say here, I'f you could please right, if not I'l just have to look carefully at it. Thanks hmmm,in your previous post before i replayed , you wrote : Ok iv been messings around with coding and I made a code: It places ken at a sertain spot, and it creates a sphere and a marker pn the map, when you walk into the sphere it will raise you money but at the same time it raises your wanted level. Now that's what I have done and now this is what I want to add to add to it though I cannot work out how ->.To keep the money you earnt from ken you must arrive at a sertain point and if you do not make it and get wasted or busted you lose the money you earnt plus and you lose $250 too. Also when you kill ken it disables the marker on the map, disables the sphere on the map and when you walk to the position you do not get any money. then you presented your code,so i told you whats wrong with your code and gave you example of one possible way to code it ,i suggest you take a closer look at that . How do I change it to a normal ped (wMYPI), Iv been messing around alot with it but it doesn't seem to work just open your opcode.txt or sascm.ini and search for create_actor ,then open your original scm,search for the opcode you are interested in,look how its done and imitate it ,pretty basic stuff ,shouldnt be that hard to do . 054C: use_GXT_table "TYPE_HERE"00F6: player $PLAYER_CHAR 0 ()near_point_on_foot 109.197 -810.519 9.482 radius 1.4 1.8 1.500BC: text_highpriority "TYPE_HERE" 10000 ms 1 "MESSAGE HERE"0001: wait 3000 ms03D5: remove_text "TYPE_HERE" "MESSAGE HERE" 00F6: player $PLAYER_CHAR 0 ()near_point_on_foot 109.197 -810.519 9.482 radius 1.4 1.8 1.5 is a if conditional ,so you need if 0 before and jump if false after ,i reckon you allready know that in order to use text you need to edit the gxt file ? , but anyways the txt is not the reason for the crash . astr1 ,i hope you wont take this too harshly,we all had our bits of frustration when we started coding ,i suggest that you go back to the tutorials and Mb/sanny's readme files and read them more carefully. open original scm and just look at it ,try to figure the basic structures of first threads and then missions . and try to understand the basics more carefully. Link to comment Share on other sites More sharing options...
astr1 Posted February 6, 2007 Author Share Posted February 6, 2007 so you need if 0 before and jump if false after So is that all that I need to put in the code? Link to comment Share on other sites More sharing options...
astr1 Posted March 3, 2007 Author Share Posted March 3, 2007 Ok, I havn't been modding lately. But I still want to continue, So well, I kinda know the basics of placing a character, now how do I place an object, I'm NOT making a new object I want to place a previously made one, take a tree for example, all I want to do is place a tree at 109.197 -810.519 9.482. Thanks Link to comment Share on other sites More sharing options...
ceedj Posted March 3, 2007 Share Posted March 3, 2007 Again, look at the original code for opcodes dealing with objects. Check the VC-DB to see what they mean, or search this forum. A hint: when creating objects in the SCM, there are two types: those defined in the second segment of the SCM use negative numbers (MB and Sanny convert these numbers to ide styled names, such as -1 = #DTN_STADDOORA, etc). You can also create objects from files outside of the main, by finding the ID number of the object in the various map files (opened with Notepad or MapEdit) and using that. I'm actually not against democracy though. I'm against things I think are f*cking stupid. I think this is f*cking stupid. - Sweets 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