jani201 Posted November 28, 2011 Share Posted November 28, 2011 (edited) Edited because edited cleo mod is in last post------ Edited November 28, 2011 by jani201 Link to comment Share on other sites More sharing options...
Troll--dad Posted November 28, 2011 Share Posted November 28, 2011 (edited) Try changing this part: :GATEOPEN_27wait 0if Player.Defined($PLAYER_CHAR)else_jump @GATEOPEN_63if Player.Controllable($PLAYER_CHAR)else_jump @GATEOPEN_63 for this :GATEOPEN_27wait 0if Player.Defined($PLAYER_CHAR)else_jump @GATEOPEN_27if Player.Controllable($PLAYER_CHAR)else_jump @GATEOPEN_27 also, this is unuseful, because you aren't checking anything: ifelse_jump @GATEOPEN_63 and you forgot to put the jump_if_false here: if0474: actor $PLAYER_ACTOR near_object_in_cube [email protected] radius 35.0 35.0 9.0 flag 0 last but not least: 8AB0: not key_pressed 36 you can't use this opcode unless you use it in a conditional check (I thought you want to put that in the empty conditional check mentioned above) Edited November 28, 2011 by Troll--dad Link to comment Share on other sites More sharing options...
jani201 Posted November 28, 2011 Author Share Posted November 28, 2011 and you forgot to put the jump_if_false here: if0474: actor $PLAYER_ACTOR near_object_in_cube [email protected] radius 35.0 35.0 9.0 flag 0 last but not least: 8AB0: not key_pressed 36you can't use this opcode unless you use it in a conditional check (I thought you want to put that in the empty conditional check mentioned above) For the useless line... it was ment to be for the key pressing part. i moved it to there and also changed it a bit: if 8AB0: not key_pressed 1 else_jump @GATEOPEN_63 and used else_jump instead of jump_if_false as it said flase directive. and key_pressed is now: 0AB0: key_pressed 0x36 idk if correct. Link to comment Share on other sites More sharing options...
Troll--dad Posted November 28, 2011 Share Posted November 28, 2011 and used else_jump instead of jump_if_false as it said flase directive. are the same so no problem 0AB0: key_pressed 0x36 in case you wanted to use the number 6 as key, then yes. Link to comment Share on other sites More sharing options...
jani201 Posted November 28, 2011 Author Share Posted November 28, 2011 still causes the crash, so i can't really test if the .sc would move the model i created as gate. The whole edited script. Link to comment Share on other sites More sharing options...
Troll--dad Posted November 28, 2011 Share Posted November 28, 2011 Object [email protected] isn't defined anywhere, i think you have to define it (IDK how to do it) If you want to check if the actor is in a concrete zone i recommend that code 00ED: actor $PLAYER_ACTOR sphere 0 near_point [email protected] [email protected] radius 5.0 5.0 on_foot just change the variables in the points X and Y on map, use SannyBuilder Coord manager and the radius The objects exist in the map, if not you have to create it (Load, check and create) with the [email protected] variable Link to comment Share on other sites More sharing options...
jani201 Posted November 28, 2011 Author Share Posted November 28, 2011 i can define it with model id with from med i think ^^ and i never saw it missing, so i must be coding blind Link to comment Share on other sites More sharing options...
spaceeinstein Posted November 28, 2011 Share Posted November 28, 2011 Your code shouldn't have create_thread and end_thread. Why would you place the end_thread anyways? The code never reads that line. When you want to make an object move, use the move_object opcode, not the throw_object opcode. Link to comment Share on other sites More sharing options...
jani201 Posted November 29, 2011 Author Share Posted November 29, 2011 (edited) the code above has the latest edited code that almost works. //-------------MAIN---------------0001: wait 1000 ms 0A95: enable_thread_saving :NONAME_150107: $2706 = create_object 984 at -503.162 -563.021 27.3422 0001: wait 0 ms 00D6: if 0256: player $PLAYER_CHAR defined 004D: jump_if_false @NONAME_15 00D6: if 03EE: player $PLAYER_CHAR controllable 004D: jump_if_false @NONAME_15 :NONAME_7400D6: if 0474: actor $PLAYER_ACTOR near_object_in_cube $2706 radius 35.0 35.0 9.0 flag 0 004D: jump_if_false @NONAME_74 00D6: if or00DD: actor $PLAYER_ACTOR driving_car_with_model #RDTRAIN 00DD: actor $PLAYER_ACTOR driving_car_with_model #LINERUN 00DD: actor $PLAYER_ACTOR driving_car_with_model #PETROTR 004D: jump_if_false @NONAME_74 0001: wait 100 ms 034E: move_object $2706 to -503.162 -563.021 27.3422 speed 0.1 0.1 0 flag 1 :NONAME_1990001: wait 0 ms 8474: not actor $PLAYER_ACTOR near_object_in_cube $2706 radius 20.0 20.0 5.0 flag 0 004D: jump_if_false @NONAME_199 034E: move_object $2706 to -489.762 -563.021 27.3422 speed 0.1 0.1 0 flag 1 0002: jump @NONAME_74 Edited November 30, 2011 by jani201 Link to comment Share on other sites More sharing options...
spaceeinstein Posted November 29, 2011 Share Posted November 29, 2011 Stop using create_thread, they don't apply to CLEO scripts. When referring the gate object, you cannot use the object's IDE model number. If you think about it, it should be obvious. You're not moving all the gates out there, you're just moving only gate $2706. Link to comment Share on other sites More sharing options...
jani201 Posted November 30, 2011 Author Share Posted November 30, 2011 (edited) Well you might tell that to this error i get when trying to compile: Compiled file has no header, so the model name #FENCE_sh*t2 can not be used. Use number ID instead. Or maby you are saying that it needs to be in the create_object line but not in any other? And changed the later id numbers to $2706 Edit: Now it doesn't crash the game, neither does it load it in new game or save game. Edited November 30, 2011 by jani201 Link to comment Share on other sites More sharing options...
spaceeinstein Posted November 30, 2011 Share Posted November 30, 2011 (edited) Yes, I wasn't referring to the create_object opcode, I was referring to the other object-related opcodes. Create_object requires the model ID number, the others just the object's handle. When you create an object, you shouldn't put create_object within a loop. If the conditional statements were false, the code will loop back to the beginning and recreate the object again until the conditional statements are true. You would end up with multiple objects and can crash the game. Place create_object outside the loop if you just want to create one gate. Under NONAME_74, you didn't place a wait. If the code performs a loop, it have to go through a wait opcode. Edited November 30, 2011 by spaceeinstein 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