Portal, Aperiture Sciences.

Post your scripting questions / solutions here

Moderator: Moderators

Aprop
Major
Posts: 291
Joined: Mon Nov 17, 2008 3:40 pm

Post by Aprop »

Good job... but there are two problems, first player sometimes stuck in wal as rookie said, second:

Code: Select all

^~^~^ Can't find textures/general_industrial/deckgrate_set1b.tga
unknown command: dmbulletcount
	local.weap dmbulletcount 0 (global/portal.scr, 204)
	local.weap ^

unknown command: dmammorequired
	local.weap dmammorequired 0 (global/portal.scr, 205)
	local.weap ^
Im using breaktrought..
$oldier Of Ra
Lieutenant Colonel
Posts: 404
Joined: Sun Oct 16, 2005 7:16 pm
Location: Belgium
Contact:

Post by $oldier Of Ra »

That's because breakthrough's commands go like this:

Code: Select all

dm bulletcount
Our official website: http://www.mohaairborne.co.cc
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)

For all your bot needs!!!!

$oldier Of Ra.
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 »

As I said, I won't be fixing any of these things, I'm fine with them as I only created this mod to play it with my friends. You want to try to fix it, go ahead.

SoR is right about the commands. A simple check for getcvar(shortversion) should do the trick. If you feel like it, go for it.
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
$oldier Of Ra
Lieutenant Colonel
Posts: 404
Joined: Sun Oct 16, 2005 7:16 pm
Location: Belgium
Contact:

Post by $oldier Of Ra »

Your mod is amazing, rookie, just like in the real portal game. Cheers :D
Our official website: http://www.mohaairborne.co.cc
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)

For all your bot needs!!!!

$oldier Of Ra.
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, glad you like it. :)
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

Portal gun

Post by Wierdo »

Hey, never thought anybody would run with this. Great job Rookie One!!! I took a look at your work in the script. Wow; just wow. That is some really complicated math you know there. And the way you did it will allow it to work on any map, with a single line added to the script. I tested the conservation of momentium, and it will work for getting to places that would otherwise be too high.


Hey, 211476, if you are making a model, lemme know. I added in the launcher sound effects from the game. (In the copy I downloaded to my desktop.)

I think I will see about mapping some test chambers to play with this in. Companion cube time!

I will now see about making that material which cannot be teleported to. I will try something like isTouching and go from there.
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 most complex part of it is probably the portal matrix. ;) Plus a triangle normal calculation and some trigonometry. I wouldn't call that complex math. ;)

I had this wacky idea of writing a BSP preprocessor to extract collision information to a script and perform traces via script, using the game engine for tracing against entities only. This way we could get all the information we may possibly want. I'm not sure it's worth it, though. The size of such a script file could span several megabytes, so it may be problematic for the scripting engine, too.
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

Math and storyline adheriance

Post by Wierdo »

The most complex part of it is probably the portal matrix. Plus a triangle normal calculation and some trigonometry. I wouldn't call that complex math.
Uhuh . . . I guess if that is just everyday math, then oh well. It is still on the very outskirts of my mathematical understanding. Maybe its the water we Americans drink. Infact, only careful study of your code and adjacent footnotes gave me the ability to decifer it. Well, that and perhaps the convenient targetnames.

Note: Portals can be fired through Vehicle clip, Player clip, Weapon clip and any material labeled "$name notsolid".

Now, you speak of a BSP preprocessor. Inherently cool, but I have a few Ideas. In the Portal game, the Portals would spawn on any surface except the black metallic walls. It could be that the device would have preformed in the same manner outside of the lab. Perhaps it was only that black stuff which blocked portal spawning. A "Super" material.

To best replicate its effect, I think the script only need recognize that a portal is touching this stuff, (script_object) and to immediately close it. Something like this could be called after each shot:

Code: Select all

on_blackstuff:
	if (self.prtl_blue isTouching $blackwall)
		self.prtl_blue waitthread portal_close 0
	if (self.prtl_yellow isTouching $blackwall)
		self.prtl_yellow waitthread portal_close 0

end
I am going to see if I can check for useheld. It should be better to press "E" and be able to collapse portals. Say, if you are being chased.
According to the game's AI, the device has a value greater than the organs and incomes of all subjects in "unknown amount". Is it possible to spawn it with a count of one, (prtl.gun cnt 1?) so as to make it a rare non-respawning item?
User avatar
211476
Captain
Posts: 273
Joined: Fri Feb 29, 2008 2:20 am
Location: Arizona, USA
Contact:

Post by 211476 »

I still have the portal gun model that I made,
Image

I'll begin texturing it and then I'll bone it:D and put it in game to replace the silenced pistol
I might even use Valve's texture :wink:
Image
Wierdo
Corporal
Posts: 47
Joined: Wed Jan 09, 2008 11:15 pm
Location: Winfield, KS

Portal - despawning

Post by Wierdo »

K, figured out how to despawn portals with the "E" key. Also figured out how to limit Portal gun to one per level,
without getting overflow in console from the animation thread.
211476, (Rookie, if still interested); If you guys are interested in polishing this up some more, I think we should work together on a second release of this file.

Also, Patch mesh "false ceilings" should allow portal spawning on them, but allow players to slide through them.
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, that's everyday math for me ever since I got into modding. :) But truth to be told, they didn't teach me that at school, even though they should (from what I'm told, universities do expect peeps to know matrix math and quite advanced analytic geometry). If you understood anything from the comments, that's already a success for me - code readability and commentary have always been my weak spots. ;)

Yeah, I hate the way the portals look on uneven surfaces or when created from extreme angles, so I guess you can count me in on the BSP preprocessor and tracing end. With that, we could obtain hit surfaces' properties a.k.a. surface flags and contents (in general, the stuff you can set in Radiant's surface inspector or in shaders with the surfaceparm keyword). This way we could just filter metallic surfaces off, as well as the skybox and all the clips.
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

isTouching

Post by Wierdo »

Tried to make portals close on contact with the black metallic wall stuff with isTouching. Could not get it to work at all. If a portal lands in any area between two black walls, it will close. When The walls are seperated into individual entities, and placed into an array, MOHAA will ignore the whole lot of them.

Unless only one surface in the game is considered to be unteleportable to, the game will not work correctly with isTouching.

Is there some other command I could use? :?
Herr Klugscheisser
Lance Corporal
Posts: 21
Joined: Thu Mar 17, 2005 1:14 pm

Post by Herr Klugscheisser »

Portal of Honor

:lol:

I'm having a lot of fun with this mod. Superb comes to mind. Great work ... thanks.

:D
Aprop
Major
Posts: 291
Joined: Mon Nov 17, 2008 3:40 pm

Post by Aprop »

Wierdo, maybe sightrace command may help you a bit?
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 »

I already have a solution. Just give me a while to polish it.
Admin
Image
Image
Honour guide me.

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