Portal, Aperiture Sciences.

Post your scripting questions / solutions here

Moderator: Moderators

Wierdo
Corporal
Posts: 47
Joined: Wed Jan 09, 2008 11:15 pm
Location: Winfield, KS

Portal, Aperiture Sciences.

Post by Wierdo »

Refresher: There is a game created by Valve (Subsequently polluted by Steam) which is called Portal. Skipping the game info, the portal device would own in a map.


Objective: Create a new "Pistol" class weapon which will only spawn once to the map. Any player can press "H", then collect it to use it. (To replace standard pistol.)

The device would use 0 bullets, have 1 in the clip and have a max ammo of one. This would allow the gun to actually "Fire", but not recharge with bullets.

A new bullet type would be needed. Producing a new bullet type in the form of something like Portal_bullet.tik would allow the gun to reference the special "portal bullet". Inside this .tik file would be some form of script which would call a teleport and teledest into existance, with targetnames that are targeted by one another.

The reason it needs to be a pistol is so there can be an entrace (Primary attack) and exit (Secondary).

Code: Select all

Primary attack would make:


$targename       portal_in
target                portal_out

Secondary would make:

$targename       portal_out
Finally: Thus is the concept. The way I theorize it, the player would be able to cast an entrance, then an exit. Having an entrance and an exit in the same place would likely screw the player, as he would continually teleport. Therefore, it needs to be a one-way device. A new skin could probably be made and used for the device as well.

Physics note: The MOHAA game will not conserve physical velocity. I made a teleport at the bottom of a tall platform and made a teledest point up. Although some of the momentum did reflect, it was no more than one and a half normal jump hieght. This was constant, no matter how high the initial fall.
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

So are you asking something or telling us what you plan to do ?
Image
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post by Rookie One.pl »

This can be done in a much simpler way using server-side scripting only. MoHAA IMHO isn't fast-paced enough for such a mod to work, though.
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
Wierdo
Corporal
Posts: 47
Joined: Wed Jan 09, 2008 11:15 pm
Location: Winfield, KS

Plans. . .

Post by Wierdo »

So are you asking something or telling us what you plan to do ?
I was just laying that concept out there, as inspiration to the rest of the community. I have tested teleports already in order to see what the best case scenerio would make. Results were not too close, but still might be fun.

I might try in the future, but lack modeling software for a decent portal gun.

Has such a device been made for mohaa already?
User avatar
211476
Captain
Posts: 273
Joined: Fri Feb 29, 2008 2:20 am
Location: Arizona, USA
Contact:

Post by 211476 »

I can probably make you a portal gun, except I can't export it for MOHAA, post a picture of one and I'll see if I can make one for you
Image
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

And how do you plan to have the projectile run a script and detect who the projectile has hit . Not that it can't be done I just wonder how you plan to do it .
Image
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post by Rookie One.pl »

Guys, give me half an hour and I'll have it working. Unless you want it specifically for one player, I'll make it for every player in the server. Only problem I see is the portal special effect. ;)
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

Show off :) I was thinking more along the lines of Bjarne's scout mod

http://www.gronnevik.se/rjukan/index.ph ... odDownload
Image
User avatar
211476
Captain
Posts: 273
Joined: Fri Feb 29, 2008 2:20 am
Location: Arizona, USA
Contact:

Post by 211476 »

This a portal gun?: Image
I guess I can make one, give me shout and I'll try :D
Image
User avatar
211476
Captain
Posts: 273
Joined: Fri Feb 29, 2008 2:20 am
Location: Arizona, USA
Contact:

Post by 211476 »

Dont know if you are still working on it, but I am working on the Portal gun. Here is a render:
Image
Image
Wierdo
Corporal
Posts: 47
Joined: Wed Jan 09, 2008 11:15 pm
Location: Winfield, KS

Portal gun

Post by Wierdo »

Greatness. I look forward to seeing the completed polysurface. If that could be made into a new weapon, it would rule.

I am not actively persuing this project, but would definately consider helping to make the portal gun into a "newgun.pk3". I know barely enough to try making this; which means I would likely spend months to get it to work, if at all.
*GCC*Nigel
Second Lieutenant
Posts: 169
Joined: Sun Dec 04, 2005 5:13 am

Post by *GCC*Nigel »

I support this mod, but cannot help. Sounds VERY cool.
Stein Auf
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post by Rookie One.pl »

Well, apparently it took me a little bit more than an hour. :P Actually, I had it running in a very basic shape with velocity conservation (i.e. velocity vector before teleport = velocity vector after teleport) in minutes, but I wanted to work out the entire math behind the magic. I ran into some problems with the transformation (still don't understand why my previous approach didn't work out :?) and put the thing on the shelf for a year and I just had an enlightenment today and finished it. :) Here it is!

Download
This pk3 contains the script, state files and mohdm1 and mohdm4 rigged up for the mod. In both cases the gun appears at the bridge; you have to drop your pistol first in order to pick it up and be able to use it.

Grenades and rockets are teleported, too.

WARNING: There's a reason I'm not making a full-blown release. The mod is buggy and lacks some polishing, but I don't really feel like finishing it. To me it's just something fun to play on LAN parties with friends, and just wanted to share it so that you could, too. :)

Known issues/bugs:
  • normal calculation is sloppy, but nothing better can be done with the tools that we've got (see the prtl_debug cvar explanation below),
  • portals can be created on the skybox,
  • putting portals on ceilings is bad and will get you stuck in them; you can free yourself by opening a portal right on yourself, though,
  • skybox is technically a ceiling, too,
  • it is very unlikely but still possible to get stuck in a person at the other end of a portal,
  • probably a bunch of other things - don't be surprised if you run into something that doesn't work as expected.
The mod can be controlled by prtl_* cvars. Most of them need a map restart for the changes to kick in. See the script for details.

The prtl_debug cvars controls the debug beams. A value of 1 turns on display of surface sampling - 4 traces are used to calculate a normal. 2 turns on the display of surface rotation matrix, derived from the normal.

Enjoy!
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
User avatar
211476
Captain
Posts: 273
Joined: Fri Feb 29, 2008 2:20 am
Location: Arizona, USA
Contact:

Post by 211476 »

Cool I'm going to have to try it, and on the 1 year anniversary of the thread. :D

I'll also see if I can replace the weapon with a real Portal Gun, then we could possibly create a TC

EDIT: I tried it, it was freakin awesome, amazing you even put the physics,

is there a way to make a surface that is not able to make a portal on?
Image
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post by Rookie One.pl »

The physics was the whole point, now wasn't it? ;) It also rotates the player's view, but that can be quite confusing from my experience.

I spent at least an hour on mohdm1 putting 2 portals in line between the bridge and the staircase, using the gravity-induced velocity to fly on top of one and the other, and another hour launching myself from a wall by jumping off the roof to a portal on the ground. :P

The teleportation effect (the boom) can be a bit tiring, if you want to change it just edit the 'poof' thread.

Did I mention it's fully server-side? :)

If you want to turn it into a TC, sure, go on. :)

Making a surface "unportallable" is possible, but would require a ridiculously huge amount of work. You'd have to get bounding boxes for areas in which making portals is not permitted. So many things would be so much easier if they exposed the full tracing functionality that the engine has to the scripting language. I really miss normals and surface and content flags.
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
Post Reply