Lazlo_ Posted March 19, 2013 Share Posted March 19, 2013 I have attempted to adjust a small script with new coordinates to create a automatic sliding gate for GTA SA (PC). The original script was kindly provided by Zaz, shown here The original script as it is works flawlessly. I changed only the object ID, the coordinates and position values. I wished to make the gate slide up & down, not left and right, and adjusted the position coordinate values to reflect this, namely the (open) Z-axis. Though I have seen it done, a gate sliding up and down, simply replacing the coordinates in this script has not been effective. I am not skilled in scripting; quite a beginner. Though I have studied several tutorials, and continue to do so, and find the script language fairly intuitive, I cannot find the problem. One thing I have been struggling with in this case has been grasping the purpose and computation of values 14 and 15 shown below, and how the labels are _numbered, or why the labels appear different once compiled and re-opened. Presently, these are the unintended effects when the modified script is run: • The gate spawns too high by about five units, though not at the opening height. • The gate opens by sliding horizontally, not moving up. • As it slides horizontally, it does not stop. It continues to slide off, sailing over the hill and south into the sunset. • Nothing seems to stop it; it can't be closed with the prescribed key-press. For visual context, this is for a house built upon a hill in Tierra Robada overlooking Bayside. The gate is part of a perimeter fence. My first suspicion, aside from my own inability, is that the OP-code may only be for horizontal motion only. I can't figure why the problem manifests the way it does though. Recently, a new problem has emerged; the key-press has been replaced in the script from F5 (key 116) to F4 (key 115) but is not recognized in the game. And for some reason, the most recent re-try results in the gate not moving at all, regardless of key. This is my first post after lurking quite some time and have read the rules & guidelines. I apologize if the thread itself is in some way erroneously posted, and welcome feedback regarding the topic or thread structure itself. Thank you. Link to comment Share on other sites More sharing options...
Lazlo_ Posted March 19, 2013 Author Share Posted March 19, 2013 An update. I have found that if I change the open position Y-axis coordinates and leave the Z-axis as is, I get perfectly functioning gate, albeit horizontal sliding, unlike the vertical I had hoped for by entering a change in Z-axis position when open. The key-press issue seems resolved; perhaps a conflicting script. The spawn height issue was resolved by imply adjusting the coordinates to compensate; the coordinates from MeD apparently didn't translate quite right. I would have liked a gate that opened vertically. I am interested if that would have been possible. Again, I suspect that perhaps the OP-code was simply not meant for vertical motion, and giving it a vertical open position just made it screwy. Thanks again, Zaz, and anyone with ideas or thoughts on what the conflict might be. Until then, I can be satisfied with a horizontally sliding door. :3 Link to comment Share on other sites More sharing options...
ZAZ Posted March 20, 2013 Share Posted March 20, 2013 have a look to the liftscript how to check and run vertical moving {$CLEO .cs}:LIFT_TEST// press Backspace to spawn a51_jetdoor as lift plattform//and and put player_actor on it// lift moves upward and downward// press Backspace to remove the object//------------------------------thread 'LIFTEST':LIFT_01wait 0 if 0256: player $PLAYER_CHAR defined jf @LIFT_01 if 0AB0: key_pressed 8 jf @LIFT_01 0247: load_model 3095 :LIFT_03wait 0 if 0248: model 3095 available jf @LIFT_03 04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 0.0 10.5 400.0 0107: [email protected] = create_object 3095 at [email protected] [email protected] 400.0 wait 1000 00A1: put_actor $PLAYER_ACTOR at [email protected] [email protected] 402.0 wait 1000 0006: [email protected] = 0 :LIFT_05wait 0 if 0256: player $PLAYER_CHAR defined jf @LIFT_13 if 8AB0: not key_pressed 8 jf @LIFT_13 01BB: store_object [email protected] position_to [email protected] [email protected] [email protected] if 0039: [email protected] == 0 jf @LIFT_09 if 0023: 520.0 > [email protected] jf @LIFT_07 034E: move_object [email protected] to [email protected] [email protected] 520.5 speed 0.0 0.0 0.9 flag 0 0002: jump @LIFT_05 :LIFT_070006: [email protected] = 1 :LIFT_09if 0039: [email protected] == 1 jf @LIFT_05 if 0021: [email protected] > 500.5 jf @LIFT_11 034E: move_object [email protected] to [email protected] [email protected] 500.0 speed 0.0 0.0 0.2 flag 0 0002: jump @LIFT_05 :LIFT_110006: [email protected] = 0 0002: jump @LIFT_05 :LIFT_130108: destroy_object [email protected] 0001: wait 1000 ms 0002: jump @LIFT_01 CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
Lazlo_ Posted March 21, 2013 Author Share Posted March 21, 2013 have a look to the liftscript how to check and run vertical moving Thank you very much! I will have a lot of fun tinkering with it and exploring how it works. That's how I learn most everything. It might be a little while, but I will report back once I have some results to share. Presently I am working in MeD, and will have a few more gates yet to make later. Thanks again! 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