[Mod] Teleporter and Portal Hotspots

Post Reply
User avatar
EgyptFalcon
Posts: 26
Joined: Mon Mar 31, 2014 9:05 pm

[Mod] Teleporter and Portal Hotspots

Post by EgyptFalcon » Thu Dec 17, 2015 10:54 pm

Phew. I have finally decided to release this mod even though there are a few bugs that are beyond my capabilities of fixing. Note that it isn't a mod in the new sense of being in the Mod folder, rather it is just some hotspots that have script attached to them. That means that you should extract the egyptfalcon.zip file and put it in Data/Custom.

READ THE FOLLOWING CAREFULLY IF YOU DON'T WANT YOUR GAME TO CRASH:

There are two main objects, the teleporter hotspot and the portal hotspot. The teleporter hotspot is two cube hotspots that teleport between each other. To spawn in the teleporter hotspots, you actually have to load the teleporter_spawner.xml which actually loads in a spawner which then spawns in the other two teleporters. They all spawn in the same spot, so you have to move them around before you can see all three objects. The spawner object contains most of the settings, and you access them with 'u'. These customizable features are: Activation by Item, Activation by NPC, (Choose one of the following three) Alter Velocity, Maintain Velocity, or Reset Velocity, Shake Camera (for effect when teleporting), Spaghetti Arms (for the hell of it), and Spawn to Center (when activated spawns player in the center of hotspot, otherwise spawns them on the edge of the hotspot, mostly used for fine-tuning). The rest of the parameters are NOT TO BE TOUCHED and will only mess with your game if you do.

Each teleporter hotspot includes a parameter "Can Teleport Away" as well, which if disabled means the player can't teleport from that hotspot, but can only teleport to that hotspot from the other teleporter. Once again, do NOT mess with any other parameters.

The other main object in the game is the portal hotspot. The two portals (blue and orange) are spawned by the portal_spawner.xml. Each of the portals spawns in a decal (blue and orange) to differentiate between the two portals. In order to move the portals themselves you must select it even though the decal it spawns in completely envelops the hotspot. Therefore you must click on the decal and rotate your mouse wheel to scroll through the objects until you select the smaller, rectangular-shaped portal inside. If you accidentally move or delete the decal object, don't worry, it will immediately lock onto the portal hotspot. Similar parameters are on the portal_spawner object as the teleporter_spawner object, and do not mess with any other parameters. Unfortunately, as of alpha 212 the decals are temporarily not working (they are just grey) so the portals might be a little underwhelming. Be careful in how you place your portal hotspots, their rotation matters in how the character comes out the other end.

MOST IMPORTANTLY: DO NOT PRESS UNDO OR CTRL+Z WHILE USING HOTSPOTS. THE TELEPORTER HOTSPOTS WILL MESS UP WITHOUT YOU NOTICING AND MUST BE DELETED BUT THE PORTAL HOTSPOTS ARE FINE IF YOU CALMLY QUIT THE LEVEL AND RELOAD IT. (This is the bug I was sadly unable to fix.)

Also, alpha 212 seems unable to load external hotspot objects, so you have to use the work around mentioned in Gyrth's bow and arrow mod. In Data/UI/spawner/objects/hotspots.js add the lines at the end: addItem('Hotspot', 'Teleporter Spawner', 'Data/Custom/egyptfalcon/teleporter_hotspot/Objects/teleporter_spawner.xml', 'load_icon.png'); and the line: addItem('Hotspot', 'Portal Spawner', 'Data/Custom/egyptfalcon/teleporter_hotspot/Objects/portal_spawner.xml', 'reset_icon.png'); This way you can press 'Load Item' in-game, go to the Hotspots tab, and load the teleporter and portal spawners into your game.

If someone can find a way to fix the undo bug, that would be amazing. However, I started coding this when I first started modding Overgrowth and I took some hugely unnecessary steps, (such as using Objects instead of ItemObjects) making everything a jumbled mess. In addition, if anyone spots any other bugs, please tell me and I will try to fix them.

Another thing that was way beyond my comprehension was including the teleporter hotspots in the NavMesh. That means the AI doesn't know the teleporters exist and don't use them effectively, but can go through them if Activation by NPC is checked.

And thank you so much to the people that helped me wrap my mind around such foreign concepts in particular rotation matrices and quaternions, allowing for me to code these hotspots!
ImageImageImageImageImage
Attachments
egyptfalcon.zip
(789.08 KiB) Downloaded 51 times

Post Reply