Package Issue

Post » Tue Apr 27, 2010 4:58 pm

Help me, please. I haven't been working in the GECK long enough to really know enough to get myself out of this particular jam I'm in and I'm hoping someone can help me out because I'm a little frustrated with the results I've gotten and want to understand why it's not working. So here's what's up:

I'm working on a mod to completely revamp Charon. That's going really well and one of the things I wanted to do was add some useful stimming to his repetoire. I started with an option that I triggered with dialogue when he got hurt out of combat with mines or whatever and that went great. It ran the idle and I reset his health in the results script and it was perfect. Later, as I learned more about the GECK, I decided to try my hand at having him stim during combat. This is where I've run into problems. I have ended up with four packages. They are all Use Item At packages and I'm using the Beginning tab to trigger the idle I want and to put the restore health info into the results script. It works great in TWO of the packages. I have messages in there for now that pop up so I know it is all working, plus I test it while looking at his HP bar. The two packages that work are the ones that do not happen during combat (I have two for different levels of HP). If I take a shot at him (not combat) the results script runs, the message pops up, and, most imporantly to me, I restore his health to the level I want. I'd prefer he didn't attempt to heal himself with a "true" stimpak, really, as they just don't do enough for the job. Anyway, the other two packages, which are conditioned to be used in combat won't run the results script. The idles run perfectly, he stims himself, and as I watch his health bar I see his health go up, but it only goes up the amount of the stimpak, of course, because the result script isn't triggering. I just have no idea WHY this is happening. I don't think it's his default stimming because I've never actually seen that, because it happens faster and he holds his hands in a different location although his HP goes up the same amount afterwards. I took him out and made him do it in combat without any packages so I could see the differences so I'm pretty certain he's using my idle which means my package is working to that degree, but the results script isn't triggering. I could be wrong of course. And it seems weird that the results script wouldn't be triggering in both packages. Ugh. I've thought about this too much and just don't know enough.

Any thoughts on this would be welcome. Thanks :)
User avatar
Mr.Broom30
 
Posts: 3433
Joined: Thu Nov 08, 2007 2:05 pm

Post » Wed Apr 28, 2010 2:25 am

I thought I could help you with this as I did the very same thing for a custom follower. However, I did it in a completely different way - basically, by script. So I did not use and begin/end/change results scripts. What happens if you use the console in-game while he his using your combat package to stim and check the GetCurrentAIPackage & GetCurrentAIProcedure commands? That will definitely tell you if your package is active or not. It really doesn't make sense that a package will start and the Begin script doesn't fire. I could see and End script failing, but not a begin one.
User avatar
Amie Mccubbing
 
Posts: 3497
Joined: Thu Aug 31, 2006 11:33 pm

Post » Wed Apr 28, 2010 3:29 am

I thought I could help you with this as I did the very same thing for a custom follower. However, I did it in a completely different way - basically, by script. So I did not use and begin/end/change results scripts. What happens if you use the console in-game while he his using your combat package to stim and check the GetCurrentAIPackage & GetCurrentAIProcedure commands? That will definitely tell you if your package is active or not. It really doesn't make sense that a package will start and the Begin script doesn't fire. I could see and End script failing, but not a begin one.


I was hoping you'd be around to say something about my problem. I haven't actually checked the package in the console (d'oh!) although that makes the most sense to do so. I sometimes forget that the console is my friend and get caught up playing to test things. I'll have to go check that out here in a little while. Feedback is great, isn't it? Thanks so much. :)
User avatar
Sara Lee
 
Posts: 3448
Joined: Mon Sep 25, 2006 1:40 pm

Post » Wed Apr 28, 2010 4:01 am

Well, I have done a ton of things with followers. Charon in my mod runs up to YOU and stims you when you get hurt, hehe


Be aware that if you're using the latest fallout patch (1.7), Charon will stim himself with the native AI. He doesn't make himself invincible like the player does, and as you probably noticed, it involves a lengthy animation playing for each stim.

IMO what you are trying to do should not be done through AI packages, I suspect it is best done by script.

If you really want to make Charon perform like the player does with stims, you could put this into his object script - I think I have the code right:

(gamemode block)if gethealthpercentage < .5	 if getitemcount stimpak		  resethealth		  removeitem stimpak 1	 endifendif


That sounds like what you want to do, although you wanted the idle to play. That could be worked in, I think, if you really wanted it. This is also not the only way to script it or the only place to put code like this. I just think that AI package is going to be a bigger pain than it's worth and script gets it done better.

I personally do not do this to Charon or anything like it. I force the player to stim him if he gets into trouble instead of speeding up his personal stim behavior because I'm emulating what followers did in Fallout 2. But you could do it whatever way you want of course, depending upon your goals.
User avatar
Eileen Müller
 
Posts: 3366
Joined: Fri Apr 13, 2007 9:06 am

Post » Wed Apr 28, 2010 3:27 am

In case your interested, this is the script I used:

	If (vHeal == 0)			;Stim use can only occur if vHeal = 0 - so it won't run again unitl the whole sequence is finished		If (GetHealthPercentage < HealLevel) && (Getitemcount Stimpak >= 1)			If (IsInCombat)				Set vHeal to 1;heal package condition variable for combat			Else				Set vHeal to 2;heal package condition variable for non-combat			Endif			Set UsingStim to 1;prevents total heal after combat for pretend in combat (non-combat heal package)			Set Timer to 5	;animation duration = package duration			evp				;start animation package		Endif	Else		Set Timer to Timer - GetsecondsPassed	Endif	If (vHeal >= 1) && (Timer <= 0);this ends the animation package after 5 seconds;		Showmessage ucdebug2		CIOS Stimpak				;apply the stimpak		removeitem stimpak 1	;remove the stimpak from Vega's inventory		Set vHeal to 0				;allow the process to run again - packages won't evaluate when vHeal =0		evp							;resume normal AI	Endif


HealLevel is set up in dialogue and coresponds to when she should use stimpaks - when hurt a little, average, bad, etc...
I had to use two AI packages to play the stiming idle, one for in combat and one for non-combat becasue the stim idle would not fire while in combat. The combat package just has the continue during combat flag checked and the non combat package has the pretend in combat flag checked. The one major draw back to my version is the time it takes to self stim while in combat often leads to more damage being done than the stimpak heals, but that is easily overcome.
User avatar
Dina Boudreau
 
Posts: 3410
Joined: Thu Jan 04, 2007 10:59 pm

Post » Tue Apr 27, 2010 4:55 pm

Well, I have done a ton of things with followers.


Ya, I know, I think of you as the king. I have probably read just about everything you've written in the forum during the past few weeks while trying to learn how to use the GECK. I love K-9 (I laughed and laughed at the Molerat meat gift), and what you did with the two containers on the followers. Brilliant. I cannot say how much I hate the way they put on whatever you give them (I'm looking at you Charon and your love of all things Power Armor) that's questionably better than what they are wearing. Makes me nuts. Thanks so much for the input. I might try the script route. I was mostly trying to do it because I could now that I'm getting more comfortable with the GECK. Really if he didn't stim during combat it wouldn't kill me. What's bugging me more than anything is that it isn't working and I don't know why it isn't working.

Be aware that if you're using the latest fallout patch (1.7), Charon will stim himself with the native AI. He doesn't make himself invincible like the player does, and as you probably noticed, it involves a lengthy animation playing for each stim.


No, I didn't see that! I know the companions stim because I've played with them for hundreds of hours and have always given them stimpaks that they used, but it was on the 360 so I didn't have much chance to really figure out what was going on. What I did now with Charon was I took him out and ran him through combat and shot him myself (along with the Raiders) to get his health down far enough, and although his hands went low in the front of his body and he was still for a bit, I didn't see the stim. It was unmistakable what he was up to though because I was watching his HP bar the entire time.



pkleiss Posted Today, 12:20 PM
I had to use two AI packages to play the stiming idle, one for in combat and one for non-combat becasue the stim idle would not fire while in combat. The combat package just has the continue during combat flag checked and the non combat package has the pretend in combat flag checked. The one major draw back to my version is the time it takes to self stim while in combat often leads to more damage being done than the stimpak heals, but that is easily overcome.


Thanks for sharing your script. I don't know if I'll bother to try and script a solution or not if I can't get the packages to work. Ya, Charon's idle is showing up well during combat but it isn't the complete idle. I can live with that, although sometimes it leads to funny results, like today he was holding his weapon and the stimpak at the same time, in the same hand, but usually it is just the stimpak. But, ya, it doesn't look as good, I'm sure, as the full idle does. Ideally he would retreat to a safe distance, use the full idle, and then reengage. But that is beyond me to implement at this point. Or beyond me wanting to try anyway. I'm not sure I'm that motivated to make him that completely good. I don't use stimpaks in combat and I wouldn't want him to ideally. I'd rather he was more like the PC, and less wimpy in comparison, because the PC is just too good, if you know what I mean, but that's another story. Although, now that I'm actually typing it out I might have to figure out a way to make this work instead.

But anyway, I did as you so wisely counseled and I went and while he was stimming did GetCurrentPackage and GetCurrentProcedure and he was using the two working packages during combat and when I just shoot him. He wasn't touching the other two packages at all. So this is weirder as the results packages don't fire during combat but do otherwise. I thought, then, that maybe the other packages were making things weird so I removed them from his list and went to a save way back in time and place and then went back to the Mall to fight Muties for fun. Anyway, the packages execute fully and properly if I shoot him myself and he stims quite nicely during combat but the results scripts don't trigger. I checked and it's definitely the same packages during all occurences of stimming.

I might just give up on the combat idea. Or maybe not have him stim under .5 health. I've beefed up his health to make him more comparable to the PC so this was really just for looks more than anything else. If I up his Medicine skill to 100 each stim does heal him more. I might just go with that and have him only stim himself above .5 HP for now and leave it at that.

I'd love to ask you another question or two now that I have you here though.

1) I am having trouble with idles completing in results scrips as they are being swallowed by the animations in the packages being used by the NPCs at the time. So, for instance, I'm experimenting with companions having conversations among themselves while they are following the PC. I have one right now between Charon and Jericho in which Charon hands Jericho a beer and he drinks it. Never has the entire idle for drinking the beer played because Jericho is walking around in the package that comes before/after the dialogue and the idle gets cut off. This sometimes happens to Charon's stimming idle in dialogue because I've also added idles to his Follow packages so that he isn't standing around like a cardboard cutout all the time. How do I go about making that stop? I guess I'm not sure what I need to do to make it happen. I'm not actually sure what I'm delaying. I guess the resumption of the package. Or how do I give the idle more time? Would I go about it the way you've given Vega's stimpak idle more time?

2) I cannot find anywhere what console command I need to find out what combat style a NPC is currently using. Can you point me in the right direction to find this? Or tell me?



Thanks guys. It was great to have you both come in to help me out today. I've read so much by both of you since the beginning of the year when I seriously started working on my mod. You've helped me out tremendously throughout the last few weeks and I just want you to know that your input to the forum has really helped me learn a lot :)
User avatar
Emily Rose
 
Posts: 3482
Joined: Sat Feb 17, 2007 5:56 pm

Post » Tue Apr 27, 2010 12:37 pm

What you are describing was the biggest hurdle I had to overcome with my stim script. Ultimately, I had to use seperate packages where the package itself was set to play the idle(s) from the idles tab versus from the results scripts. As an example, when I wanted my follower to stim while in combat, I had to drop her out of combat with a new package that ignored normal combat behavior. Packages in general get overridden by combat situations, and the idle that I wanted to use wouldn't work during combat. So, I added a package that kept her out of combat (even though she was still being fired upon), that package's sole purpose was to play the idle and ignore everything else, then I made her resume normal behavior. Of couse, I subsequently learned that you can change the default conditions of idles (yes, they have default conditions already on them) by making copies and changing the default conditions under Game Play --> Idle Animations.

So for your issue, I would add a package to each follower for the sequence that controls their behavior completely and then resumes normal AI behavior when finished. That way, even if you walk away, their default follow package (or combat situations, etc..) won't interfere.
User avatar
Melis Hristina
 
Posts: 3509
Joined: Sat Jun 17, 2006 10:36 pm

Post » Tue Apr 27, 2010 10:19 pm

It's good if my ramblings on this place have been helpful in some way!

I find animations to be a pain in the ass and I am not so great at them. I've tried to use them a few times.. well twice to be exact... it didn't work out so great, I think one of the things sorta worked, but it was troublesome, and ... like, the one I thought sorta worked actually had a chance of NOT working.. bah. * shoots self*

And there's an animation I try to sorta use in Phalanx but it's broken. And I have to redesign it sometime.. and I just haven't. That's a consequence of svcking so bad at animations, I guess.
User avatar
gary lee
 
Posts: 3436
Joined: Tue Jul 03, 2007 7:49 pm

Post » Wed Apr 28, 2010 4:53 am

Of couse, I subsequently learned that you can change the default conditions of idles (yes, they have default conditions already on them) by making copies and changing the default conditions under Game Play --> Idle Animations.


That is really cool and good to know and might help me with something else I was trying to do. Thx! I may just let the idles be funky and short if pkgs is the way to fix them. Gawd, how I hate packages. I have several new ones now on Charon and they have been such a pain in the butt. It seems like for every one or two I get working I have another one that goes all FUBAR and takes an entire day to get working right or never works or makes me nutz in some other way. Ugh.

However, having said that, your explanation is very helpful and I'll try to see what I can do with the ones I have running. The convo I have between Charon and Jericho is package driven so maybe I can get that working better using what you've told me. Thanks very much for your help. :)
User avatar
i grind hard
 
Posts: 3463
Joined: Sat Aug 18, 2007 2:58 am


Return to Fallout 3