[SP] Sendificate
Quote from Groxkiller585 on June 5, 2012, 7:31 pmHMW wrote:Wow, that's quickExcellent work!
I don't entirely understand what you mean by "naming the coop portals". Did you pre-place named prop_portal entities in the map?
I was thinking about having two map-enveloping detectors, one for each portal ID. Each then sets the sendtor_active variable to something different so the script can tell them apart. But perhaps your method is easier. I'm looking forward to seeing what you made!
Correct, I made prop_portals and named them. Like I said there's probably a better way, but this was simplest to implement.
I am finishing it up, then i'll upload.

I don't entirely understand what you mean by "naming the coop portals". Did you pre-place named prop_portal entities in the map?
I was thinking about having two map-enveloping detectors, one for each portal ID. Each then sets the sendtor_active variable to something different so the script can tell them apart. But perhaps your method is easier. I'm looking forward to seeing what you made!
Correct, I made prop_portals and named them. Like I said there's probably a better way, but this was simplest to implement.
I am finishing it up, then i'll upload.

Quote from Groxkiller585 on June 5, 2012, 8:19 pmHere be the download link:
https://dl.dropbox.com/u/18219413/maps/sendificate_0_v3_src.zip
Contains the coop-compatible instances (all you really need to do is make sure logic_autos also have the same outputs but for OnMultiNewMap instead), a coop version of the test map and the new edited script, as well as what was in there previous.
Here be the download link:
https://dl.dropbox.com/u/18219413/maps/sendificate_0_v3_src.zip
Contains the coop-compatible instances (all you really need to do is make sure logic_autos also have the same outputs but for OnMultiNewMap instead), a coop version of the test map and the new edited script, as well as what was in there previous.

Quote from HMW on June 9, 2012, 9:56 amNice work! I found one bug: both portals only transfer the beam in one direction (cyan to blue and yellow to red respectively). I think this is because of their order in the array and the fact that you skip over each player's second portal while scanning.
I changed the implementation slightly:
tech details
[spoiler]The value type of the "sendtor_active" attribute has been changed from yes/no to a number. -1 means that the portal is closed, any number >= 0 means the portal is open, and that number is its linkage ID. The different portal detectors each get different outputs added to them, to set this up correctly.When a beam trace starts, the script first builds an array containing all active portals and their IDs, in no particular order. When searching for a portal's partner, it just searches through that array until it finds a portal with a matching ID, that is not the "incoming" portal. (If no match is found, it means that the initially detected portal currently has no active partner, so we should disregard it.)
The nice thing about this is that it's not specific to coop. You could just as easily make a SP map with two sets of portals (like Mevious and Omnicoder have done), or have as many pairs open at once as the engine will allow without tripping over itself, if you so desire. As long as you add a detector for each ID you use, it will just work.[/spoiler]
By the way, I found out that "OnMapSpawn" does get triggered in coop, at least in splitscreen mode. So I'm holding off on duplicating all of the logic_auto outputs for now.As soon as I'm done with the beam effect tweaks, I'll upload a new version of the source code.
Again, thanks for your help with this!
Nice work! I found one bug: both portals only transfer the beam in one direction (cyan to blue and yellow to red respectively). I think this is because of their order in the array and the fact that you skip over each player's second portal while scanning.
I changed the implementation slightly:
tech details
When a beam trace starts, the script first builds an array containing all active portals and their IDs, in no particular order. When searching for a portal's partner, it just searches through that array until it finds a portal with a matching ID, that is not the "incoming" portal. (If no match is found, it means that the initially detected portal currently has no active partner, so we should disregard it.)
The nice thing about this is that it's not specific to coop. You could just as easily make a SP map with two sets of portals (like Mevious and Omnicoder have done), or have as many pairs open at once as the engine will allow without tripping over itself, if you so desire. As long as you add a detector for each ID you use, it will just work.
By the way, I found out that "OnMapSpawn" does get triggered in coop, at least in splitscreen mode. So I'm holding off on duplicating all of the logic_auto outputs for now.
As soon as I'm done with the beam effect tweaks, I'll upload a new version of the source code.
Again, thanks for your help with this!
Other Portal 2 maps: Medusa Glare
Portal 1 maps: Try Anything Twice | Manic Mechanic
Quote from Groxkiller585 on June 9, 2012, 12:51 pmHMW wrote:Nice work! I found one bug: both portals only transfer the beam in one direction (cyan to blue and yellow to red respectively). I think this is because of their order in the array and the fact that you skip over each player's second portal while scanning.I changed the implementation slightly:
tech details
[spoiler]The value type of the "sendtor_active" attribute has been changed from yes/no to a number. -1 means that the portal is closed, any number >= 0 means the portal is open, and that number is its linkage ID. The different portal detectors each get different outputs added to them, to set this up correctly.When a beam trace starts, the script first builds an array containing all active portals and their IDs, in no particular order. When searching for a portal's partner, it just searches through that array until it finds a portal with a matching ID, that is not the "incoming" portal. (If no match is found, it means that the initially detected portal currently has no active partner, so we should disregard it.)
The nice thing about this is that it's not specific to coop. You could just as easily make a SP map with two sets of portals (like Mevious and Omnicoder have done), or have as many pairs open at once as the engine will allow without tripping over itself, if you so desire. As long as you add a detector for each ID you use, it will just work.[/spoiler]
By the way, I found out that "OnMapSpawn" does get triggered in coop, at least in splitscreen mode. So I'm holding off on duplicating all of the logic_auto outputs for now.As soon as I'm done with the beam effect tweaks, I'll upload a new version of the source code.
Again, thanks for your help with this!Like I said, there was probably a better way. Glad to know you found it!
OnMapSpawn works in ss_map, but not real coop. (ss_map is like a mix of sp and coop: certain things work there that will not (or are not garenteed to) in real coop. OnMapSpawn is one of things, which I found out while testing it extensively for a coop map I am making.)
I changed the implementation slightly:
tech details
When a beam trace starts, the script first builds an array containing all active portals and their IDs, in no particular order. When searching for a portal's partner, it just searches through that array until it finds a portal with a matching ID, that is not the "incoming" portal. (If no match is found, it means that the initially detected portal currently has no active partner, so we should disregard it.)
The nice thing about this is that it's not specific to coop. You could just as easily make a SP map with two sets of portals (like Mevious and Omnicoder have done), or have as many pairs open at once as the engine will allow without tripping over itself, if you so desire. As long as you add a detector for each ID you use, it will just work.
By the way, I found out that "OnMapSpawn" does get triggered in coop, at least in splitscreen mode. So I'm holding off on duplicating all of the logic_auto outputs for now.
As soon as I'm done with the beam effect tweaks, I'll upload a new version of the source code.
Again, thanks for your help with this!
Like I said, there was probably a better way. Glad to know you found it!
OnMapSpawn works in ss_map, but not real coop. (ss_map is like a mix of sp and coop: certain things work there that will not (or are not garenteed to) in real coop. OnMapSpawn is one of things, which I found out while testing it extensively for a coop map I am making.)

Quote from HMW on June 11, 2012, 12:42 pmGroxkiller585 wrote:OnMapSpawn works in ss_map, but not real coop. (ss_map is like a mix of sp and coop: certain things work there that will not (or are not garenteed to) in real coop. OnMapSpawn is one of things, which I found out while testing it extensively for a coop map I am making.)Oh I see, good that you mention that. I'll include both outputs then.
Other question: does the per-map particle manifest no longer work in Portal 2?
I was trying to add a custom particle system for the beam effect, but it only works if the file is in the global particles_manifest.txt file. I also checked with Process Monitor if the game searches for any other map-specific file of that nature and found nothing. Would be a real bummer if that no longer works.
Oh I see, good that you mention that. I'll include both outputs then.
Other question: does the per-map particle manifest no longer work in Portal 2?
I was trying to add a custom particle system for the beam effect, but it only works if the file is in the global particles_manifest.txt file. I also checked with Process Monitor if the game searches for any other map-specific file of that nature and found nothing. Would be a real bummer if that no longer works.
Other Portal 2 maps: Medusa Glare
Portal 1 maps: Try Anything Twice | Manic Mechanic
Quote from Groxkiller585 on June 11, 2012, 10:09 pmHMW wrote:Groxkiller585 wrote:OnMapSpawn works in ss_map, but not real coop. (ss_map is like a mix of sp and coop: certain things work there that will not (or are not garenteed to) in real coop. OnMapSpawn is one of things, which I found out while testing it extensively for a coop map I am making.)Oh I see, good that you mention that. I'll include both outputs then.
Other question: does the per-map particle manifest no longer work in Portal 2?
I was trying to add a custom particle system for the beam effect, but it only works if the file is in the global particles_manifest.txt file. I also checked with Process Monitor if the game searches for any other map-specific file of that nature and found nothing. Would be a real bummer if that no longer works.I haven't tested pakratting it in, but it might work. (Although pakrat doesn't look for a _particles.txt file for your map, which might be a bad omen...)
Oh I see, good that you mention that. I'll include both outputs then.
Other question: does the per-map particle manifest no longer work in Portal 2?
I was trying to add a custom particle system for the beam effect, but it only works if the file is in the global particles_manifest.txt file. I also checked with Process Monitor if the game searches for any other map-specific file of that nature and found nothing. Would be a real bummer if that no longer works.
I haven't tested pakratting it in, but it might work. (Although pakrat doesn't look for a _particles.txt file for your map, which might be a bad omen...)

Quote from HMW on June 17, 2012, 2:19 pmNew version is up! I did it without custom particles; just re-used the one for the tractor beam
The workshop description has a link to the current source code.
Again, thanks for helping out with the coop support, Grox!
New version is up! I did it without custom particles; just re-used the one for the tractor beam
The workshop description has a link to the current source code.
Again, thanks for helping out with the coop support, Grox!
Other Portal 2 maps: Medusa Glare
Portal 1 maps: Try Anything Twice | Manic Mechanic
Quote from Groxkiller585 on June 19, 2012, 8:19 pmHMW wrote:New version is up! I did it without custom particles; just re-used the one for the tractor beam![]()
The workshop description has a link to the current source code.
Again, thanks for helping out with the coop support, Grox!Glad I could help!

The workshop description has a link to the current source code.
Again, thanks for helping out with the coop support, Grox!
Glad I could help!

Quote from FelixGriffin on July 7, 2012, 3:37 pmBy the way, couldn't you do it without the portal detector? Use a logic_playerproxy, then you have OnPrimaryPortalPlaced and OnSecondaryPortalPlaced outputs.
By the way, couldn't you do it without the portal detector? Use a logic_playerproxy, then you have OnPrimaryPortalPlaced and OnSecondaryPortalPlaced outputs.
Quote from HMW on July 7, 2012, 4:17 pmNo, because I also need to know when a portal closes. (Either via fizzlers or because of other reasons, e.g. moving surface.)
However, I didn't know about those outputs, so thanks for the tip! They might come in handy some time.
No, because I also need to know when a portal closes. (Either via fizzlers or because of other reasons, e.g. moving surface.)
However, I didn't know about those outputs, so thanks for the tip! They might come in handy some time.
Other Portal 2 maps: Medusa Glare
Portal 1 maps: Try Anything Twice | Manic Mechanic