A Community discussion forum for Halo Custom Edition, Halo 2 Vista, Portal and Halo Machinima

Home  Search Register  Login Member ListRecent Posts
  
 
»Forums Index »Halo Custom Edition (Bungie/Gearbox) »Halo CE General Discussion »Syncing Issue with script

Author Topic: Syncing Issue with script (6 messages, Page 1 of 1)
Moderators: Dennis

cellista92
Joined: Jun 24, 2008

~


Posted: Jun 17, 2013 09:50 PM    Msg. 1 of 6       
Alright, so I'm trying to make a Windmill sync. It is supposed to be somewhat like the Zanzibar fan, where you can get on top of it, though this one has seats to take you around.
I have made it a device_machine, set as "gears"; rotating fully every 80 seconds (slowly enough so that you don't fall off your seat, since there are no sticky surfaces; the collision keeps you inside.)

The problem right now, though, is syncing it.
I wasn't sure how to start, so I asked Kirby for help, and he gave me this script:

(global short player_count 0)  ;;Store Player Count
(global boolean is_host false) ;;Stores whether player is host
(script continuous resync
(sleep_until (< (unit_get_health sync_biped) 1) 1) ;;Waits until the sync_biped is hurt
(device_set_position_immediate device 0) ;;Resets windmill
(device_set_position device 1) ;;Starts it moving
(object_create_anew sync_biped) ;;Remakes Sync biped
)
(script continuous host_only
(sleep_until is_host 1) ;;Doesnt run if not host
(sleep_until (!= player_count player_spawn_count) 1) ;;Wait until the player count changes
(if (< player_count player_spawn_count) (object_teleport biped_crusher crush_flag)) ;;If the player count increased, resync
(set player_count player_spawn_count) ;;Track current player count
)
(script startup host_testing
(sleep 5)
(set is_host (!= (unit_get_health biped_crusher) -1)) ;;See whose hosting the server
(if (not is_host) (sleep -1 host_only)) ;;If the player isnt host, kill the other host_only script
)


When I tested it, the script crushed the biped successfully for the host; though after that, it didn't crush the biped anymore; hence the windmill didn't sync.
I switched the "player_spawn_count" to "(list_count (players))" to see if the logic was fine, and surely enough, it crushed the biped when a player spawned.

The problem there is: that it restarts the windmill every time you respawn - which is why Kirby used the player_spawn_count instead.
I've tried to modify it and even change the script to solve the problem, but I haven't come any closer than syncing the windmill every fifth of a rotation at the expense of small jerks every now and then.

So I was wondering if anyone could explain why the script isn't working for player_spawn_count.


R93_Sniper
Joined: Feb 13, 2011

When in Doubt, RUN!


Posted: Jun 18, 2013 05:37 AM    Msg. 2 of 6       
wouldn't it simply be easier to use it as a animated scenery object?

Or does the collision not move if you have it like that?


cellista92
Joined: Jun 24, 2008

~


Posted: Jun 18, 2013 02:59 PM    Msg. 3 of 6       
Alright. it has been fixed now. Made it a vehicle again, and made the host_only script destroy and create a new windmill after every full rotation.
Edited by cellista92 on Jun 19, 2013 at 02:15 AM


Link
Joined: Aug 31, 2008

Link here come to town!


Posted: Jun 19, 2013 04:42 AM    Msg. 4 of 6       
Since the syncing issue has now been fixed. There is one more thing that we need to fix to finalize the windmill. We are having a slight problem with the lighting of the windmill and would want to make it look bright as the first screenshot of the device_machine instead of how it looks on the second screenshot that's set as a vehicle.

Here are 2 different screenshots from 2 different test .map files:

This one is from the device_machine method which won't sync the players into the windmill well as it will go out of sync:


This one is from it being as a vehicle where it would sync the players into the windmill after like 10 seconds later of joining late without having any sort of out of sync issues on any type of rejoin/map load/map resets:


So anyone know how to fix this problem?


Jesse
Joined: Jan 18, 2009

Discord: Holy Crust#4500


Posted: Jun 19, 2013 05:02 AM    Msg. 5 of 6       
In my experience, halo determines the lighting for an object based on the node position. I believe if you move the node higher up in 3ds max you may fix your issue. If your windmill has a separate region for your windmill thing, try moving only that node. I would also suggest having the windmill tower be scenery, and the windmill itself be an animated vehicle, similar to the fans in Foundry.


cellista92
Joined: Jun 24, 2008

~


Posted: Jun 19, 2013 05:17 AM    Msg. 6 of 6       
Genius. thank you Jesse

 

 
Previous Older Thread    Next newer Thread







Time: Sun January 19, 2020 5:08 PM 313 ms.
A Halo Maps Website