How do I get this to work?

Post » Mon Nov 08, 2010 9:30 am

I've made changes to the default Stimpak so that I can't heal my limbs during combat or if my general health is at 100%. But that doesn't prevent me from wasting a Stimpak if I try to use it under those circumstance, so I'd like to at least have a warning message be displayed while those conditions are being met. I had a look at the Wiki, and I figured this would work but it doesn't:

scn a2zWarnHealingSCRIPTBegin MenuMode 1003	if GetIsUsedItem Stimpak && player.isincombat		ShowMessage a2zCombatWarnHealing	endif	if GetIsUsedItem Stimpak && player.GetHealthPercentage == 1		ShowMessage a2zHealthWarnHealing	endifEnd


I've made this a Quest script BTW. I also tried it as an object script and placed it on the Stimpak but that didn't work either. Now I wasn't in combat at the time I tested it but I was at 100% health and no message was displayed, so I'm not sure what I'm doing wrong here. And I just tried setting the health value at .9999, since I've run into issues with just using 1 before but that didn't help either.
User avatar
Mari martnez Martinez
 
Posts: 3500
Joined: Sat Aug 11, 2007 9:39 am

Post » Mon Nov 08, 2010 12:19 pm

And here's another one that's not working:

scn a2zDamageMedikeitScriptBegin GameMode	if GetIsUsedItem Stimpak || GetIsUsedItem Stimpaknew && player.GetEquipped FirstAidKit		player.ModWeaponHealthPerc -100	endifEndBegin MenuMode	if GetIsUsedItem Stimpak || GetIsUsedItem Stimpaknew && player.GetEquipped FirstAidKit		player.ModWeaponHealthPerc -100	endifEnd


Is GetIsUsedItem the wrong function to be using? If so, what should it be? I couldn't really see anything else that would apply.
User avatar
Toby Green
 
Posts: 3365
Joined: Sun May 27, 2007 5:27 pm

Post » Mon Nov 08, 2010 9:23 am

Anyone?
User avatar
Neko Jenny
 
Posts: 3409
Joined: Thu Jun 22, 2006 4:29 am

Post » Mon Nov 08, 2010 12:08 am

I've made this a Quest script BTW. I also tried it as an object script and placed it on the Stimpak but that didn't work either.

GetIsUsedItem should work, but it should be Player.GetIsUsedItem if the script is in anything other than a worn attachment to the player. Same thing goes for ShowMessage.. if the script isn't attached to the player somehow, it has no way of knowing who to show the message to.
User avatar
Claire Mclaughlin
 
Posts: 3361
Joined: Mon Jul 31, 2006 6:55 am

Post » Mon Nov 08, 2010 9:07 am

GetIsUsedItem should work, but it should be Player.GetIsUsedItem if the script is in anything other than a worn attachment to the player. Same thing goes for ShowMessage..


I did try Player.GetisUsedItem, though I never thought about the message. I'll give that a try.

PS: No, it didn't make any difference. I tried adding Player. to both scripts where ever possible and neither of them are doing anything in the game. The scripts both save as valid, but they have no effect in the game itself. I'd really like to figure this out, it's been bugging me for over a year now. I've asked a couple of people to whip up a script for me but they didn't come through. Now that I'm starting to get a grip on scripting myself I figured I'd give it a try.
User avatar
Steven Hardman
 
Posts: 3323
Joined: Sun Jun 10, 2007 5:12 pm

Post » Mon Nov 08, 2010 2:27 am

Do you have it back as a quest script? It's probably not going to work if it's in the stimpack as they get added to and removed when consumed right from the inventory (which is not reliable for scripts).

Edit: Also, on the first script you have it set to only run if you have the pipboy stat screen up (thats what 1003 is, the stats screen). That should really be a GameMode block on a quest script.

Edit2: For the second script, "player.ModWeaponHealthPerc -100" is damaging his current weapon (drawn or not), not the first aid kit. For that to affect the first aid kit, the kit must be of type:weapon, and also equipped IN PLACE OF the current gun or whatever. It'd probably be better to check if he even has a first aid kit with player.GetItemCount, then if you want to damage it, remove the one he has and replace it with one that already has a lower health percent set via the geck. That wouldn't work of course if the player has more than just one kit though.
User avatar
brenden casey
 
Posts: 3400
Joined: Mon Sep 17, 2007 9:58 pm

Post » Mon Nov 08, 2010 4:34 am

Do you have it back as a quest script? It's probably not going to work if it's in the stimpack as they get added to and removed when consumed right from the inventory (which is not reliable for scripts).


Yes, they're both Quest scripts.

Edit: Also, on the first script you have it set to only run if you have the pipboy stat screen up (thats what 1003 is, the stats screen). That should really be a GameMode block on a quest script.


No, that menu is where I want to have it run. The messages should only come up if I'm trying to heal my limbs, not if I'm just using the Stimpak. I can still heal my general health if I'm in combat, just not my limbs, and the game already gives me a full health message if I try to use it other than for healing my limbs. So that script only needs to run in the Stats menu, nowhere else. The other script needs to be able to run in both menu and game mode, since sometimes I use those items while in the game world, and other times through the Pipboy menu.

For the second script, "player.ModWeaponHealthPerc -100" is damaging his current weapon (drawn or not), not the first aid kit. For that to affect the first aid kit, the kit must be of type:weapon, and also equipped IN PLACE OF the current gun or whatever.


The first aid kit, or Medic Kit actually, is a weapon and it is equipped. I've created an item based on a weapon type that accounts for 50% of my healing potential, using the GetEquipped FirstAidKit condition on my Stimpaks. Since it is a weapon, I can't shoot and get the full benefit of my Stimpaks at the same time. The 50% healing that the Kit allows also does not kick in during combat, I have to wait until after the battle to get the full benefit. So that script as I have it will insure that only the Medic Kit that is equipped gets damaged by using Stimpaks, not any others that may be in my inventory. I've included a repair list using all the medical clutter and other Medic Kits to repair it if gets too low. If I can get this to work, I might even toss in reduced healing potential depending on the repair state of the Kit.
User avatar
Hayley O'Gara
 
Posts: 3465
Joined: Wed Nov 22, 2006 2:53 am

Post » Sun Nov 07, 2010 10:20 pm

Ok, that's cool, just wasn't sure that's what you wanted as I've never really used that menu for anything.

Ahh there's the missing context. I dunno then man, it looks to me like you have it setup right for the kit to get damage when a stimpack or stimpacknew + equipped medkit gets used. As long as you have player in front of all the commands, my suggestion tank is on empty too. I also can't test anything because I don't actually have FO3 installed at the moment.
User avatar
Tai Scott
 
Posts: 3446
Joined: Sat Jan 20, 2007 6:58 pm

Post » Mon Nov 08, 2010 8:12 am

Yeah, I don't understand why it's not working, logically it should. Maybe I should try with some Short definitions instead of using the formulas directly. Or maybe just an elseif condition with the damage part.
User avatar
Red Bevinz
 
Posts: 3318
Joined: Thu Sep 20, 2007 7:25 am

Post » Mon Nov 08, 2010 12:15 am

Well I tried the damage script this way but it's not working either:

scn a2zDamageMedikeitScriptshort SuperStimpakUsed short StimpakUsedshort MedikeitEquippedBegin GameMode	set SuperStimpakUsed to player.GetIsUsedItem Stimpak	set StimpakUsed to player.GetIsUsedItem Stimpaknew	set MedikeitEquipped to player.GetEquipped FirstAidKit	SetQuestDelay a2zDamageMedikeitQuest .01	if SuperStimpakUsed && MedikeitEquipped		player.ModWeaponHealthPerc -50	elseif StimpakUsed && MedikeitEquipped		player.ModWeaponHealthPerc -50	endifEndBegin MenuMode	set SuperStimpakUsed to player.GetIsUsedItem Stimpak	set StimpakUsed to player.GetIsUsedItem Stimpaknew	set MedikeitEquipped to player.GetEquipped FirstAidKit	SetQuestDelay a2zDamageMedikeitQuest .01	if SuperStimpakUsed && MedikeitEquipped		player.ModWeaponHealthPerc -50	elseif StimpakUsed && MedikeitEquipped		player.ModWeaponHealthPerc -50	endifEnd

User avatar
Jason King
 
Posts: 3382
Joined: Tue Jul 17, 2007 2:05 pm

Post » Sun Nov 07, 2010 11:03 pm

So does anyone else have any ideas why these aren't working?
User avatar
Myles
 
Posts: 3341
Joined: Sun Oct 21, 2007 12:52 pm

Post » Mon Nov 08, 2010 4:07 am

I'm still hoping someone can lend me a hand on this. I don't know what else to try here.
User avatar
A Dardzz
 
Posts: 3370
Joined: Sat Jan 27, 2007 6:26 pm


Return to Fallout 3