Creating a new NPC and Level Design By A Newb

Avatar
CamBen
973 Posts
Posted May 07, 2013
Replied 6 hours later
Set the ball's rendermode to 10, it will render it invisible but still have physics.
Advertisement
Registered users don’t see ads! Register now!
Avatar
BlackWolfe
55 Posts
Posted May 08, 2013
Replied 6 hours later

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

Avatar
BlackWolfe
55 Posts
Posted May 09, 2013
Replied 1 day later
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.

Avatar
FelixGriffin
2,680 Posts
Posted May 09, 2013
Replied 7 hours later
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.

Avatar
BlackWolfe
55 Posts
Posted May 09, 2013
Replied 11 minutes later

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.

Avatar
FelixGriffin
2,680 Posts
Posted May 09, 2013
Replied 54 minutes later
Learning something like JavaScript or C++ syntax would be a good first step, I'll see if I can find a good tutorial.
Avatar
BlackWolfe
55 Posts
Posted May 09, 2013
Replied 23 minutes later

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

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.

Avatar
FelixGriffin
2,680 Posts
Posted May 09, 2013
Replied 4 hours later
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.
Avatar
BlackWolfe
55 Posts
Posted May 10, 2013
Replied 1 hour later

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.

Avatar
lord_blex
96 Posts
Posted May 19, 2013
Replied 9 days later
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 :smile:
Avatar
BlackWolfe
55 Posts
Posted May 20, 2013
Replied 18 hours later

lord_blex wrote:
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 :smile:

I've put P-Body aside for the moment in favor of getting the actual physical level built, but am about to hit that part of the level. The idea is to have all of those level portions completely scripted so that I can simply move P-Body around through the use of func_movelinear and similar brush entities. Animation will be handled by P-Body being a prop_dynamic_override.

It's not (remotely) pretty, but it should work. I'm thinking I'll handle facing by having a bunch of info_targets and parenting P-Body to a func_tank.

Avatar
ChickenMobile
2,460 Posts
Posted May 22, 2013
Replied 1 day later

BlackWolfe wrote:
I'm thinking I'll handle facing by having a bunch of info_targets and parenting P-Body to a func_tank.

:(
I thought you were on the bleeding edge here!

Avatar
BlackWolfe
55 Posts
Posted May 22, 2013
Replied 5 hours later

ChickenMobile wrote:
BlackWolfe wrote:

I'm thinking I'll handle facing by having a bunch of info_targets and parenting P-Body to a func_tank.

:(
I thought you were on the bleeding edge here!

It bled out. :notwant:

I think the problem is that P-Body's action names aren't NPC action names. They all have the MP tag in the name, indicating that it's a multiplayer player action. If I can decompile and recompile a new version with standard NPC actions...

Except I have no idea how to decompile a model...

Actually, yeah, I like that idea a whole lot better if I can make it work.

Somehow.

Avatar
lord_blex
96 Posts
Posted May 22, 2013
Replied 39 minutes later

BlackWolfe wrote:
Except I have no idea how to decompile a model...

Read this.

Avatar
FelixGriffin
2,680 Posts
Posted May 22, 2013
Replied 9 minutes later
Don't bother, the more complex the joints are the worse it will be affected by the decompiler. Any sort of humanoid will be damaged beyond repair.

But it should be possible to use those activities nonetheless. I don't know why they wouldn't work. Chell in both games has the multiplayer activities, but they can be used to animate her in Portal 1.

Advertisement
Registered users don’t see ads! Register now!
Avatar
BlackWolfe
55 Posts
Posted May 22, 2013
Replied 1 hour later

FelixGriffin wrote:
Don't bother, the more complex the joints are the worse it will be affected by the decompiler. Any sort of humanoid will be damaged beyond repair.

But it should be possible to use those activities nonetheless. I don't know why they wouldn't work. Chell in both games has the multiplayer activities, but they can be used to animate her in Portal 1.

The problem I'm experiencing is that I can trigger activities and sequences no problem using scripted sequences, but when attempting to have the character move from one sequence to the next, it's just teleporting it to that spot. I've tried using the custom movement type, but it didn't affect a thing.

I'll try again and record a demo of it to show what the result is.