Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Support

    3. Suggestions

Happy Holidays from the GTANet team!

Cannot tweak small auto door script


Lazlo_
 Share

Recommended Posts

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. smile.gif

 

user posted image

 

 

 

 

Link to comment
Share on other sites

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

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 

 

Link to comment
Share on other sites

 

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!

 

biggrin.gif

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.