Page 2 of 2 FirstFirst 1 2
Results 11 to 14 of 14

Thread: Scripting Help

  1. #11
    The Cake is a Lie. Jay2645's Avatar
    Join Date
    May 2007
    Posts
    1,661

    Re: Scripting Help

    1. I could have sworn the multi-teams vehicle worked the same way. I'll look it up.
    2. Look at it as a fancy way of getting in, like rolling over the hood of a car and jumping through the window instead of walking around, opening the door, and getting in that way.
    Reply With Quote

  2. #12

    Re: Scripting Help

    1. You have to continuously attach and detach the child/parent vehicles in order for it to be "enterable". I've been thinking about a better way to execute it, but I'm still fooling around with it.
    2. Still, your script is redundant.
    Reply With Quote

  3. #13
    The Cake is a Lie. Jay2645's Avatar
    Join Date
    May 2007
    Posts
    1,661

    Re: Scripting Help

    1. Ah, I see, thanks.
    2. Check my avatar quote.

    Also, I made a little hotfix, the script wasn't working in Sapien due to uneven parenthesis count, this one goes through fine, and has the Objects_attach and Objects_detach command CAD was just talking about. I'm still fixing the MP one, it's considerably longer then the SP one, so it may take a while.

    Hotfix:
    Code:
    (global short plyrnum 0)
    
    (script continuous increase_plyrnum
        (begin
            (set plyrnum (+ plyrnum 1))
        )
    )
    
    (script continuous reset_plyrnum
        (if
            (= (> plyrnum 15) true)
                (begin
                    (set plyrnum 0)
                )
        )
    )
    
    (script startup Jay_is_very_lazy
        (object_create_anew board1)
    )
    
    
    (script continuous no_random_collision
        (object_set_collideable board1 false)
    )
    
    (script continuous hijack_attaches
        (objects_attach ghostie1 "frame hull" board1 "frame hull")
        (objects_detach ghostie1 board1)
    )
    
    (script continuous hijack_Ghostie1_empty
        (sleep_until (if (vehicle_test_seat ghostie1 "driver" (unit (vehicle_driver ghostie1))) false))
        (sleep_until (if (vehicle_test_seat board1 "driver" (unit (list_get (players) 0))) true))
        (begin
            (object_cannot_take_damage Ghostie1)
            (camera_set_dead (unit (list_get (players) 0)))
            (unit_exit_vehicle (unit (vehicle_driver board1)))
            (vehicle_load_magic ghostie1 "driver" (unit (list_get (players) plyrnum)))
            (Camera_control 0)
            (object_can_take_damage Ghostie1)
        )
    )
    
    (script continuous hijack_Ghostie1_full
        (sleep_until (if (vehicle_test_seat ghostie1 "driver" (unit (vehicle_driver ghostie1))) true))
        (sleep_until (if (vehicle_test_seat board1 "driver" (unit (list_get (players) 0))) true))
        (begin
            (object_cannot_take_damage Ghostie1)
            (camera_set_dead (unit (list_get (players) 0)))
            (unit_exit_vehicle (unit (vehicle_driver board1)))
            (unit_exit_vehicle (unit (vehicle_driver ghostie1)))
            (vehicle_load_magic ghostie1 "driver" (unit (list_get (players) plyrnum)))
            (Camera_control 0)
            (object_can_take_damage Ghostie1)
        )
    )
    Last edited by Jay2645; September 3rd, 2007 at 04:39 AM.
    Reply With Quote

  4. #14
    The Cake is a Lie. Jay2645's Avatar
    Join Date
    May 2007
    Posts
    1,661

    Re: Scripting Help

    Mind the bump and double post, but I have the multiplayer hotfix. I will update this with the board vehicle and animations so you no longer have to make them, unless you want to improve on my sucky animations.
    Here's the hotfix:
    Code:
    (script startup Jay_is_very_lazy
        (object_create_anew board1)
    )
    
    
    (script continuous no_random_collision
        (object_set_collideable board1 false)
    )
    
    (script continuous hijack_attaches
        (objects_attach ghostie1 "frame hull" board1 "frame hull")
        (objects_detach ghostie1 board1)
    )
    
    (script continuous hijack_Ghostie1_empty_player0
        (sleep_until (if (vehicle_test_seat ghostie1 "driver" (unit (vehicle_driver ghostie1))) false))
        (sleep_until (if (vehicle_test_seat board1 "driver" (unit (list_get (players) 0))) true))
        (begin
            (unit_exit_vehicle (unit (vehicle_driver board1)))
            (vehicle_load_magic ghostie1 "driver" (unit (list_get (players) 0)))
        )
    )
    
    (script continuous hijack_Ghostie1_full_player0
        (sleep_until (if (vehicle_test_seat ghostie1 "driver" (unit (vehicle_driver ghostie1))) true))
        (sleep_until (if (vehicle_test_seat board1 "driver" (unit (list_get (players) 0))) true))
        (begin
            (unit_exit_vehicle (unit (vehicle_driver board1)))
            (unit_exit_vehicle (unit (vehicle_driver ghostie1)))
            (vehicle_load_magic ghostie1 "driver" (unit (list_get (players) 0)))
        )
    )
    
    (script continuous hijack_Ghostie1_empty_player1
        (sleep_until (if (vehicle_test_seat ghostie1 "driver" (unit (vehicle_driver ghostie1))) false))
        (sleep_until (if (vehicle_test_seat board1 "driver" (unit (list_get (players) 1))) true))
        (begin
            (unit_exit_vehicle (unit (vehicle_driver board1)))
            (vehicle_load_magic ghostie1 "driver" (unit (list_get (players) 1)))
        )
    )
    
    (script continuous hijack_Ghostie1_full_player1
        (sleep_until (if (vehicle_test_seat ghostie1 "driver" (unit (vehicle_driver ghostie1))) true))
        (sleep_until (if (vehicle_test_seat board1 "driver" (unit (list_get (players) 1))) true))
        (begin
            (unit_exit_vehicle (unit (vehicle_driver board1)))
            (unit_exit_vehicle (unit (vehicle_driver ghostie1)))
            (vehicle_load_magic ghostie1 "driver" (unit (list_get (players) 1)))
        )
    )
    
    (script continuous hijack_Ghostie1_empty_player2
        (sleep_until (if (vehicle_test_seat ghostie1 "driver" (unit (vehicle_driver ghostie1))) false))
        (sleep_until (if (vehicle_test_seat board1 "driver" (unit (list_get (players) 2))) true))
        (begin
            (unit_exit_vehicle (unit (vehicle_driver board1)))
            (vehicle_load_magic ghostie1 "driver" (unit (list_get (players) 2)))
        )
    )
    
    (script continuous hijack_Ghostie1_full_player2
        (sleep_until (if (vehicle_test_seat ghostie1 "driver" (unit (vehicle_driver ghostie1))) true))
        (sleep_until (if (vehicle_test_seat board1 "driver" (unit (list_get (players) 2))) true))
        (begin
            (unit_exit_vehicle (unit (vehicle_driver board1)))
            (unit_exit_vehicle (unit (vehicle_driver ghostie1)))
            (vehicle_load_magic ghostie1 "driver" (unit (list_get (players) 2)))
        )
    )
    
    (script continuous hijack_Ghostie1_empty_player3
        (sleep_until (if (vehicle_test_seat ghostie1 "driver" (unit (vehicle_driver ghostie1))) false))
        (sleep_until (if (vehicle_test_seat board1 "driver" (unit (list_get (players) 3))) true))
        (begin
            (unit_exit_vehicle (unit (vehicle_driver board1)))
            (vehicle_load_magic ghostie1 "driver" (unit (list_get (players) 3)))
        )
    )
    
    (script continuous hijack_Ghostie1_full_player3
        (sleep_until (if (vehicle_test_seat ghostie1 "driver" (unit (vehicle_driver ghostie1))) true))
        (sleep_until (if (vehicle_test_seat board1 "driver" (unit (list_get (players) 3))) true))
        (begin
            (unit_exit_vehicle (unit (vehicle_driver board1)))
            (unit_exit_vehicle (unit (vehicle_driver ghostie1)))
            (vehicle_load_magic ghostie1 "driver" (unit (list_get (players) 3)))
        )
    )
    
    (script continuous hijack_Ghostie1_empty_player4
        (sleep_until (if (vehicle_test_seat ghostie1 "driver" (unit (vehicle_driver ghostie1))) false))
        (sleep_until (if (vehicle_test_seat board1 "driver" (unit (list_get (players) 4))) true))
        (begin
            (unit_exit_vehicle (unit (vehicle_driver board1)))
            (vehicle_load_magic ghostie1 "driver" (unit (list_get (players) 4)))
        )
    )
    
    (script continuous hijack_Ghostie1_full_player4
        (sleep_until (if (vehicle_test_seat ghostie1 "driver" (unit (vehicle_driver ghostie1))) true))
        (sleep_until (if (vehicle_test_seat board1 "driver" (unit (list_get (players) 4))) true))
        (begin
            (unit_exit_vehicle (unit (vehicle_driver board1)))
            (unit_exit_vehicle (unit (vehicle_driver ghostie1)))
            (vehicle_load_magic ghostie1 "driver" (unit (list_get (players) 4)))
        )
    )
    
    (script continuous hijack_Ghostie1_empty_player5
        (sleep_until (if (vehicle_test_seat ghostie1 "driver" (unit (vehicle_driver ghostie1))) false))
        (sleep_until (if (vehicle_test_seat board1 "driver" (unit (list_get (players) 5))) true))
        (begin
            (unit_exit_vehicle (unit (vehicle_driver board1)))
            (vehicle_load_magic ghostie1 "driver" (unit (list_get (players) 5)))
        )
    )
    
    (script continuous hijack_Ghostie1_full_player5
        (sleep_until (if (vehicle_test_seat ghostie1 "driver" (unit (vehicle_driver ghostie1))) true))
        (sleep_until (if (vehicle_test_seat board1 "driver" (unit (list_get (players) 5))) true))
        (begin
            (unit_exit_vehicle (unit (vehicle_driver board1)))
            (unit_exit_vehicle (unit (vehicle_driver ghostie1)))
            (vehicle_load_magic ghostie1 "driver" (unit (list_get (players) 5)))
        )
    )
    
    (script continuous hijack_Ghostie1_empty_player6
        (sleep_until (if (vehicle_test_seat ghostie1 "driver" (unit (vehicle_driver ghostie1))) false))
        (sleep_until (if (vehicle_test_seat board1 "driver" (unit (list_get (players) 6))) true))
        (begin
            (unit_exit_vehicle (unit (vehicle_driver board1)))
            (vehicle_load_magic ghostie1 "driver" (unit (list_get (players) 6)))
        )
    )
    
    (script continuous hijack_Ghostie1_full_player6
        (sleep_until (if (vehicle_test_seat ghostie1 "driver" (unit (vehicle_driver ghostie1))) true))
        (sleep_until (if (vehicle_test_seat board1 "driver" (unit (list_get (players) 6))) true))
        (begin
            (unit_exit_vehicle (unit (vehicle_driver board1)))
            (unit_exit_vehicle (unit (vehicle_driver ghostie1)))
            (vehicle_load_magic ghostie1 "driver" (unit (list_get (players) 6)))
        )
    )
    
    (script continuous hijack_Ghostie1_empty_player7
        (sleep_until (if (vehicle_test_seat ghostie1 "driver" (unit (vehicle_driver ghostie1))) false))
        (sleep_until (if (vehicle_test_seat board1 "driver" (unit (list_get (players) 7))) true))
        (begin
            (unit_exit_vehicle (unit (vehicle_driver board1)))
            (vehicle_load_magic ghostie1 "driver" (unit (list_get (players) 7)))
        )
    )
    
    (script continuous hijack_Ghostie1_full_player7
        (sleep_until (if (vehicle_test_seat ghostie1 "driver" (unit (vehicle_driver ghostie1))) true))
        (sleep_until (if (vehicle_test_seat board1 "driver" (unit (list_get (players) 7))) true))
        (begin
            (unit_exit_vehicle (unit (vehicle_driver board1)))
            (unit_exit_vehicle (unit (vehicle_driver ghostie1)))
            (vehicle_load_magic ghostie1 "driver" (unit (list_get (players) 7)))
        )
    )
    
    (script continuous hijack_Ghostie1_empty_player8
        (sleep_until (if (vehicle_test_seat ghostie1 "driver" (unit (vehicle_driver ghostie1))) false))
        (sleep_until (if (vehicle_test_seat board1 "driver" (unit (list_get (players) 8))) true))
        (begin
            (unit_exit_vehicle (unit (vehicle_driver board1)))
            (vehicle_load_magic ghostie1 "driver" (unit (list_get (players) 8)))
        )
    )
    
    (script continuous hijack_Ghostie1_full_player8
        (sleep_until (if (vehicle_test_seat ghostie1 "driver" (unit (vehicle_driver ghostie1))) true))
        (sleep_until (if (vehicle_test_seat board1 "driver" (unit (list_get (players) 8))) true))
        (begin
            (unit_exit_vehicle (unit (vehicle_driver board1)))
            (unit_exit_vehicle (unit (vehicle_driver ghostie1)))
            (vehicle_load_magic ghostie1 "driver" (unit (list_get (players) 8)))
        )
    )
    
    (script continuous hijack_Ghostie1_empty_player9
        (sleep_until (if (vehicle_test_seat ghostie1 "driver" (unit (vehicle_driver ghostie1))) false))
        (sleep_until (if (vehicle_test_seat board1 "driver" (unit (list_get (players) 9))) true))
        (begin
            (unit_exit_vehicle (unit (vehicle_driver board1)))
            (vehicle_load_magic ghostie1 "driver" (unit (list_get (players) 9)))
        )
    )
    
    (script continuous hijack_Ghostie1_full_player9
        (sleep_until (if (vehicle_test_seat ghostie1 "driver" (unit (vehicle_driver ghostie1))) true))
        (sleep_until (if (vehicle_test_seat board1 "driver" (unit (list_get (players) 9))) true))
        (begin
            (unit_exit_vehicle (unit (vehicle_driver board1)))
            (unit_exit_vehicle (unit (vehicle_driver ghostie1)))
            (vehicle_load_magic ghostie1 "driver" (unit (list_get (players) 9)))
        )
    )
    
    (script continuous hijack_Ghostie1_empty_player10
        (sleep_until (if (vehicle_test_seat ghostie1 "driver" (unit (vehicle_driver ghostie1))) false))
        (sleep_until (if (vehicle_test_seat board1 "driver" (unit (list_get (players) 10))) true))
        (begin
            (unit_exit_vehicle (unit (vehicle_driver board1)))
            (vehicle_load_magic ghostie1 "driver" (unit (list_get (players) 10)))
        )
    )
    
    (script continuous hijack_Ghostie1_full_player10
        (sleep_until (if (vehicle_test_seat ghostie1 "driver" (unit (vehicle_driver ghostie1))) true))
        (sleep_until (if (vehicle_test_seat board1 "driver" (unit (list_get (players) 10))) true))
        (begin
            (unit_exit_vehicle (unit (vehicle_driver board1)))
            (unit_exit_vehicle (unit (vehicle_driver ghostie1)))
            (vehicle_load_magic ghostie1 "driver" (unit (list_get (players) 10)))
        )
    )
    
    (script continuous hijack_Ghostie1_empty_player11
        (sleep_until (if (vehicle_test_seat ghostie1 "driver" (unit (vehicle_driver ghostie1))) false))
        (sleep_until (if (vehicle_test_seat board1 "driver" (unit (list_get (players) 11))) true))
        (begin
            (unit_exit_vehicle (unit (vehicle_driver board1)))
            (vehicle_load_magic ghostie1 "driver" (unit (list_get (players) 11)))
        )
    )
    
    (script continuous hijack_Ghostie1_full_player11
        (sleep_until (if (vehicle_test_seat ghostie1 "driver" (unit (vehicle_driver ghostie1))) true))
        (sleep_until (if (vehicle_test_seat board1 "driver" (unit (list_get (players) 11))) true))
        (begin
            (unit_exit_vehicle (unit (vehicle_driver board1)))
            (unit_exit_vehicle (unit (vehicle_driver ghostie1)))
            (vehicle_load_magic ghostie1 "driver" (unit (list_get (players) 11)))
        )
    )
    
    (script continuous hijack_Ghostie1_empty_player12
        (sleep_until (if (vehicle_test_seat ghostie1 "driver" (unit (vehicle_driver ghostie1))) false))
        (sleep_until (if (vehicle_test_seat board1 "driver" (unit (list_get (players) 12))) true))
        (begin
            (unit_exit_vehicle (unit (vehicle_driver board1)))
            (vehicle_load_magic ghostie1 "driver" (unit (list_get (players) 12)))
        )
    )
    
    (script continuous hijack_Ghostie1_full_player12
        (sleep_until (if (vehicle_test_seat ghostie1 "driver" (unit (vehicle_driver ghostie1))) true))
        (sleep_until (if (vehicle_test_seat board1 "driver" (unit (list_get (players) 12))) true))
        (begin
            (unit_exit_vehicle (unit (vehicle_driver board1)))
            (unit_exit_vehicle (unit (vehicle_driver ghostie1)))
            (vehicle_load_magic ghostie1 "driver" (unit (list_get (players) 12)))
        )
    )
    
    (script continuous hijack_Ghostie1_empty_player13
        (sleep_until (if (vehicle_test_seat ghostie1 "driver" (unit (vehicle_driver ghostie1))) false))
        (sleep_until (if (vehicle_test_seat board1 "driver" (unit (list_get (players) 13))) true))
        (begin
            (unit_exit_vehicle (unit (vehicle_driver board1)))
            (vehicle_load_magic ghostie1 "driver" (unit (list_get (players) 13)))
        )
    )
    
    (script continuous hijack_Ghostie1_full_player13
        (sleep_until (if (vehicle_test_seat ghostie1 "driver" (unit (vehicle_driver ghostie1))) true))
        (sleep_until (if (vehicle_test_seat board1 "driver" (unit (list_get (players) 13))) true))
        (begin
            (unit_exit_vehicle (unit (vehicle_driver board1)))
            (unit_exit_vehicle (unit (vehicle_driver ghostie1)))
            (vehicle_load_magic ghostie1 "driver" (unit (list_get (players) 13)))
        )
    )
    
    (script continuous hijack_Ghostie1_empty_player14
        (sleep_until (if (vehicle_test_seat ghostie1 "driver" (unit (vehicle_driver ghostie1))) false))
        (sleep_until (if (vehicle_test_seat board1 "driver" (unit (list_get (players) 14))) true))
        (begin
            (unit_exit_vehicle (unit (vehicle_driver board1)))
            (vehicle_load_magic ghostie1 "driver" (unit (list_get (players) 14)))
        )
    )
    
    (script continuous hijack_Ghostie1_full_player14
        (sleep_until (if (vehicle_test_seat ghostie1 "driver" (unit (vehicle_driver ghostie1))) true))
        (sleep_until (if (vehicle_test_seat board1 "driver" (unit (list_get (players) 14))) true))
        (begin
            (unit_exit_vehicle (unit (vehicle_driver board1)))
            (unit_exit_vehicle (unit (vehicle_driver ghostie1)))
            (vehicle_load_magic ghostie1 "driver" (unit (list_get (players) 14)))
        )
    )
    
    (script continuous hijack_Ghostie1_empty_player15
        (sleep_until (if (vehicle_test_seat ghostie1 "driver" (unit (vehicle_driver ghostie1))) false))
        (sleep_until (if (vehicle_test_seat board1 "driver" (unit (list_get (players) 15))) true))
        (begin
            (unit_exit_vehicle (unit (vehicle_driver board1)))
            (vehicle_load_magic ghostie1 "driver" (unit (list_get (players) 15)))
        )
    )
    
    (script continuous hijack_Ghostie1_full_player15
        (sleep_until (if (vehicle_test_seat ghostie1 "driver" (unit (vehicle_driver ghostie1))) true))
        (sleep_until (if (vehicle_test_seat board1 "driver" (unit (list_get (players) 15))) true))
        (begin
            (unit_exit_vehicle (unit (vehicle_driver board1)))
            (unit_exit_vehicle (unit (vehicle_driver ghostie1)))
            (vehicle_load_magic ghostie1 "driver" (unit (list_get (players) 15)))
        )
    )
    Reply With Quote

Thread Information

Users Browsing this Thread

There are currently 2 users browsing this thread. (0 members and 2 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •