Please or Register to create posts and topics.

Puzzle Creator Tech Info, Hacks, and Laughs

PreviousPage 8 of 11Next
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.

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.

Sendificate series: Sendificate | A Beam Too Far | Airtime | 302
Other Portal 2 maps: Medusa Glare
Portal 1 maps: Try Anything Twice | Manic Mechanic
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 NOTNAND 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 :)

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 :)

Sendificate series: Sendificate | A Beam Too Far | Airtime | 302
Other Portal 2 maps: Medusa Glare
Portal 1 maps: Try Anything Twice | Manic Mechanic

Lol, screw it. Just script them, safe enough if you stick to primitive variables :)
And yeah, race conditions suck!

So... " could you potentially make a password combolock?

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" :D

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".)

Spoiler
Sorry, only logged-in users can see spoilers.

Sendificate series: Sendificate | A Beam Too Far | Airtime | 302
Other Portal 2 maps: Medusa Glare
Portal 1 maps: Try Anything Twice | Manic Mechanic

Aww yeah, didn't think about external files! Glad it seems to be working now though :)

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)".

Falsi sumus crusto!

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

PreviousPage 8 of 11Next