Puzzle Creator Tech Info, Hacks, and Laughs

Avatar
BierPizzaChips
41 Posts
Posted May 29, 2012
Replied 3 hours later
@HMW: Published.
All maps of this steam account had been created via Puzzle Maker with HMW's cool hack:
http://steamcommunity.com/profiles/76561198037304681/myworkshopfiles/?appid=620
Alternatively you may query in the workshop for 'sunbury'.

Each maps includes a video walkthrough, here the video of the first map:
http://youtu.be/nd8RW74xt7w


Say, guys, any chance to have an Angeled Panel being active 90 degrees to block a tunnel and being turn flat by activating a trigger? I am looking for something to open and close tunnels / walk throughs. But again, i am a Newbie and may miss the point. On the other had, if such a thing could be configured by a replaced editoritems.txt that would be soooo cool.

Advertisement
Registered users don't see ads! Register now!
Avatar
kariko
32 Posts
Posted May 30, 2012
Replied 18 hours later
A pedestal button could easily do that. If you look at my PTI map "Continue Testing", it uses those. I can't find the link right now, but it's basically connecting a pedestal button to the panel, and then having another panel close in the same area. It's hard to explain through text...

Also, using HMW's awesome Editor Objects, you can simplify it by making an OR gate for the angled panel. That way, the player can either use Button 1 to open the wall, or Button 2.

Avatar
HMW
806 Posts
Posted May 30, 2012
Replied 3 hours later
You can make the panels operating in reverse with an option on the right-click menu. (IIRC it's called "start deployed" or something like that.)
Avatar
BierPizzaChips
41 Posts
Posted May 31, 2012
Replied 14 hours later

BierPizzaChips wrote:
Also, using HMW's awesome Editor Objects, you can simplify it by making an OR gate for the angled panel. That way, the player can either use Button 1 to open the wall, or Button 2.

That works beautifully fine. Btw: HMW posted in his README, that spheres are an XOR. But if you link two sphere-buttons to the switch and one of those sphere-buttons additional to a door, the switch becomes an XAND, which is very nice

I am dreaming now of more athmosphere objects such as rotten/broken wall elements and trash. The Puzzle Maker maps look all very clean ... .
Any chance to modify e.g. the texture settings for the walls to make maps look different?
Finally: Is my impression correct, that storing a 'Collection' on Steam is only possible with Hammer? Would be cool, if e.g. 20 Puzzle Maker maps could be combine to one 'campaign'. Just dreaming ...

If you have ideas, i am happy to mess with my file

Avatar
carlymx
58 Posts
Posted May 31, 2012
Replied 11 hours later

Robdon wrote:
I think its hard coded into client.dll.

If you 'strings' client.dll, then search for 'entity_limit' the entry before it is 1750. So I recon its in there.

Looks like vbsp.exe also has a limit to what it can be set to. Seems to be between 32 and 2048 and generates an error if its above 2048:

VBSP: invalid value for '-entity_limit' (9999), use a value between 32 and 2048

You can also see a few bits about the limits here:

Hello

Q So you think it would be possible to change the value "1750" by one higher?
How?

A Greeting.

Avatar
madcat1030
66 Posts
Posted May 31, 2012
Replied 5 hours later
Hey, hen, do you think it would be possible to make an SPST type toggle logic gate? I mean, when you send an input, even for a second, it would make a permanent change. I'd like to be able to wire two cube buttons to one of those gates, so that once you've managed to press them both simultaneously, a door will open forever, and I don't want to use a hidden-laser room. I'm going to for now, but it'd be a nice thing to have.
Avatar
Robdon
204 Posts
Posted Jun 01, 2012
Replied 4 hours later

carlymx wrote:
Hello

Q So you think it would be possible to change the value "1750" by one higher?
How?

A Greeting.

Hi,

No, I dont think you can change it in the puzzle maker, as its hard coded I think.

You can change it in hammer though, if you compile through there as you can specify the parameters to the compile progs in hammer.

Avatar
HMW
806 Posts
Posted Jun 01, 2012
Replied 14 hours later
If you know that the 1750 you found is in fact the value for the limit, then I recon you could just change it right there with a hex-editor.

@madcat1030: In theory, this would be possible by connecting some logic gates in a loop, but there are some strange bugs when you connect multiple ones together. I don't know what to do about that yet.

Avatar
madcat1030
66 Posts
Posted Jun 01, 2012
Replied 4 hours later
Yeah, I just realized that you could achieve something similar using an and gate connected to an XOR gate.

Now I'm going through my maps touching them up with portal magnets and save points thanks to your items.

Avatar
Robdon
204 Posts
Posted Jun 02, 2012
Replied 5 hours later

HMW wrote:
If you know that the 1750 you found is in fact the value for the limit, then I recon you could just change it right there with a hex-editor.

Nah, you cant hex anything in any of the portal exe/dll files, they must have some kinda checksum verification going on to make sure people dont 'mess' with things, because if you change anything portal just crashes after the startup vid.

Avatar
sicklebrick
876 Posts
Posted Jun 02, 2012
Replied 19 hours later

Robdon wrote:
HMW wrote:

If you know that the 1750 you found is in fact the value for the limit, then I recon you could just change it right there with a hex-editor.

Nah, you cant hex anything in any of the portal exe/dll files, they must have some kinda checksum verification going on to make sure people dont 'mess' with things, because if you change anything portal just crashes after the startup vid.

One potential fix:
Hunt for a library called MadCodeHook, and check out the HookProcessCreation demo.
You'd probably only have to change 2-3 lines to fix "VBSP.exe -entity_limit 1750" to "VBSP.exe -entity_limit 2048". Essentially what this does is hook the function call that windows uses to launch a process (from every process currently running), and lets you change the command line.
E.g. Run program, program injects code hook, program closes.. portal is now good to go without permanent modifications.

The only alternative I can think of involves hexing a cracked copy of the game. Obviously that's a shitty idea as even legitimate game owners will have to share copies whilst torrenting. Don't do it.

Avatar
HMW
806 Posts
Posted Jun 03, 2012
Replied 12 hours later
That's an interesting approach. Perhaps I'll look into that some time, it may be useful for other things. (Say, running bspzip automatically to embed custom content...)

On the subject of logic gates: I fixed them so they can be connected in a loop. Now you can make memory circuits and stuff. Like this.

There is still one problem with the XOR gate that I don't know how to solve yet. It sometimes starts out activated even though it shouldn't, and then it keeps operating in reverse.

Avatar
sicklebrick
876 Posts
Posted Jun 03, 2012
Replied 4 hours later

HMW wrote:
That's an interesting approach. Perhaps I'll look into that some time, it may be useful for other things. (Say, running bspzip automatically to embed custom content...)

Heh, nice idea. It would be nice if VBSP had a Pakrat style auto scan, or Pakrat took command line options. I suppose you could just ram it all in a batch file and add a new build step in hammer though

HMW wrote:
On the subject of logic gates: I fixed them so they can be connected in a loop. Now you can make memory circuits and stuff. Like this.

That's awesome! It looks a bit like those educational circuit boards you get in highschool physics, but does away with any ambiguity. Might have to borrow those instances =) (I do so hate indicator lights...)

HMW wrote:
Man Love.

Indeed.

HMW wrote:
There is still one problem with the XOR gate that I don't know how to solve yet. It sometimes starts out activated even though it shouldn't, and then it keeps operating in reverse.

From what I gather you seem to have the final truth table value routed through a system like:

//Logic branch: Output_Normal
OnTrue, Return True
OnFalse, Return False

//Logic branch: Output_Inverted
OnTrue, Return False
OnFalse, Return True

Then based on your $start_enabled, kill either Output_Normal or Output_Inverted.
If I remember right, killing an object can take upto the next frame to actually process. (So at the start for example, both output states may be competing, and an XOR linked to any kind of toggle might have a 50/50 chance of being inverted based on which was active at the time. ) I tried to think through a bunch of solutions:

-Use a logic branch listener instead: Fairly automatic, your truth table is only 3 lines for 2 inputs and they update even when an object is killed saving you a little IO.

-Have an AND gate at the end. One input is your truth table value, the other is an OnMapSpawn, SetValue, 1 with a delay of 0.5

-Just give the user a NOT\NAND gate.

But in all of those cases the one problem seems to be anything that uses a toggle, or which will only trigger one time based on a value of 1.
(I.e. an exit door that stays open, or a panel that's supposed to stay up).
All I can suggest is instead of the current system, just make sure every gate is defaulted to their no input state, and doesn't use any form of toggle. For the end of any chain where the output should be inverted but only triggered once, make a small gate that is like a timed AND, so that it won't fire the wrong output untill your gate chain has had a chance to filter through the appropriate values.
Then again, I could easily have misunderstood the whole thing and just wrote a bunch of nonsense

Avatar
HMW
806 Posts
Posted Jun 04, 2012
Replied 1 day later

sicklebrick wrote:
If I remember right, killing an object can take upto the next frame to actually process. (So at the start for example, both output states may be competing, and an XOR linked to any kind of toggle might have a 50/50 chance of being inverted based on which was active at the time. )

Now that is some useful knowledge that I didn't know yet. Which is about the best kind of useful knowledge to be told about IMO.
In other news: race conditions suck.

sicklebrick wrote:
I tried to think through a bunch of solutions:

[bunch of very insteresting sounding solutions!]

But in all of those cases the one problem seems to be anything that uses a toggle, or which will only trigger one time based on a value of 1.

The toggles seem to be a problem in general with PTI editor components. I strongly suspect that this has something to do with this bug. Usually when it happens, the light behind the icon behaves correctly but the output is inverted. (So there may also be some race condition thing going on.)

I was able to fix similar bugs with the other gate types by making one logic_branch receive the final output, and another logic_branch always set to the opposite of the output. A logic_branch_listener then compares those two and flips the other one around when they are equal, so it only sends an output signal if there is an actual change, not something like "an OR gate just went from true|false to true|true". I just need to find a way to add the same "idempotence" to the XOR.

I could just drop the XOR entirely because as you said, it is possible to simulate one with an AND and NOT, but I can't stand the thought of having made those XOR icons for nothing so that's probably not going to happen

Avatar
sicklebrick
876 Posts
Posted Jun 04, 2012
Replied 2 hours later
Lol, screw it. Just script them, safe enough if you stick to primitive variables
And yeah, race conditions suck!
Avatar
madcat1030
66 Posts
Posted Jun 04, 2012
Replied 2 hours later
So... " could you potentially make a password combolock?
Avatar
HMW
806 Posts
Posted Jun 05, 2012
Replied 17 hours later
Out of the logic gates? Yeah, probably, as in: a row of buttons, some of which must be pressed and others not. You could then either show the wiring to the player so they can figure it out, or hide it away in a box somewhere and show the combination on a wall somewhere in huge, awesome 128x128 "pixels"

By the way, the editoritems.txt format got changed with today's update. Attached is an updated version of the custom elements which will work with that, also with (hopefully) properly working XOR.

@sicklebrick: I considered scripts, but for PTI items you can't include custom files (yet...) so that would mean mashing the whole program into RunScriptCode signals. I have done that before for small things, but it's a pain in the southern hemispheres when you need to use strings, which is practically always.
(Involves lots of "self.GetName().slice(...)", using entities with ringing names like "FireUser1SetParentAttachmentMaintainOffsetbrush1modelthingypanel_attach".)
This is how you find out that the max length of a RunScriptCode argument is 256 characters.

Avatar
sicklebrick
876 Posts
Posted Jun 05, 2012
Replied 4 hours later
Aww yeah, didn't think about external files! Glad it seems to be working now though
Avatar
FelixGriffin
2,680 Posts
Posted Jun 06, 2012
Replied 16 hours later
About different textures: the BSP file sits there for a bit while you enter a title. During that time another program or script could use bspzip commands to replace the textures, which are embedded into the map by PTI. Maybe Old Aperture would be possible...a prop_static test sphere could go into the global_pti_ents to surround everything, and the faith plates and all could use edited instances. The only unfixable problem would be the new-style fizzlers.

EDIT: I've been working on adding in new test elements, like the breakable glass. HMW, do you mind if I include your Sendificator? A modified copy of the script for it could also disable an entity which would otherwise display something like "You need the sendification script from (URL)".

Avatar
sicklebrick
876 Posts
Posted Jun 06, 2012
Replied 6 hours later
Just built a fix for the 1750 entity limit, and packing stuff if anyone wants to give it a whirl
http://forums.thinking.withportals.com/puzzle-creator/fudge-packer-peti-entity-limit-fix-and-auto-file-packer-t6687.html
Advertisement
Registered users don't see ads! Register now!