Originally created by forum member Sars, extended by me, this mod changes the wrench's alt-fire so that you can spawn two portals at any two arbitrary locations.

To install, make a folder named "script" (w/o quotes) inside your 'base' folder, then extract the .zip into there. Double-click the "Prey Modded" shortcut to start it.

To use, select the wrench weapon (usually number 1), then use alt-fire to set the location of the first portal. It'll be set silently. Then go to where you want the second portal and press alt-fire again. The two portals will then open up, where you can travel/shoot through at your leisure.

There's also the possibility of opening up multiple pairs of portals. Each pair is associated with someone's nickname, so you could open multiple portals by changing your name mid-game. A quick way to do this would be to bring down the Console (ctrl+alt+~ usually), and type: ui_name "NewNickName"

After changing your name, switch to another weapon then back to the wrench. The wrench will then be working on your new name. To close portals from previous names, change your name back to the name you used to create those old portals, re-select the wrench, then alt-fire.

The only real problem is that portals won't always be banked/rolled correctly. Other than that, I can't find any major problems.

Have fun. And thank you Sars for writing the original code in the first place.

Uploaded a demonstration video of me using the Portal Wrench. I could've done a little more in the video, like shooting weapons through them, but I wanted to keep it fairly short, to save on both disk space and upload time with my measly 30 KB/sec upload speed (or lack thereof).

Also uploaded it to YouTube... like 10 hours ago. It's still processing. So I decided to upload it to Google a few minutes ago. :P

Whoa, that video really shows some potential for this! I'm getting that right now

__________________Duke4.net - Duke's OTHER home.HeadbangersFM - The station that keeps your head banging!
-------------
She's pretty, not "damn-she's-making-my-noodle-dance-samba"-pretty, but still very pretty... - Micki!

That's damn nice...
But it would be nice to have some sort of animation while triggering the weapon...
Just to indicate that you did press "fire"...

Do you think you could create a portal device alá Prey from 1998..? I mad ea thread about it, containing any of the stuff that is supposed to be thought through to create it... I just need someone who can actually make it, since my "modding skills" are pretty weak...

[EDIT:]
Hi Mr.Greg... Haven't seen you around, so i suppose you're new here... Welcome to our forums...
You're a filefront guy i see... Great website...

__________________A true genius does not need boundaries such as 'common sense'

What happens if you try to join a multiprey game while using this? Can other people use/see your portals? Do they gain the ability to make portals, or only if you are hosting the server? (Seems like it could be used to cheat/get an unfair advantage if some of these things aren't handled right...)

__________________
"With the first link, the chain is forged. The first speech censored, the first thought forbidden, the first freedom denied, chains us all irrevocably."

What happens if you try to join a multiprey game while using this? Can other people use/see your portals? Do they gain the ability to make portals, or only if you are hosting the server? (Seems like it could be used to cheat/get an unfair advantage if some of these things aren't handled right...)

I'm not sure how it's handled with other people in multiprey. I haven't had anyone to test it with. Maybe someone can set up a private server for testing this? That would be great. My upload isn't really good enough for hosting one myself.

Edit: And thanks for the response guys. I didn't think anyone would notice this thread. Looks like posting the video was a good idea. ;P

um..didnt joe say that back in the day there used to be a gun that did this but it was scrapped or somthing? Or maybe im mistaken. Either way, this is interesting and definitly cool to toy around with.

um..didnt joe say that back in the day there used to be a gun that did this but it was scrapped or somthing? Or maybe im mistaken. Either way, this is interesting and definitly cool to toy around with.

The earlier version of Prey did have a weapon that did exactly the same thing. You can see it in action in the Prey 1998 demonstration video I think.

I just used it online, its fun for quick escapes. You can use it on your own server if you have server mods allowed and have pure server unchecked. It's kind of unfair to the joiners who don't have it though.

I just used it online, its fun for quick escapes. You can use it on your own server if you have server mods allowed and have pure server unchecked. It's kind of unfair to the joiners who don't have it though.

I tried to join a game with it on but it wouldn't allow it. It would have been funny though to run around and see someone fall into a portal trap.

Well, I said that I'm not sure if it works online. I've no one to test with at the moment.

Also, the Portal Wrench seems to work in the single player game, so you could use it to mess around with the game's boundaries or whatever. Go into places you couldn't normally go. :P

What should be done for the next update? Maybe some sort of notification that you placed the first portal, but how should it be handled? I could print a console message, but then you wouldn't see it until you bring down the console. I could also try making the screen flash/darken slightly/temporarily when placing the first portal. Any other ideas?

And you guys can be assured that this mod will be continued into the full version. My pre-order is in \o/

1. The portals are sometimes on thier sides, or angled weird, not that I mind this (fixing it would be nice, but I would worry about it later) but in Keeper of Gravity, when you put portals in different gravity planes the image of the area on the other side of the portal is upside down, or angled weird.

2. When you go through the portals your position seems to be raised up to the center of the other portal, this knid of ruins the portals smooth natural transitions from place to place, because when you go through it your veiw is higher then it was before you went through. It doesnt always happen, but it can even happen on flat surfaces.

3. Something to tell you where you put the 1st portal would be nice. Like the closed portal ball thing where portal1 will be untill you placed portal2, then they open. Theres been times where Ive lost track of where I put the first portal, or Ive forgotten that I put a first portal.

For additions:

1. Add an animation to the wrench, a lightning bolt would be cool. Just something to tell us that we used it.

2. If possible, add multiple portals that link together (3 or 4), and 1 portal that loops back in on itself. Maybe holding the wrench alt fire for a certain ammount of time will make 1 portal that loops back on itself, and you could have multiple portals by linking them in the order that the player places them until the player switches weapons, or uses prime fire on the wrench. Each portal thats placed could be the closed portal ball until the player switches weapons/uses wrench attack, and once the player switches weapons/uses wrench attack all the portals open at the same time.

3. Some kind of quick portal maker. 1 click makes 2 portals that link together, portal1 is in front of you, and portal2 is in the distance where you where aiming when you clicked. Maybe you can make prime fire of the wrench do this. Making the wrench only used for portals.

It works as a server side mod in a server that you create(only for you, and whoever else that has it prior to joining the server, it wont be downloaded by people who join), but joining other peoples servers crashes the game, resets the script, and rejoins the server.

Great job on its current state, the ui_name thing to stop multiple entity errors while allowing for multiple portal links was genius. I wish there was another command that could be used because it changes your name in multiplayer, and people who change their name to one that you used to open a portal link can destroy your portal link. I changed my portal1 name and portal2 name in the script to stop that (portal1Name/portal2Name=tempName + "edit here for better use in mp games");. I also changed my WRENCH_EYE_OFFSET to 70, because I felt 100 was to high up.

You have very nice suggestions, but I don't want to make the mod TOO complex. It should remain as easy to use as it is now. But people are free to make their own extensions of this mod.

Yeah, I noticed the portal height problem. It has more to do with how you place the portal, it seems, since it doesn't happen all the time. And WRENCH_EYE_OFFSET is 80 by default in the script, not 100. Dunno where 100 came from.

I'm not sure what's causing the rotation problem. Looking at the code, it seems like it should be working fine, but it's like it's ignoring one axis of rotation for some reason.

As for #3, I think that's how the mod originally worked when it only had Sars's code. I just felt that that method was a bit too limiting. Thus, I made it how it is now.

I'm not sure I want to replace the regular-fire function of the wrench. You might still want to use it

But yes, an indication of where/if you placed the first portal would be nice. The problem would be determing how to show it. What would we use as an in-game marker?

You can use the closed portal ball as a marker to show where youve placed a portal. The thing you can see in MP when your standing far away from a portal.

It wouldnt be to much more complex for the player to have multiple portals, 1 click makes 1 portal, another click makes another portal that links to the first portal, another click links to the previous portal that the player placed, another click links to the previous portal and so on untill the player switches weapons. When the wrench is put away, have all the portals open at once.

I had Sars origanal script, the 1 click portal making, and liked the speed but hated the limitations, so thats why I was hoping you would add it to yours, so the player can have the speed when he/she wants, and also have no limitations. I figured prime fire on wrench would be good for this because its quick, and because it would make the wrench a full fledged portal wrench.

The only real use for a portal that loops back on itself is that you can use it as a sheild that reflects enemy fire back at them. Other then that it would just be cool to have. Im not sure how you would be able to make something like that open after holding down alt fire for a set period of time, but it seemed to be the best way to make one that loops back on itself.

Also my WRENCH_EYE_OFFSET probably was 80, then I changed it to 50, which was to low, then I forgot default and just put it at 70, but since I put it at 50 I was thinking default must have been 100, because I normally half the default to see its effect.

The rotation problem only happens to me if I place 1 portal on 1 gravity plane, and then another on a different gravity plane. I have a G15 keyboard so I can see when Im on a different plane of gravity. Its like it doesnt know what to do when 1 is supposed to be rotated 1 way, and another is supposed to be rotated a different way.

The math should be correct. origin + temp *70 is used to calculate the position for being slightly in front of the camera, so it can place the portal. The commented code is old code from Sars's original code, when portal placement worked differently. The commented lines aren't needed obviously, but I just keep them there for reference or whatever purpose.

I'm pretty sure the origin (position) is being set correctly, because you can see the portals. Any height problem comes from how you're placing them in-game, because even when standing, the portal will take on the fact that you may be (even slightly) looking up or down. Perhaps it can be fixed if X-axis rotation of the portal is only set if the player is jumping. But will that take into account different gravity zones/wallwalks?

As for the banking/rolling problem, I think it's just how it calculates the values for entity.setAngles() in the alt-fire subroutine. But I can't see what the problem is exactly.

Your idea of using the portal ball thing sounds nice. I just need to know the name of that entity and what spawn arguments it takes. I'm not exactly sure how to find out without an SDK or something.

Your other idea of making the previously made portal link to the new portal on subsequent alt-fires also sounds nice, but how will the user destroy those portals if they want to?

And Ghostspectrum, I've no clue if the 360 version is moddable. :P I don't even have a 360. But thanks for the compliment.

I was working on fixing and adding the stuff I suggested in the script itself and so far the only thing Ive added is quick portals (the old way that sars had the script) for the wrenches prime fire. So it can have a nice quick teleport to a place, and the more complex portals that delta made. It was really just practice for me because Ive never made weapon scripts. But now I think I got it down.

The old placment of portals doesnt have your view position raised up when you go through them, making it a smooth transition, so I was thinking that mixing some of his position placement code with some of yours would be able to fix it.

Quote:

Originally Posted by Delta

Your other idea of making the previously made portal link to the new portal on subsequent alt-fires also sounds nice, but how will the user destroy those portals if they want to?

I was thinking about this myself when I was working on it, I was thinking about a way to count how many portals the player had, and save it as a varible (nportals), and set up the portals as an array. Then when putting the weapon away:

would open them all. I origanally figured that nportals would just save and I would be able to use it again in void weapon_wrench::init() to close them like the way you have it set up. Thats when I realised that nportals wouldnt be saved once the wrench is gone. Maybe theres a way to pass the varible into the other weapon scripts. Im going to keep messing with it until I get something.

I would think that object_closedportal would be the entity, or something along those lines, I havent tried it though.

i can't get it workin' in the full version... dunno why... i got it in base/scripts, i also got /scripts/ in a pk4 for testing... i tried typing reloadscript in the console, and testet both sp and mp (own server)... nothing happens when pressing alt fire... nothing special...

It doesn't seem to work with levels beyond the demo.....or at least with my saves.

Also, for any new release, I recommend just using Tommy's hand animation (like when he interacts with something), and add a lightning bolt.

~Amakou~

EDIT: Also, for in game marking for the first portal....would it be possible to have a blank blue portal outline? Like a blue portal that goes nowhere, then when you make the second it turns orange and they link up......or maybe a translucent blue portal outline..that only you see.....