Controllable Pirate Ships

Discussion in 'Halo and Forge Discussion' started by Spranklz, May 11, 2016.

  1. Spranklz

    Spranklz Ancient
    Senior Member

    Messages:
    306
    Likes Received:
    472
    Pictures to come!

    I hate sharing my ideas with people sometimes because I want few people to know about them. Hehe!

    But I wanted to talk a little bit about this map I made:

    Essentially, I made two small pirate ships over a bunch of chromas that simulate water.

    The ships slowly and constantly move forward.

    They can be rotated 15 degrees left or right at a time via two switches at the helm of the ships.


    Basically, you can make your own vehicles in a similar way by scripting all the pieces correctly.

    You must first group each item you want to have the same script, then give them the scripts you want. If you have 2 objects in a group, you will not be able to script them differently, so only group them after this is done.

    Next, you will need to weld all items together, including the switches. This gives them the same center of mass, which means the whole welded group will rotate/move together. If you do not weld, the pieces will rotate about the location of their current axes, meaning it won't work.

    With one script telling everything to move forward, and two more that do the rotation, each object has 3 scripts on it (4 for the switches). That means that you can only have 512/3 = about 180 pieces. That means only about 90 per boat.

    It is important to know that spawn locations currently cannot take scripts, so you would spawn outside the boat once the boat moves a certain distance unless another procedure is implemented. I used two receive teleporters on each ship, then had players spawn by a sender teleporter for the correct team's ship. I put some weapons in that room, too. So, they spawn, grab a gun, go through the teleporter, and end up on the ship as if they had just spawned there.

    Also, note that with any lag whatsoever, the pieces have a chance to offset slightly during each rotation, meaning your vehicles will slowly distort over time. You might be able to fix this by using small rotations and movements, but should probably design your map so that vehicle distortion is not a huge deficit.

    Lastly, the boats can move past the edges of the map, meaning the map will effectively break when players spawn in a kill zone. You can fix this by doing a series of 1-life rounds. I haven't found a way to have effective scripting to either tell the ship to turn around or something in order to keep the map from "breaking" in this way.

    I took some videos with my iPhone 6 but cannot seem to upload them!


    ...If I wanted to do the map differently, I could also make cannons in several ways....

    The best way to make a cannon, in my opinion, would be to create the barrel and stand for the cannon with an invisible switch that allows players to "interact." Upon interaction, an explosive barrel or 2x2x2 block or whatever would spawn in the barrel of the cannon (or at the end, depending on your geometry restrictions). That object would have the script "Upon spawning, displace forward 200 units in 1 second;" and, "every 0.9 seconds, despawn," or whatever you wanted. That way, when you interact with the cannon, it shoots a fast projectile. Set the physics of the object to normal to have it be affected by gravity.

    It would be complicated to rotate the cannon because it would require other switches, but it could be done. The cannons would also be pretty intensive on scripts, which means they probably cannot fit in a map that also has moving pirate ships. Perhaps it would work best with two stationary ships, or perhaps one moving ship and one imperial fortress or something.
     
    #1 Spranklz, May 11, 2016
    Last edited: May 11, 2016
    Yumudas Beegbut likes this.
  2. ProFessor436

    ProFessor436 Legendary

    Messages:
    80
    Likes Received:
    49
    Interesting, I can remember doing something like this by welding a building around a Scorpion. To be honest, it worked out alright. I never made it into an actual map though.
     
  3. Agent Zero85

    Agent Zero85 Legendary
    Wiki Contributor Senior Member

    Messages:
    400
    Likes Received:
    435
    I saw your post on my map, like you, i didnt want anyone stealing my idea as well. While this is basically what im doing, there is a problem you will have,
    Local movement.
    Either all the peices scatter, or are locked to world orientation.
    However, tjis may only have been because my "ship" wasnt welded,
    i forgot about that feature.
    Anyways you think alike when it came to addressing problems like spawning,
    To answer your question about script limitations:
    When it comes to blocks, im not worried, i can build really basic.
    But my ship will, with the discovery of your welding makes ship move as one, require 3 buttons with 3 scripts, move forward, turn left, turn right,
    The alien ship will have two scripts, rotate left, rotate right.
    so thats 5.
    512/5=
    ~102
    However, i will be using scripts to fire alien/human cannons.
    4 humans will man the CWIS' then 1 human will operate each cannon,
    The cannons would be manually loaded by pushing an explosive barrel into the barrel, securing it, and pressing the fire mechanism.
    This, using my basic math skills, will take 2 scripts to rotate the cannon, then 1 more to secure the explosive and fire it.
    the cannon would take approx 10 blocks, so thats 20 scripts per cannon, times 4 means 80 is cut from my 512, plus 12 for the buttons/mechanisms.
    512-92=
    420 to build the battleship/alien ship:
    420/5=84
    So 84 to do the battleship, and i wil have to count the cannons twice, due to the movement scripts.
    meaning i will have 44 blocks to make this battleship, minus 4 for the Cwis, and another 3 for buttons.
    37, this will be tight.
    The alien ship may seem to have alot more, but around 40 scripts will be used for the cannons, two for each one,
    Heres the only problem now that i think of it, will a welded object allow the cannons to rotate independently? Thats the real question.
     
    Yumudas Beegbut likes this.
  4. Yumudas Beegbut

    Yumudas Beegbut Legendary
    Wiki Contributor Senior Member

    Messages:
    393
    Likes Received:
    352
    If you can use normal physics for your ship and weld them wrapped around a phased or fixed object that has your scripts, you don't have to worry about using all those scripts. As long as it doesn't move or rotate too fast, it should work well. Moving or rotating too quickly can throw the normal physics objects off or cause major collision stuff.

    Or you can add scripts just to a main object and then weld it in with the rest and set them all to normal physics. Then you have to deal with gravity and stuff.

    If the ships move, or even if cannons rotate, is there a way to get objects like explosives to spawn inside the cannon barrels? Do teleporters work on regular objects? Or if they were part of a group that moved, would they spawn relative to the group? I wish we could script the spawn locations of objects!
     
  5. Spranklz

    Spranklz Ancient
    Senior Member

    Messages:
    306
    Likes Received:
    472
    Hmm I haven't tried setting to non-phased physics for welding, but I found that if not all objects have the same script in a weld group of phased objects, the whole object will not move.

    You can get the explosives to spawn inside the barrel if your barrel is open, and not a filled cylinder to represent a barrel. You could still have them spawn inside a filled barrel, but would need to use phased physics.

    Normal objects like barrels and soccer balls do not go through teleporters!

    The teleporters, however, can take their own scripting. This means I was able to get them to move as part of the ship.

    It isn't a huge downside to having people spawn at teleporters that take them to the ships because the ships are small enough anyway. The main downside is that a player could potentially never leave the spawn room, and thusly never enter the map. If you were afraid of this, you could have the back wall approach the teleporter and then return to its original position over time such that it would push players into the teleporter and then reset to allow new players to spawn in. Alternatively, you can encourage players to leave the spawn by playing objective-based games such as strongholds or CTF.
    --- Double Post Merged, May 12, 2016 ---
    To answer your question Agent Zero, welding will prevent local movement, so the objects will all rotate as one ship. If you do not weld, it will not work! Also, I am happy to see that you have your map figured out. Can't wait to check it out!
     
    Agent Zero85 and Yumudas Beegbut like this.
  6. Spranklz

    Spranklz Ancient
    Senior Member

    Messages:
    306
    Likes Received:
    472
    I actually really like your idea, Professor, of using a pre-existing vehicle for your base. My only reservations would be that it may be difficult to see while operating, and it may be difficult to begin operating. The pirate ships were nice because they mostly moved on their own, but if I had to sail it constantly, it would be a lot more work for the players.

    The main upside is that operation is simplified. Imagine the difference between driving a warthog and having to press a bunch of switches for a forge-made car that tell it to turn or move. I guess it really depends on your goals!

    That being said, have you tried welding to banshees? I'm curious to know if there is a weight limit.
     
    Agent Zero85 likes this.
  7. Agent Zero85

    Agent Zero85 Legendary
    Wiki Contributor Senior Member

    Messages:
    400
    Likes Received:
    435
    vehicles can be set with velocities, why don't we vehicle weld the ship to a ghost, then with scripts we could make the vehicle rotate and set velocity forward with a button push.
    This would make my last comment pointless, but I can only see two downsides, for the pro of not using up the scripts:
    Would "cannons" rotate, and would scripting in general work?
    Ive heard the game crashed when you try vehicle welding shade turrets + a vehicle.

    If I cant rotate cannons independently, I'm fine with that, I would just have to find a system to keep the barrels primed to fire, I have an idea in mind. Maybe we could work cooperatively on each others maps,
     
    #7 Agent Zero85, May 12, 2016
    Last edited: May 12, 2016
  8. Spranklz

    Spranklz Ancient
    Senior Member

    Messages:
    306
    Likes Received:
    472
    Yeah, welding to a ghost might work. I'm assuming the ghost can take the script for rotation, but I think it may not rotate unless the other members of the weld group have the same script. It may only work if there is someone driving the ghost. Worth a shot!
     
  9. Agent Zero85

    Agent Zero85 Legendary
    Wiki Contributor Senior Member

    Messages:
    400
    Likes Received:
    435
    well vehicle welding sets everything to normal, and when the ghost rotates, the ship should follow, just like if I were driving the ghost and rotated.
     
  10. Spranklz

    Spranklz Ancient
    Senior Member

    Messages:
    306
    Likes Received:
    472
    Give it a shot and let us know what happens! Should take like 3 minutes to mock up. Or I can give it a shot after I finish downloading the update with my caveman internet speed.
     
  11. Spranklz

    Spranklz Ancient
    Senior Member

    Messages:
    306
    Likes Received:
    472
    BTW, if you know how to get iPhone videos to upload here, I can show you what I've got.
     
  12. Agent Zero85

    Agent Zero85 Legendary
    Wiki Contributor Senior Member

    Messages:
    400
    Likes Received:
    435
    yeah, just upload them to youtube, then embed it here by clicking the little reel icon.
     
    Spranklz likes this.

Share This Page