Please or Register to create posts and topics.

Creating a new NPC and Level Design By A Newb

PreviousPage 3 of 4Next

Set the ball's rendermode to 10, it will render it invisible but still have physics.

My YouTube Channel: https://www.youtube.com/user/Camben24
Aperture Science: We do our science asbestos we can!
FelixGriffin wrote:
Really? Children shouldn't affect their parents as far as physics is concerned. Try setting its collisions to Not Solid, sometimes the portalgun decides it doesn't have LoE to the object and drops it if you have a parented model.

CamBen wrote:
Set the ball's rendermode to 10, it will render it invisible but still have physics.

To be on the safe side, I set the prop_dynamic_override's physics to "not solid" and also checked the "disable collisons on spawn" Flag. This, combined with rendermode=10, gave me a personality sphere (currently Wheatley) that can be used on ball buttons and still animate. I'm so happy.

FelixGriffin wrote:
And try a logic_playerproxy or a game_ui. The OnFire... inputs are only for weapon_portalguns, which don't exist once the player grabs them.

logic_playerproxy worked like a charm as well, although instead of checking whether or not the gun's been fired, it checks for successful placement. Actually, I like this better. At the moment, the computer I game on is rendering my demo to TGA files so I can... can.. what the heck.

Okay, this is weird. During gameplay, the weapon-strip point entity worked beautifully. But when I looked up just now, I saw Wheatley being hauled around using the Portal Gun, which is not what happened when I was recording that demo.

Weirdness on demo playback + movie recording, I guess.

It's still being processed by YouTube, but when that's done, here's the video:
http://www.youtube.com/watch?v=rN8Fx-Eq6gU

Quick note: Because the SetParent and ClearParent inputs aren't listed for prop_weighted_cube in Hammer or on the wiki, I became concerned about whether or not this would work. Fortunately, they do function just fine... So I can use him as a ball or attach him to things. Once I figure out how to get him facing away from the plug automatically... Will probably have to create a bit of script for that. If I can, I can also replicate Wheatley's automatic facing the player when held.

My custom model has been scrapped for being grossly inaccurate and entirely too low-poly. It was an ugly thing done from memory. I'm now rebuilding it to be more in the style of the actual cores from the game. My progress so far:

test_render.png

I have to doublecheck at some point, but I think the env_spark isn't parented. On a closer viewing of that video, I see it IS going off, but it appears to be coming from the place I originally put it.

They do work, but parenting always removes solidity on point entities.

And you can do that when you compile the physics model. I'll look up the relevant KVs in a bit.

Falsi sumus crusto!
FelixGriffin wrote:
They do work, but parenting always removes solidity on point entities.

Just while it's parented, or in general? Because this is what I did in my test:
- prop_ball_button_floor::OnPressed, prop_weighted_cube::SetParent !self
- prop_dynamic_overide::Use, prop_weighted_cube::ClearParent

This caused "wheatley" to freeze in place hovering above the button the moment the ball was within its field of influence (if anyone needed proof that the button being pressed was based on proximity and not physics, there it is).

I attempted to use the player_proxy to force a pickup of the ball on that Use (with a delay to give time for the ClearParent to take effect), but either I used the wrong input (I think I accidentally used the "physics gun pickup" input, which naturally wouldn't work) or it's just not something I can do with just inputs and outputs, so you have to use it once to release it from the button's heirarchy and again to pick it up.

Edit: I see I got sidetracked and left out the entire point of the "what I did" part, which was to say that when I interacted with the model after it had been parented, it would drop into the ball button's cup and generally behave like a ball in a ball button. I could pick it up and toss it against shelves and other things just fine.

FelixGriffin wrote:
And you can do that when you compile the physics model. I'll look up the relevant KVs in a bit.

Good to know! In the interim, if anyone out there can direct me to some good scripting references? I have no familiarity with the scripting language, and I may have to (oh, let's face it, I just plain WANT to) do some scripting to get the most out of this design concept.

Learning something like JavaScript or C++ syntax would be a good first step, I'll see if I can find a good tutorial.

Falsi sumus crusto!
FelixGriffin wrote:
Learning something like JavaScript or C++ syntax would be a good first step, I'll see if I can find a good tutorial.

I know C++ syntax fine. What I need is a good consolidated source of information regarding, for example, what functions, properties, methods, etc, can be accessed from a script and how. For example, If I wanted to do the following...

Code: Select all
void ball::FaceOnHeld()
{
  vector TowardsPlayer;
  angle AngleToPlayer;
  TowardsPlayer=vector(me.x,me.y,me.z)-vector(player.x,player.y,player.z);
  yawpitchroll=Vector_to_angle(TowardsPlayer); //Not 100% sure about the class/function names here, but I know Source uses both vectors and yaw/pitch/roll angles
  //while loop for smoothly turning the ball's YPR to match the AngleToPlayer variable
}

...or some such, I would desperately need to know how to get the needed info, what the class names are, what functions exist, etc. Are the script functions called by the same names as the actual source code?

Again, the point of this is to do as much work on my end to minimize the amount of work needed to be done to actually play the level. Best case: If a player can get this level to work just by downloading it from the Workshop from within the game without having to do anything else.

If such a resource is available on the Valve Developer site, I haven't found it. Found plenty of stuff on C++ code behind the scenes, but nothing on scripting.

Edit: Wow, that completely failed at gratitude. Dude, you've been immensely helpful and if you can find that info for me, you will be honored by my descendents for time immemorial.

Oh, awesome, I assumed you didn't know much programming. Here are the functions you can use: https://developer.valvesoftware.com/wiki/List_of_Portal_2_Script_Functions What you probably want for that setangle thing is self.SetAngles(pitch, yaw, roll). The big difference to remember in Squirrel from C++ or JavaScript is that it's weakly typed, make local variables (function scope) with local var = value and global (entity scope) with var <- value.

Falsi sumus crusto!
FelixGriffin wrote:
Oh, awesome, I assumed you didn't know much programming. Here are the functions you can use: https://developer.valvesoftware.com/wiki/List_of_Portal_2_Script_Functions What you probably want for that setangle thing is self.SetAngles(pitch, yaw, roll). The big difference to remember in Squirrel from C++ or JavaScript is that it's weakly typed, make local variables (function scope) with local var = value and global (entity scope) with var <- value.

Oh, wow, I better get started on that statue then. Descendents are gonna need to dance around something.

How are you doing with moving P-Body around? Still not working? I once spent days trying to get her behave, but she wouldn't even want to walk properly.. (as in properly raising her feet when taking a step)
It would be so great to achieve this.. So I'm rooting for you, I hope you get a revelation or something :)

- Science isn't about why, it's about why not!
PreviousPage 3 of 4Next