Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. The Diamond Casino Heist
      2. Find Lobbies & Players
      3. Guides & Strategies
      4. Vehicles
      5. Content Creator
      6. Help & Support
    2. Red Dead Online

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

    1. Red Dead Redemption 2

      1. PC
      2. Gameplay
      3. Missions
      4. Help & Support
    2. Red Dead Redemption

    1. Grand Theft Auto Series

    2. GTA 6

      1. St Andrews Cathedral
    3. GTA V

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

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

    6. GTA Vice City Stories

    7. GTA Liberty City Stories

    8. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
    9. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
    10. GTA III

      1. Guides & Strategies
      2. Help & Support
    11. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    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. DYOM
      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
    3. Gangs

    1. Announcements

    2. Support

    3. Suggestions

deltaCJ

[SA] Objects, Elevators, and Flying objects.

Recommended Posts

deltaCJ

Hey there!

 

I want to make a "catapult" kinda of idea. It would be a huge machine (that i would model) and it would send you flying in the air with a parachute. How would I be able to do that?

 

I know how to move objects and stuff, but how could I make it to launch the player so high in the air?

 

EDIT: Was able to make a simplemath script in the main.scm for the elevator, just waiting for the catapult.

 

here's the code.

:ELEVATORthread 'ELEV':ELEV_11model.Load(#A51_BLASTDOORR)038B: load_requested_models:ELEV_18ifmodel.Available(#A51_BLASTDOORR)else_jump @ELEV_18:ELEV_25object.Init([email protected], #A51_BLASTDOORR, 2451.4114, -1657.9188, 13.0)wait 00382: set_object [email protected] collision_detection 1 0453: object [email protected] set_rotation 90.0 0.0 0.0wait 00A40: [email protected] = create_entrance_marker_at 2451.3838 -1657.4641 13.996 color 14:ELEV_29wait 0if 00F0:   actor $PLAYER_ACTOR 0 near_point 2451.3838 -1657.4641 13.996 radius 1.0 2.0 stopped_on_footelse_jump @ELEV_29:ELEV_320A41: destroy_entrance_marker [email protected]: set_player $PLAYER_CHAR ignored_by_everyone 1wait 0camera.SetBehindPlayer()object.StorePos([email protected], [email protected], [email protected], [email protected])0392: object [email protected] toggle_in_moving_list [email protected] = 0.07wait 0:ELEV_39wait 3005B: [email protected] += [email protected] // (float)[email protected] >= 30.0jf @ELEV_40jump @ELEV_44:ELEV_40 if [email protected] >= 29.8530.15 >= [email protected]([email protected], [email protected], [email protected], [email protected])jump @ELEV_39:ELEV_44object.PutAt([email protected], 2450.8057, -1657.5095, 30.15)player.CanMove($PLAYER_CHAR) = Truewait 1000object.RemoveFromMissionCleanupList([email protected])mission_cleanupend_thread
Edited by deltaCJ

Share this post


Link to post
Share on other sites
ZAZ

Use opcode 034E:

Test the script below, current coords are in Grovestreet ([email protected] = 2490.9, [email protected] = -1669.7)

Note: Carrying actor upwards works only if the object moves slowly, otherwise the collision won't work and playeractor fall throgh the object (max. 0.9)

The downwards movement is to fast (more slowly isn't possible), so the object goes down and playeractor makes fall animation for a moment. I put a wait 5 into the loop, then the movement is stuttering

It works but it looks not good

 

{$CLEO .cs}:Lift_01thread 'LIFT'[email protected] =  [email protected] =  [email protected] =  [email protected] =  0.1wait  2000:Lift_StartLoopwait  0if0256:   player $PLAYER_CHAR definedjf @Lift_StartLoopif00FE:   actor $PLAYER_ACTOR  0 (in-sphere)near_point [email protected]  [email protected]  [email protected] radius  100.5  100.5  60.5jf @Lift_StartLoop029B: [email protected] = init_object 3095 at [email protected]  [email protected]  [email protected]: set_object [email protected] z_angle_to [email protected]: remove_object_from_mission_cleanup_list [email protected]: set_object [email protected] immunities  1  1  1  1  1:Lift_Loop_UPwait  0if0256:   player $PLAYER_CHAR definedjf @Lift_cleanupif00FE:   actor $PLAYER_ACTOR  0 (in-sphere)near_point [email protected]  [email protected]  [email protected] radius  100.5  100.5  100.5jf @Lift_cleanupif00FE:   actor $PLAYER_ACTOR  0 (in-sphere)near_point [email protected]  [email protected]  [email protected] radius  3.5  3.5  100.5jf @Lift_Loop_UP01BB: store_object [email protected] position_to [email protected]  [email protected]  [email protected] > [email protected]  // floating-point valuesjf @Lift_Loop_DOWN034E: move_object [email protected] to  [email protected]  [email protected]  83.5 speed  0.0  0.0  0.9 flag  0jump @Lift_Loop_UP:Lift_Loop_DOWNwait  0if0256:   player $PLAYER_CHAR definedjf @Lift_cleanupif00FE:   actor $PLAYER_ACTOR  0 (in-sphere)near_point [email protected]  [email protected]  [email protected] radius  100.5  100.5  100.5jf @Lift_cleanupif00FE:   actor $PLAYER_ACTOR  0 (in-sphere)near_point [email protected]  [email protected]  [email protected] radius  3.5  3.5  100.5jf @Lift_Loop_DOWN01BB: store_object [email protected] position_to [email protected]  [email protected]  [email protected]@ >  11.05  // floating-point values jf @Lift_Loop_UP034E: move_object [email protected] to  [email protected]  [email protected]  1.01 speed  0.0  0.0  0.1 flag  0wait  5jump @Lift_Loop_DOWN:Lift_cleanup0108: destroy_object [email protected] @Lift_StartLoop
P.S. the downward movement work fine if framelimiter is on Edited by ZAZ
  • fir thi bairns 1

Share this post


Link to post
Share on other sites
deltaCJ

What about the catapult, how can I launch someone?

Share this post


Link to post
Share on other sites
ZAZ

something like this:

? attach playeractor to object and throw object

or move playeractor through the space while he do animation and maybe attach an object to him, look for the airswim script in cleo tut

Share this post


Link to post
Share on other sites
deltaCJ

No something like the SkyDiver in GTA Anderious

Share this post


Link to post
Share on other sites
ZAZ

No something like the SkyDiver in GTA Anderious

 

So look how SkyDiver is written, i don't know this mod

Share this post


Link to post
Share on other sites
deltaCJ

GTA Alien City.

 

I tried looking for it but it's all written very sloppy, and I can't understand it.

 

 

Edited by deltaCJ

Share this post


Link to post
Share on other sites
deltaCJ

ZAZ look at the video and tell me how I can do something like that.

Share this post


Link to post
Share on other sites
ZAZ

It's done by simple method, like this script

{$CLEO .cs}thread 'TEST':TEST_1wait 0if0256:   player $PLAYER_CHAR definedjf @TEST_1077E: get_active_interior_to [email protected] [email protected] == 00AB0:   key_pressed 8//------ Backspacejf @TEST_100A0: store_actor $PLAYER_ACTOR position_to [email protected] [email protected] [email protected]:TEST_3wait 0if0256:   player $PLAYER_CHAR definedjf @[email protected] += 0.100A1: put_actor $PLAYER_ACTOR at [email protected] [email protected] [email protected]@ > 100.0jf @TEST_3jump @TEST_1

additional the author attached the object and made a nice camera coding

find it in the External script 6 (MUNHAUSEN)

  • Like 1

Share this post


Link to post
Share on other sites
deltaCJ

Thank you!!!

Share this post


Link to post
Share on other sites
xelono
On 8/20/2016 at 3:57 AM, ZAZ said:

Use opcode 034E:

Test the script below, current coords are in Grovestreet ([email protected] = 2490.9, [email protected] = -1669.7)

Note: Carrying actor upwards works only if the object moves slowly, otherwise the collision won't work and playeractor fall throgh the object (max. 0.9)

The downwards movement is to fast (more slowly isn't possible), so the object goes down and playeractor makes fall animation for a moment. I put a wait 5 into the loop, then the movement is stuttering

It works but it looks not good

 

{$CLEO .cs}:Lift_01thread 'LIFT'1@ =  2490.92@ =  -1669.73@ =  12.34@ =  0.1wait  2000:Lift_StartLoopwait  0if0256:   player $PLAYER_CHAR definedjf @Lift_StartLoopif00FE:   actor $PLAYER_ACTOR  0 (in-sphere)near_point 1@  2@  3@ radius  100.5  100.5  60.5jf @Lift_StartLoop029B: 5@ = init_object 3095 at 1@  2@  3@0177: set_object 5@ z_angle_to 4@01C7: remove_object_from_mission_cleanup_list 5@09CA: set_object 5@ immunities  1  1  1  1  1:Lift_Loop_UPwait  0if0256:   player $PLAYER_CHAR definedjf @Lift_cleanupif00FE:   actor $PLAYER_ACTOR  0 (in-sphere)near_point 1@  2@  3@ radius  100.5  100.5  100.5jf @Lift_cleanupif00FE:   actor $PLAYER_ACTOR  0 (in-sphere)near_point 1@  2@  3@ radius  3.5  3.5  100.5jf @Lift_Loop_UP01BB: store_object 5@ position_to 1@  2@  [email protected].5 > 7@  // floating-point valuesjf @Lift_Loop_DOWN034E: move_object [email protected] to  [email protected]  [email protected]  83.5 speed  0.0  0.0  0.9 flag  0jump @Lift_Loop_UP:Lift_Loop_DOWNwait  0if0256:   player $PLAYER_CHAR definedjf @Lift_cleanupif00FE:   actor $PLAYER_ACTOR  0 (in-sphere)near_point [email protected]  [email protected]  [email protected] radius  100.5  100.5  100.5jf @Lift_cleanupif00FE:   actor $PLAYER_ACTOR  0 (in-sphere)near_point [email protected]  [email protected]  [email protected] radius  3.5  3.5  100.5jf @Lift_Loop_DOWN01BB: store_object [email protected] position_to [email protected]  [email protected]  [email protected]@ >  11.05  // floating-point values jf @Lift_Loop_UP034E: move_object [email protected] to  [email protected]  [email protected]  1.01 speed  0.0  0.0  0.1 flag  0wait  5jump @Lift_Loop_DOWN:Lift_cleanup0108: destroy_object [email protected] @Lift_StartLoop

P.S. the downward movement work fine if framelimiter is on

Hi, is it possible to add a sound for that elevator ?? obviously by the time it moves.

Share this post


Link to post
Share on other sites
deltaCJ

Yeah, use the audio_event opcode to help with that, thats how DENISka did it.

Share this post


Link to post
Share on other sites
xelono
1 hour ago, deltaCJ said:

Yeah, use the audio_event opcode to help with that, thats how DENISka did it.

Do you know what is the code that you say ?? because I used this (it's to attach the sound to the object for more realism):

 

1 @ = Audiostream.Load3D ("CLEO / SOUNDS / VOICE1.MP3")

 

Audiostream.PerformAction (1 @, PLAY)
Audiostream.LinkToObject (1 @, 2 @)
Audiostream.Loop (1 @, 1)

 

The sound plays but plays in error, for every step the elevator moves, the sound plays many times and therefore I get an annoying noise.

 

{$CLEO .cs}

thread 'LIFT'
[email protected] = Audiostream.Load("CLEO/SOUNDS/ASCENSORMUEVE.MP3")
[email protected] = Audiostream.Load("CLEO/SOUNDS/ASCENSORPARA.MP3")
Audiostream.Volume([email protected]) = 0.5
Audiostream.Volume([email protected]) = 0.7

:Lift_01
[email protected] =  660.739
[email protected] =  -2523.72
[email protected] =  110.577
[email protected] =  39.0
wait  2000

:Lift_StartLoop
wait  0
if
0256:   player $PLAYER_CHAR defined
jf @Lift_StartLoop
if
00FE:   actor $PLAYER_ACTOR  0 (in-sphere)near_point [email protected]  [email protected]  [email protected] radius  100.5  100.5  100.0
jf @Lift_StartLoop
029B: [email protected] = init_object 19793 at [email protected]  [email protected]  [email protected]
0177: set_object [email protected] z_angle_to [email protected]
01C7: remove_object_from_mission_cleanup_list [email protected]
09CA: set_object [email protected] immunities  1  1  1  1  1

:Lift_Loop_UP
wait  0
if
0256:   player $PLAYER_CHAR defined
jf @Lift_cleanup
if
00FE:   actor $PLAYER_ACTOR  0 (in-sphere)near_point [email protected]  [email protected]  [email protected] radius  100.5  100.5  100.5
jf @Lift_cleanup
if
00FE:   actor $PLAYER_ACTOR  0 (in-sphere)near_point [email protected]  [email protected]  [email protected] radius  1.0  1.0  5.5
jf @Lift_Loop_UP
01BB: store_object [email protected] position_to [email protected]  [email protected]  [email protected]
if
158.977 > [email protected]  // floating-point values
jf @Lift_Loop_DOWN
034E: move_object [email protected] to  [email protected]  [email protected]  158.977 speed  0.0  0.0  0.9 flag  0
Audiostream.PerformAction([email protected], PLAY)
Audiostream.LinkToObject([email protected], [email protected])
Audiostream.Loop([email protected], 0)
jump @Lift_Loop_UP

:Lift_Loop_DOWN
wait  0
if
0256:   player $PLAYER_CHAR defined
jf @Lift_cleanup
if
00FE:   actor $PLAYER_ACTOR  0 (in-sphere)near_point [email protected]  [email protected]  [email protected] radius  100.5  100.5  100.5
jf @Lift_cleanup
if
00FE:   actor $PLAYER_ACTOR  0 (in-sphere)near_point [email protected]  [email protected]  [email protected] radius  1.0  1.0  5.5
jf @Lift_Loop_DOWN
01BB: store_object [email protected] position_to [email protected]  [email protected]  [email protected]
if
[email protected] >  110.577  // floating-point values 
jf @Lift_Loop_UP
034E: move_object [email protected] to  [email protected]  [email protected]  110.577 speed  0.0  0.0  0.1 flag  0
wait  5
Audiostream.PerformAction([email protected], PLAY)
Audiostream.LinkToObject([email protected], [email protected])
Audiostream.Loop([email protected], 0)
jump @Lift_Loop_DOWN

:Lift_cleanup
0108: destroy_object [email protected]
Audiostream.Release([email protected])
Audiostream.Release([email protected])
jump @Lift_StartLoop

:Lift_Loop_UP
wait  0
if
0256:   player $PLAYER_CHAR defined
jf @Lift_cleanup
if
00FE:   actor $PLAYER_ACTOR  0 (in-sphere)near_point [email protected]  [email protected]  [email protected] radius  100.5  100.5  100.5
jf @Lift_cleanup
if
00FE:   actor $PLAYER_ACTOR  0 (in-sphere)near_point [email protected]  [email protected]  [email protected] radius  1.0  1.0  5.5
jf @Lift_Loop_UP
01BB: store_object [email protected] position_to [email protected]  [email protected]  [email protected]
if
158.977 > [email protected]  // floating-point values
jf @Lift_Loop_DOWN
034E: move_object [email protected] to  [email protected]  [email protected]  158.977 speed  0.0  0.0  0.9 flag  0
jump @Lift_Loop_UP

:Lift_Loop_DOWN
wait  0
if
0256:   player $PLAYER_CHAR defined
jf @Lift_cleanup
if
00FE:   actor $PLAYER_ACTOR  0 (in-sphere)near_point [email protected]  [email protected]  [email protected] radius  100.5  100.5  100.5
jf @Lift_cleanup
if
00FE:   actor $PLAYER_ACTOR  0 (in-sphere)near_point [email protected]  [email protected]  [email protected] radius  1.0  1.0  5.5
jf @Lift_Loop_DOWN
01BB: store_object [email protected] position_to [email protected]  [email protected]  [email protected]
if
[email protected] >  110.577  // floating-point values 
jf @Lift_Loop_UP
034E: move_object [email protected] to  [email protected]  [email protected]  110.577 speed  0.0  0.0  0.1 flag  0
wait  5
jump @Lift_Loop_DOWN

:Lift_cleanup
0108: destroy_object [email protected]
Audiostream.Release([email protected])
Audiostream.Release([email protected])
jump @Lift_StartLoop

Also, do you think you can help me with my cleo? my elevator starts from the top down, but this one only works down. When I'm down, it doesn't try to go up, it just stops.

I think I have put the coordinates wrong, but I can't find what it is.

Share this post


Link to post
Share on other sites
deltaCJ

Look at this file in the DATA folder in your directory:

 

VL2ij1H.png

 

And I mean these sets of opcodes:

4FnbhEa.png

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • 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.