+ Reply to Thread
Page 5 of 6 FirstFirst ... 3 4 5 6 LastLast
Results 41 to 50 of 55

Thread: [SCRIPTS] Few tele things, and Wizard Magic scripts

  1. #41

    Re: [SCRIPTS] Few tele things, and Wizard Magic scripts

    Quote Originally Posted by Kirby_422 View Post
    So, you mean where you attach the .scenario_hs_source, and where you can read the script directly in the scenario? sapien updates the scenario with the contents of the hs_sources when you open it, but tool will always compile the hs_source into the final map since you may of changed it, etc. This is one thing I like about H2, I dont have to use sapien to add scripts, tool will do it for me.. now if only hs_source would be edited in notepad while still being considered valid.. (you can open it, and see the script, but there is a area to handle the checksum or something)


    Sounds similar to my experiance where the camera stayed at 0,0,0. Any clue about the origins in your BSP? Anyways, the camera will only show up on the host computer, is this cutscene a big thing for your map? cause it might be best to leave it out as only the host can see it anyways even if you perfect it.
    Nah I was just doing random tests, I had the exact same thing happen to me in h2x a couple of years ago. I even used zanzibar which still had the camera placements from taht one multiplayer demo


    Edit scriptors add me on aim! leorimolo

    Edit 2:
    Code:
    (script static unit player0
      (unit (list_get (players) 0)))
    (script dormant awesomesauce
     (sleep_until
      (begin
       
       (sleep_until
        (if
         (and
          (not (unit_has_weapon_readied (unit (player0)) "objects\weapons\support_high\rocket_launcher\rocket_launcher.weapon"))
          (unit_has_weapon (unit (player0)) "objects\weapons\support_high\rocket_launcher\rocket_launcher.weapon")
         )
         
         ; Condition met, return true 
         (= 1 1)
         
         ; Condition not met, reset player actions and return false
         (begin
          (objects_detach (unit (player0)) rock)
                                                    (= 1 0)
         )
        )
    ;600
        1
       )
       
       (objects_attach (unit (player0)) "back_pack" rock "")
       
       ; Sleep until the player has removed weap from back
       (sleep_until
        
        (and
         (unit_has_weapon_readied (unit (player0)) "objects\weapons\support_high\rocket_launcher\rocket_launcher.weapon")
         (unit_has_weapon (unit (player0)) "objects\weapons\support_high\rocket_launcher\rocket_launcher.weapon")
                                    )
        1
       )
       
       (objects_detach (unit (player0)) rock)
       
      false)
      1
     )
    )
    (script startup turnshiton
    (wake awesomesauce)
    )
    Leaving this one here, it was the one they used to enable invisibility in MP games, basically I just modified it to use it as a backpack weap script...
    Last edited by leorimolo; July 4th, 2011 at 04:44 PM.
    Reply With Quote

  2. #42
    The mind is the limit. Garanas's Avatar
    Join Date
    Mar 2011
    Location
    Netherlands
    Posts
    18
    Garanas is on a distinguished road

    Re: [SCRIPTS] Few tele things, and Wizard Magic scripts

    Mmhh, maybe you shouldn't be so fast about the data_mine_enable command, you should try to test it online, to see if it synchronises. Just because it doesn't make a file there, doesn't mean it isn't saved in a default file

    Everything should be checked!
    Reply With Quote

  3. #43
    HCE Information Library Kirby_422's Avatar
    Join Date
    Dec 2006
    Location
    Vernon, BC, Canada
    Posts
    105
    Kirby_422 is on a distinguished road

    Re: [SCRIPTS] Few tele things, and Wizard Magic scripts

    Quote Originally Posted by Garanas View Post
    Mmhh, maybe you shouldn't be so fast about the data_mine_enable command, you should try to test it online, to see if it synchronises. Just because it doesn't make a file there, doesn't mean it isn't saved in a default file

    Everything should be checked!
    ... So what do you think is being synced in it storing debug data?...... (you do realize how strange that sounds, right?..) And if there is no file, then there is no need for it. its debug stuff, you have to directly tell it to upload to a debug server in the commands if you want it to be shared with anything, but what its sending to is still a debug server.

    Code:
    (data_mine_set_mission_segment <string>)
    sets the mission segment for single player data mine events
    
    
    
    (data_mine_display_mission_segment <boolean>)
    display the current mission segment
    
    
    
    (data_mine_insert <string>)
    insert text and camera position in the data mine
    
    
    
    (data_mine_upload)
    upload all data mining data files to debug server
    
    
    
    (data_mine_playback <string>)
    loads and displays data mine data from a file
    
    
    
    (data_mine_playback_last)
    loads and displays last data mine data
    
    
    
    (data_mine_playback_exit)
    exit data visualization
    
    
    
    (data_mine_enable <boolean>)
    enable/disable data mining
    
    
    
    (data_mine_track_event <string>)
    enable mining of an event
    
    
    
    (data_mine_display_event <string>)
    enable displaying of an event
    
    
    
    (data_mine_show_all_events)
    show all data mine events
    
    
    
    (data_mine_show_tracked_events)
    show what events are being tracked by the data mine
    
    
    
    (data_mine_show_displayed_events)
    show what events are being displayed by the data mine
    
    
    
    (data_mine_display_session_data)
    show data mine session, game, and network ids
    
    
    
    (data_mine_display_disk_writes <boolean>)
    enable/disable console message on disk writes
    
    
    
    (data_mine_debug_menu_setting <string>)
    close debug menu and set user experience setting to string
    
    
    
    (data_mine_open_debug_menu)
    open debug menu

    KIRABOSHI!
    Reply With Quote

  4. #44

    Re: [SCRIPTS] Few tele things, and Wizard Magic scripts

    Code:
    ;matt's global scripts
    
    (script static unit player0
      (unit (list_get (players) 0)))
    
    (script static unit player1
      (unit (list_get (players) 1)))
      
    (script static short player_count
      (list_count (players)))
    
    (script static void end_segment
    	(camera_control TRUE)
    	(cinematic_start)
    	(fade_out 0 0 0 15)
    	(sleep 30)
    	(print "End gameplay segment!  Thank you for playing!")
    	(sleep 15)
    	(print "Grab Jaime or Paul to give feedback!")
    	(player_action_test_reset)
    	(sleep 15)
    	(print "Press the ?A? button to reset!")
    	(sleep_until (player_action_test_accept))
    	(print "Reloading map...")
    	(sleep 15)
    	(map_reset)
    )
    
    ; Globals
    (global string data_mine_mission_segment "")
    
    
    ; Difficulty level scripts
    (script static boolean difficulty_legendary
    	(= (game_difficulty_get) legendary)
    )
    
    (script static boolean difficulty_heroic
    	(= (game_difficulty_get) heroic)
    )
    
    (script static boolean difficulty_normal
    	(= (game_difficulty_get) normal)
    )
    
    
    ; Cutscene skip hacks live again
    ; Yuck... at least I understand it now
    (script static boolean cinematic_skip_start
    	(cinematic_skip_start_internal)		; Listen for the button which reverts (skips)
    	(game_save_cinematic_skip)			; Save the game state
    	(sleep_until (not (game_saving)) 1)	; Sleep until the game is done saving
    	(not (game_reverted))				; Return whether or not the game has been reverted
    )
    
    
    (script static void cinematic_skip_stop
    	(cinematic_skip_stop_internal)		; Stop listening for the button
    	(if (not (game_reverted)) (game_revert))	; If the player did not revert, do it for him
    )
    
    
    ; Cinematic fade scripts
    (script static void cinematic_fade_to_white
    	; Kill player control
    	(player_enable_input false)
    	(player_camera_control false)
    
    	; Fade out
    	(hud_cinematic_fade 0 0.5) ; pbertone 9/23 
    	(cinematic_start) ; pbertone 9/23 
    	(fade_out 1 1 1 30) ; pbertone - changed from 15 to 30 (9/23) 
    	(sleep 30) ; pbertone - changed from 15 to 30 (9/23) 
    	; Edit sound channels, other stuff here
    ;	(cinematic_start)
    	(camera_control on)
    )
    
    (script static void cinematic_fade_from_white
    	(hud_cinematic_fade 1 0.5)
    	(cinematic_stop)
    	; Edit sound channels, other stuff here
    	(camera_control off)
    	(fade_in 1 1 1 15)
    	(sleep 15)
    
    	; Restore player control
    	(player_enable_input true)
    	(player_camera_control true)
    )
    
    (script static void cinematic_fade_from_white_bars
    	(cinematic_stop)
    	(cinematic_show_letterbox_immediate true) ; But keep the letterbox up
    	; Edit sound channels, other stuff here
    	(camera_control off)
    	(fade_in 1 1 1 15)
    	(sleep 15)
    
    	; Restore player control
    	(player_enable_input true)
    	(player_camera_control true)
    )
    
    (script static void cinematic_fade_from_black_bars
    	(cinematic_stop)
    	(cinematic_show_letterbox_immediate true) ; But keep the letterbox up
    	; Edit sound channels, other stuff here
    	(camera_control off)
    	(fade_in 0 0 0 15)
    	(sleep 15)
    
    	; Restore player control
    	(player_enable_input true)
    	(player_camera_control true)
    )
    
    (script static void cinematic_fade_to_black
    	; Kill player control
    	(player_enable_input false)
    	(player_camera_control false)
    
    	; Fade out
    	(hud_cinematic_fade 0 0.5) ; pbertone 9/23 
    	(cinematic_start) ; pbertone 9/23 
    	(fade_out 0 0 0 30) ; pbertone - changed from 15 to 30 (9/23) 
    	(sleep 30) ; pbertone - changed from 15 to 30 (9/23) 
    	; Edit sound channels, other stuff here
    ;	(hud_cinematic_fade 0 0.5)
    ;	(cinematic_start)
    	(camera_control on)
    )
    
    (script static void cinematic_fade_from_black
    	(hud_cinematic_fade 1 0.5)
    	(cinematic_stop)
    	; Edit sound channels, other stuff here
    	(camera_control off)
    	(fade_in 0 0 0 15)
    	(sleep 15)
    
    	; Restore player control
    	(player_enable_input true)
    	(player_camera_control true)
    )
    
    (script static void cinematic_snap_to_black
    	; Kill player control
    	(player_enable_input false)
    	(player_camera_control false)
    
    	(fade_out 0 0 0 0)
    	; Edit sound channels, other stuff here
    	(hud_cinematic_fade 0 0)
    	(cinematic_start)
    	(cinematic_show_letterbox_immediate true)
    	(camera_control on)
    )
    
    (script static void cinematic_snap_to_white
    	; Kill player control
    	(player_enable_input false)
    	(player_camera_control false)
    
    	(fade_out 1 1 1 0)
    	; Edit sound channels, other stuff here
    	(hud_cinematic_fade 0 0)
    	(cinematic_start)
    	(cinematic_show_letterbox_immediate true)
    	(camera_control on)
    )
    
    ; Stashing mockups
    (script static void cinematic_stash_players
    	(object_hide (player0) true)
    	(object_hide (player1) true)
    	(object_cannot_take_damage (players))
    )
    
    (script static void cinematic_unstash_players
    	(object_hide (player0) false)
    	(object_hide (player1) false)
    	(object_can_take_damage (players))
    )
    
    
    ;- STEALTH
    ; Whee, horrible horrible. I can't wait to remove this
    
    (script dormant _stealth_toggle_monitor
    	(sleep_until
    		(begin
    			
    			(sleep_until
    				(if
    					(and
    						(not (unit_has_weapon_readied (unit (player0)) "objects\weapons\support_high\rocket_launcher\rocket_launcher.weapon"))
    						(unit_has_weapon (unit (player0)) "objects\weapons\support_high\rocket_launcher\rocket_launcher.weapon")
    					)
    					
    					; Condition met, return true 
    					(= 1 1)
    					
    					; Condition not met, reset player actions and return false
    					(begin
    						(objects_detach (unit (player0)) rock)
    					)
    				)
    				1
    			)
    			
    			(objects_attach (unit (player0)) "back_pack" rock "")
    			
    			; Sleep until the player has disengaged, or been damaged
    			(sleep_until
    				
    				
    					(unit_has_weapon_readied (unit (player0)) "objects\weapons\support_high\rocket_launcher\rocket_launcher.weapon"))
    					(unit_has_weapon (unit (player0)) "objects\weapons\support_high\rocket_launcher\rocket_launcher.weapon")
    				)
    				1
    
    			)
    			
    			(objects_detach (unit (player0)) rock)
    			
    			
    		
    		false)
    		1
    	)
    )
    
    (script dormant _stealth_timer_monitor
    	(sleep_until
    		(begin
    			; Sleep until the button has been pressed
    			(sleep_until
    				(if
    ;					(and
    ;						(>= (unit_get_shield (player0)) 1.0)
    						(player_action_test_vision_trigger)
    ;					)
    					
    					; Condition met, return true 
    					(= 1 1)
    					
    					; Condition not met, reset player actions and return false
    					(begin
    						(player_action_test_reset)
    						(= 1 0)
    					)
    				)
    				1
    			)
    			
    			; Activate stealth
    			(cheat_active_camouflage_by_player 0 true)
    			(print "stealth engaged")
    			
    			; Drain health
    ;			(unit_set_maximum_vitality (player0) 50 0)
    ;			(unit_set_current_vitality (player0) 50 0)
    ;			(object_set_shield (player0) 0.0)
    			
    			; Sleep until fully stealthed (right now, it's 3-4 seconds)
    			(sleep 15)
    			
    			; Reset the test
    			(player_action_test_reset)
    			
    			; Sleep until the player has disengaged, attacks, or been damaged
    			(sleep_until
    				(or
    					(player_action_test_vision_trigger)
    					(player_action_test_primary_trigger)
    					(player_action_test_grenade_trigger)
    					(player_action_test_melee)
    				)
    				1
    				(* 9 30)
    			)
    
    			; Disengage
    			(cheat_active_camouflage_by_player 0 false)
    			(print "stealth disengaged")
    			
    			; Drain health
    ;			(unit_set_maximum_vitality (player0) 30 70)
    ;			(object_set_shield (player0) 0.0)
    		
    			; Sleep for a second
    			(sleep 30)
    			
    			; Reset the test
    			(player_action_test_reset)
    			
    			; cooldown for 15 seconds 
    			(sleep_until
    				(begin
    					(print "+")
    					false
    				)
    				30
    				(* 5 30) 
    			)
    			
    			; Return false to continue looping
    			false
    		)
    		1
    	)
    )
    
    
    (script static void activate_stealth_toggle_monitor
    	(sleep 1)
    ;	(wake _stealth_toggle_monitor)
    )
    
    (script static void activate_stealth_timer_monitor
    	(sleep 1)
    ;	(wake _stealth_timer_monitor)
    )
    
    ;========== PLAYTEST SCRIPTS ==========;Delete this before shipping
    (script static void playtest_mission
    	(if
    		(game_is_playtest)
    		(begin
    			(sleep 30)
    			(hud_set_training_text playtest_raisehand)
    			(hud_show_training_text 1)
    			(player_action_test_reset)
    			(sleep_until (player_action_test_accept) 1)
    			(hud_show_training_text 0)
    			(sleep 30)
    		)
    	)
    )


    Those are the scripts from zanzibar.
    this is the interesting parts which would agree with what Garanas said...
    Code:
    ; Globals
    (global string data_mine_mission_segment "")
    
    
    ; Difficulty level scripts
    (script static boolean difficulty_legendary
    	(= (game_difficulty_get) legendary)
    )
    
    (script static boolean difficulty_heroic
    	(= (game_difficulty_get) heroic)
    )
    
    (script static boolean difficulty_normal
    	(= (game_difficulty_get) normal)
    )
    
    
    ; Cutscene skip hacks live again
    ; Yuck... at least I understand it now
    (script static boolean cinematic_skip_start
    	(cinematic_skip_start_internal)		; Listen for the button which reverts (skips)
    	(game_save_cinematic_skip)			; Save the game state
    	(sleep_until (not (game_saving)) 1)	; Sleep until the game is done saving
    	(not (game_reverted))				; Return whether or not the game has been reverted
    )
    
    
    (script static void cinematic_skip_stop
    	(cinematic_skip_stop_internal)		; Stop listening for the button
    	(if (not (game_reverted)) (game_revert))	; If the player did not revert, do it for him
    )
    
    
    ; Cinematic fade scripts
    (script static void cinematic_fade_to_white
    	; Kill player control
    	(player_enable_input false)
    	(player_camera_control false)
    
    	; Fade out
    	(hud_cinematic_fade 0 0.5) ; pbertone 9/23 
    	(cinematic_start) ; pbertone 9/23 
    	(fade_out 1 1 1 30) ; pbertone - changed from 15 to 30 (9/23) 
    	(sleep 30) ; pbertone - changed from 15 to 30 (9/23) 
    	; Edit sound channels, other stuff here
    ;	(cinematic_start)
    	(camera_control on)
    Reply With Quote

  5. #45
    Kid in the Hall Kornman00's Avatar
    Join Date
    Sep 2006
    Location
    ◕‿◕, ┌( ಠ_ಠ)┘
    Posts
    3,116
    Blog Entries
    1
    Kornman00 has a reputation beyond repute Kornman00 has a reputation beyond repute Kornman00 has a reputation beyond repute Kornman00 has a reputation beyond repute Kornman00 has a reputation beyond repute Kornman00 has a reputation beyond repute Kornman00 has a reputation beyond repute Kornman00 has a reputation beyond repute Kornman00 has a reputation beyond repute Kornman00 has a reputation beyond repute Kornman00 has a reputation beyond repute

    Re: [SCRIPTS] Few tele things, and Wizard Magic scripts

    The data mining stuff has nothing to do with any of the things you guys are trying to accomplish. Not only that, but such debug functions aren't even present in the game.

    Reply With Quote

  6. #46
    HCE Information Library Kirby_422's Avatar
    Join Date
    Dec 2006
    Location
    Vernon, BC, Canada
    Posts
    105
    Kirby_422 is on a distinguished road

    Re: [SCRIPTS] Few tele things, and Wizard Magic scripts

    Hes trying to accomplish something with it? And I kinda guessed about the debug after that test I did with all the dumping functions, with no files being made, nor it crashing when I ran the one that hs_doc insisted would get someone fired.
    Code:
    (reset_dsp_image)
    if we ever need to use this someone is getting fired
    I really wanted to run that code to see what was so horrible about it.. oh well.


    Anyways, lets explain player identification stuff for in scripts:

    We don't have anything yet to identify specific players preforming certain actions to call scripts on like HCE... There is a few methods we may be able to try to dealing with this, but none of them sound that good.. First method would be that when an action_test for melee happens, quickly toss bipeds infront of everyone and see whose dies. This effectively removes the ability to melee, aswell as may not be accurate as an explosion or vehicle could be about to hit someone during that time. Another method would be weapon readied, to see if they have some secondary weapon out (used only to identify when they want to activate a script) and the problem there is we cant forcibly change their weapon back over to their other one without reseting their ammo and such, so they have to know to do it on their own. Next is grenade count, replace grenades with script activation. Last I can think of at this moment is constantly attaching and detaching vehicles to the player, and if they enter that, activate a script.. problem there is that it makes it alot harder to pickup weapons or enter other vehicles then.

    KIRABOSHI!
    Reply With Quote

  7. #47

    Re: [SCRIPTS] Few tele things, and Wizard Magic scripts

    Got it working!
    Code:
    (script startup cinematic_fade_to_white
    
    	; Kill player control
    	(player_enable_input false)
    	(player_camera_control false)
    
    	; Fade out
    	(cinematic_start) ; pbertone 9/23 
    	(sleep 30) ; pbertone - changed from 15 to 30 (9/23) 
    	; Edit sound channels, other stuff here
    	(cinematic_start)
    	(camera_control on)
            (cinematic_outro_start)
    	(set cinematic_letterbox_style 1)
    	(camera_set_field_of_view 60 0)
    (camera_set cam 1000) ;the 1000 is the time the camera takes to go from yourplayer to the point
    
    
    
    )
    Last edited by leorimolo; July 5th, 2011 at 12:14 PM. Reason: Removing begin tabs to avoid kornman flipping out
    Reply With Quote

  8. #48
    HCE Information Library Kirby_422's Avatar
    Join Date
    Dec 2006
    Location
    Vernon, BC, Canada
    Posts
    105
    Kirby_422 is on a distinguished road

    Re: [SCRIPTS] Few tele things, and Wizard Magic scripts

    Quote Originally Posted by Kirby_422 View Post
    Anyways, lets explain player identification stuff for in scripts:

    We don't have anything yet to identify specific players preforming certain actions to call scripts on like HCE... There is a few methods we may be able to try to dealing with this, but none of them sound that good.. First method would be that when an action_test for melee happens, quickly toss bipeds infront of everyone and see whose dies. This effectively removes the ability to melee, aswell as may not be accurate as an explosion or vehicle could be about to hit someone during that time. Another method would be weapon readied, to see if they have some secondary weapon out (used only to identify when they want to activate a script) and the problem there is we cant forcibly change their weapon back over to their other one without reseting their ammo and such, so they have to know to do it on their own. Next is grenade count, replace grenades with script activation. Last I can think of at this moment is constantly attaching and detaching vehicles to the player, and if they enter that, activate a script.. problem there is that it makes it alot harder to pickup weapons or enter other vehicles then.
    Ended up doing the bold one.
    Code:
    (sleep_until (player_action_test_rotate_weapons) 1)
    (player_action_test_reset)
    (sleep 10)
    (if (unit_has_weapon_readied (player) "objects\weapons\melee\energy_blade\energy_blade")
    (begin
    <otherstuff>
    ))
    (you need your player static script) This basically makes it so if you change to your other weapon, which in this example is energy sword, it activates the <otherstuff> Biggest problem here is that anytime anyone changes to their secondary weapon, if you have your activator weapon out, it will do your script (so if you dont want people using your commands, put it away) this seems like the overall best method.

    and rider_ejection is removed in H2.

    KIRABOSHI!
    Reply With Quote

  9. #49
    HCE Information Library Kirby_422's Avatar
    Join Date
    Dec 2006
    Location
    Vernon, BC, Canada
    Posts
    105
    Kirby_422 is on a distinguished road

    Re: [SCRIPTS] Few tele things, and Wizard Magic scripts

    Bad news everyone! Your script sizes are severely crippled in H2! So, today making a test map, I tossed one of my HCE scripts over.. Saved the file, told tool to compile. Strangely enough, tool says its unmatched.. I knew this isn't true as it is used in HCE fine. I open the file again... it chopped 3/4ths of the script off. Try pasting again, click save.. I watch the scroll bar shrink instantly as I click save. You know where in guerilla, it lists source bytes? Scripts cannot exceed 4098 bytes, anything beyond that is deleted.

    Today has probably been the most disappointing birthday ever (not just this, other things have happened too)

    KIRABOSHI!
    Reply With Quote

  10. #50
    Kid in the Hall Kornman00's Avatar
    Join Date
    Sep 2006
    Location
    ◕‿◕, ┌( ಠ_ಠ)┘
    Posts
    3,116
    Blog Entries
    1
    Kornman00 has a reputation beyond repute Kornman00 has a reputation beyond repute Kornman00 has a reputation beyond repute Kornman00 has a reputation beyond repute Kornman00 has a reputation beyond repute Kornman00 has a reputation beyond repute Kornman00 has a reputation beyond repute Kornman00 has a reputation beyond repute Kornman00 has a reputation beyond repute Kornman00 has a reputation beyond repute Kornman00 has a reputation beyond repute

    Re: [SCRIPTS] Few tele things, and Wizard Magic scripts

    In scenario_hs_source_file, you can have a total of 8 files, each of which cannot exceed 262144 bytes. That's a total of 2MB of source if you play your cards right. I'd hardly call that "crippled" (also, those same definitions are used in the scenario itself). The only real limiter is in the syntax nodes block, which can only have 36,864 elements. That's for all scripts.

    Reply With Quote

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

     

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