Need Help With a NPC Scene

Discuss Certain Aspects of Mapping, Modeling, and Coding.
Post Reply
shiftey
npc_combinegunship
npc_combinegunship
Posts: 705
Joined: Thu Oct 09, 2008 4:45 pm
Contact:

Need Help With a NPC Scene

Post by shiftey »

I have an NPC who you must fight until he reaches low health (right now it seems I can only use the HalfHealth I/O). Once he reaches the threshold, he falls to the floor and begs you not to kill him (I already made the vcd file).If you shoot him he dies, otherwise you can press USE and he'll change relationship to ally and start following you around and giving you ammo.

Whats the best way to accomplish all of this? I have already set up the relationship changes, but I can't get him to fall down, talk, then get up and follow when you press USE.

Also, is there a way to set an Output when he reaches a specific health level? Other than "OnHalfHealth."
fug4life
Beta Tester
Beta Tester
Posts: 4093
Joined: Mon Dec 11, 2006 10:35 am

Post by fug4life »

Not sure about the rest but Halfhealth, you might be able to get it to fire the correct output when he reaches a quater (halfhealth again) I know I used to have my striders fire their cannon, and on the Halfhealth output it would keep firing on dividing by 2 until dead.
'I would probably smarten up before you meet Violet'.
'She has zero tolerance for idiots'.

fug's Obsidian files
fug's Obsidian clips
Obsidian wiki
Obsidian Map Database
shiftey
npc_combinegunship
npc_combinegunship
Posts: 705
Joined: Thu Oct 09, 2008 4:45 pm
Contact:

Post by shiftey »

How exactly does that work? Doesn't HalfHealth mean half of the full health?
fug4life
Beta Tester
Beta Tester
Posts: 4093
Joined: Mon Dec 11, 2006 10:35 am

Post by fug4life »

I think if fire only once is not checked.

As a test use a math_counter with a intial Value 0 and max Value of 2 and the npc 'OnHalfHealth counter Add 1'

And have the math_counter turn on a light or sprite or something OnHitMax.
'I would probably smarten up before you meet Violet'.
'She has zero tolerance for idiots'.

fug's Obsidian files
fug's Obsidian clips
Obsidian wiki
Obsidian Map Database
shiftey
npc_combinegunship
npc_combinegunship
Posts: 705
Joined: Thu Oct 09, 2008 4:45 pm
Contact:

Post by shiftey »

This sounds like something that could probably be coded into the fgd.
shiftey
npc_combinegunship
npc_combinegunship
Posts: 705
Joined: Thu Oct 09, 2008 4:45 pm
Contact:

Post by shiftey »

Come on I know you people can give me a good answer to my first post. I mean there are plently of people here who make good maps with NPCs in them.

I suck at NPC scripting, its my weakness and I need some help. Gimme a hand...
DaMaN
npc_combinegunship
npc_combinegunship
Posts: 782
Joined: Tue Nov 07, 2006 12:03 am
Location: Parent's Basement
Contact:

Post by DaMaN »

Umm... I dunno. You can always do the good old "OnHalfHealth SetHealth 100", or better yet "OnHalfHealth mathCounter Add 1" mathCounter "OnMax beginsequence" type thingy. That'd be my way to do it.

I.E.: When the npc is at half health, set it's health to full and add one to a counter.
When the counter hits max, do the sequence.
When you do the sequence, set his health to 1 so the players can easily blow his brains out if they don't want him.

Tada!
Current projects: Return to City 17 and Rising Dead
Also, check out my Blag: http://daman-amappersworld.blogspot.com/
shiftey
npc_combinegunship
npc_combinegunship
Posts: 705
Joined: Thu Oct 09, 2008 4:45 pm
Contact:

Post by shiftey »

Is there a way to hide his health and name while all that is happening?

EDIT: Also, I got the scenes to work, but I have two questions:

1. How does the player downloading my map get the scene files working? Don't they need to build the scenes.image file?

2. How do I make my npc squadmate not a complete retard? As it is right now he can only figure out how to follow me or my commands if its within 5 ft of him and there isn't anything in his way. He gets stuck running into a takeout box...it's quite depressing. info_nodes? I hope not :'(
shiftey
npc_combinegunship
npc_combinegunship
Posts: 705
Joined: Thu Oct 09, 2008 4:45 pm
Contact:

Post by shiftey »

My previous post still applies. I haven't found an answer to those ^^^. But I have another question regarding this NPC, so I didn't think it necessary to start another post seeing how I make like 100 threads a day.

Anyway..I set up nodes and checked them in game and they work fine which fixes problem #2 from the above post. However, he sometimes gets stuck on prop_physics or npc_turrets that are nearby and he doesn't follow the player. Is there a way to help him navigate better? Like push obstacles out of his way or shoot them?
Deathy
npc_metropolice
npc_metropolice
Posts: 255
Joined: Sun Jun 10, 2007 8:42 pm
Location: Germany
Contact:

Post by Deathy »

I think pakratting the scenes.image should be enough (1st answer).

Make him nocollide to the physics objects.. I think you can do this with logic_collision_pair.
Image
oc_28-seconds-later_b2 (90% - on halt)
Blues
npc_combinegunship
npc_combinegunship
Posts: 740
Joined: Wed Feb 13, 2008 8:47 pm

Post by Blues »

As said about ...many... times, pakratting it won't work.
But we could have someone keeping the scenes.image up to date, like, he adds every new scene of every new map and then uploads the new file for everyone to download.

The problem is that if you put a scenes.image in your obsidian\scenes folder every single HL², Ep1 and Ep2 scene also has to be added to this image file as they would be broken otherwise. (oh and if there's hl:s scenes, they need to be added, too)

Or we could just wait until maybe skidz and hyper got a way around the scenes.image... if they ever will...
Image Image Image

Excuse me for being rude. I'm usually drunk while posting.
User avatar
Neico
Lead Coder
Lead Coder
Posts: 1799
Joined: Tue Aug 15, 2006 3:39 pm
Location: Germany
Contact:

Post by Neico »

i'm already at rebuilding the old vcd load way + scanning scenes.image before reading any vcd so we will provide all default hl hl2 ep1 ep2 (just all games that can be mounted by default) into that file and only let custom maps use the old vcd way

but i doubt that i will get it working before 1.34 comes out tough
Image
Blues
npc_combinegunship
npc_combinegunship
Posts: 740
Joined: Wed Feb 13, 2008 8:47 pm

Post by Blues »

Oh, this is great! :)
Image Image Image

Excuse me for being rude. I'm usually drunk while posting.
Post Reply