Workbench Script - Wep condition issue

Post » Mon Dec 20, 2010 12:08 pm

Oi all,

I created myself a cool weapon, managed to have it work in-game, added it to the workbench to craft, everything's good. Almost. I'm having this issue where with the 1rst schematic, the weapon created is at 0% condition and I can't see what the problem is. When I have the 2nd and 3rd schematics, the condition is at 75% and 100%, roughly (max damage is 20, and it's at 18 and 19, respectively). So, it works but seems not quite there... is the a place I should reference a base condition for the weapon? Other than the countWeaponnameBonus in the weapons SchematicItem check script?

Here's part of the scripts if that helps:

Workbench:
		elseif button == 8			; ADPBaxter			; 1. check for schematics			if GetHasNote SchematicsADPBaxterNote == 0 && GetHasNote SchematicsADPBaxterNote10 == 0 && GetHasNote SchematicsADPBaxterNote20 == 0				ShowMessage SchematicsWorkbenchFailureGenericMsg			else				; 2. check for components				if ( player.GetItemCount WeapBaseballBat > 0 ) && ( player.GetItemCount LawnmowerBlade > 0 ) && ( player.GetItemCount SpareParts > 0 ) && ( player.GetItemCount WhetStone01 > 0 )					; 3. make it					ShowMessage SchematicsWorkbenchSuccessADPBaxterMsg					player.RemoveItem WeapBaseballBat 1 1					player.RemoveItem LawnmowerBlade 1 1					player.RemoveItem SpareParts 1 1					player.RemoveItem WhetStone01 1 1					; calculate condition					set weaponCondition to (weaponCondition * countADPBaxterBonus)					if weaponCondition > 100						set weaponCondition to 100					endif					player.AddItemHealthPercent ADPWeapBaxter 1 weaponCondition					PlaySound UIRepairWeapon					; increment count					ModPCMiscStat "Weapons Created" 1					set countADPBaxter to countADPBaxter + 1					;If the player has made one of each item, add Achievement 40					if countWeapAchievement == 0						if countBottlecap >= 1 && countDartgun >= 1 && countDeathclaw >= 1 && countNuka >= 1 && countRailway >= 1 && countRockit >= 1 && countShishkebab >= 1 && countADPBaxter >= 1 							addachievement 40							set countWeapAchievement to 1						endif					endif				else					; 4. failure message					set item1 to player.GetItemCount WeapBaseballBat					set item2 to player.GetItemCount LawnmowerBlade					set item3 to player.GetItemCount SpareParts					set item4 to player.GetItemCount WhetStone01 					ShowMessage SchematicsWorkbenchFailureADPBaxterMsg, item1, item2, item3, item4					ShowMessage SchematicsWorkbenchMsg				endif			endif				endif


SchematicItem:
]scn SchematicsADPBaxterItemSCRIPTshort AddOnceBEGIN OnAdd player		if (AddOnce == 0)		;If the player already has a copy of the schematic, getting another improves the quality of the created item.		;Second Improvement		if (player.gethasnote SchematicsADPBaxterNote10 == 1)			;Increment a variable for number of times this schematic has been gotten.			set countADPBaxterBonus to 1.25			;Show message of quality improvement.			ShowMessage SchematicsImprovedMsg			player.removeNote SchematicsADPBaxterNote10			player.addNote SchematicsADPBaxterNote20			;Remove this item from inventory			set AddOnce to 1			removeme		;First Improvement		elseif (player.gethasnote SchematicsADPBaxterNote == 1)			;Increment a variable for number of times this schematic has been gotten.			set countADPBaxterBonus to 1			;Show message of quality improvement.			ShowMessage SchematicsImprovedMsg			player.removeNote SchematicsADPBaxterNote			player.addNote SchematicsADPBaxterNote10			;Remove this item from inventory			set AddOnce to 1			removeme		;Otherwise, just add the note		elseif (player.gethasnote SchematicsADPBaxterNote20 == 0)			;Add the Schematic Note			player.addNote SchematicsADPBaxterNote			;Remove this item from inventory			set AddOnce to 1			removeme		endif	endifEND


Appreciate any thoughts on this.
User avatar
kevin ball
 
Posts: 3399
Joined: Fri Jun 08, 2007 10:02 pm

Post » Mon Dec 20, 2010 2:19 am

What does this give you? 0?

set weaponCondition to (weaponCondition * countADPBaxterBonus)


The first time through, if countADPBaxterBonus is zero then the weapon condition will be zero.
User avatar
Amiee Kent
 
Posts: 3447
Joined: Thu Jun 15, 2006 2:25 pm

Post » Sun Dec 19, 2010 8:28 pm

Oi, thanks for the reply WillieSea,

Just to make sure I'm following the scripts right:

countADPBaxterBonus has a value of 0 to start with. If I have the 1rst version of the schematic, then this block in the SchematicADPBaxterItemSCRIPT sets its value to 1:

 ;First Improvement                elseif (player.gethasnote SchematicsADPBaxterNote == 1)                        ;Increment a variable for number of times this schematic has been gotten.                        set countADPBaxterBonus to 1                        ;Show message of quality improvement.                        ShowMessage SchematicsImprovedMsg                        player.removeNote SchematicsADPBaxterNote                        player.addNote SchematicsADPBaxterNote10                        ;Remove this item from inventory                        set AddOnce to 1                        removeme


Then, the SchematicWorkbenchScript sets the variable weaponCondition to a value of 0.80 (my repair skill is at 80):

Begin GameMode	set Button to GetButtonPressed	if ( Button >0 )		; base condition is just repair skill		set weaponCondition to (player.getav Repair)/100 


And further down, which is the block with the line you refered to, weaponCondition is set to (0.80 * 1) = 0.80. So the item created should be at 80% health? I'm confused, because the next block says that if weaponCondition is greater than 100, to set it to 100. A long ways from a 0.80 value ... And still more puzzled by the fact that the other workbench created weapons work with the same values, but with different results :toughninja: . I made a Rock-It Launcher last night with 80% condition, so, I'm stumped. How does countADPBaxterBonus get set to 0?
User avatar
Veronica Martinez
 
Posts: 3498
Joined: Tue Jun 20, 2006 9:43 am

Post » Sun Dec 19, 2010 10:07 pm

I just suggested that 'might' be why it has a zero health.

You should put a message in there to see what the values really are.

Make a message as a 'box' type with this text:
WeaponCondition: %.4fCountADPBaxterBonus: %.4f


set weaponCondition to (weaponCondition * countADPBaxterBonus) if weaponCondition > 100          set weaponCondition to 100 endif ShowMessage myTestMESG, weaponCondition, countADPBaxterBonusplayer.AddItemHealthPercent ADPWeapBaxter 1 weaponCondition 

User avatar
A Dardzz
 
Posts: 3370
Joined: Sat Jan 27, 2007 6:26 pm

Post » Mon Dec 20, 2010 2:36 am

Oi

The message box gave me a return of 0 for both. So that means it's not being changed by the script. Just for comparison, I made a msg box for the dartgun and that gave me 0.80 for weaponCondition and 1.25 for countDartGunBonus. Maybe I just made a syntax error somewhere... I'll go look again.
User avatar
Vera Maslar
 
Posts: 3468
Joined: Wed Sep 27, 2006 2:32 pm

Post » Sun Dec 19, 2010 8:54 pm

Did you make sure weaponCondition is defined as a float?
User avatar
Ice Fire
 
Posts: 3394
Joined: Fri Nov 16, 2007 3:27 am

Post » Mon Dec 20, 2010 9:40 am

Oi

(edited out)


RickerHK: Yup, it is. It was already in the original workbench script and used for the other weapons.
User avatar
D IV
 
Posts: 3406
Joined: Fri Nov 24, 2006 1:32 am

Post » Mon Dec 20, 2010 11:11 am

Looking at the original script, the condition check should be
if weaponCondition > 1
because it's been divided already at the top and AddItemHealthPercent takes 0-1.

But that isn't what is causing the problem. Could you post the whole modified script?
User avatar
katie TWAVA
 
Posts: 3452
Joined: Tue Jul 04, 2006 3:32 am

Post » Mon Dec 20, 2010 1:22 pm

EDIT: I circumvented the problem by adding another schematic check inside the workbench script (beth had to do something similar for adding the 1, 2 or 3 bottlecap mines), which works:

					; calculate condition					if player.gethasNote SchematicsADPBaxterNote						set countADPBaxterBonus to 1					elseif player.gethasNote SchematicsADPBaxterNote10						set countADPBaxterBonus to 1.25					elseif player.gethasNote SchematicsADPBaxterNote20                              set countADPBaxterBonus to 1.50					endif                                    ShowMessage ADPBaxterbonusconditionvalue, weaponCondition, countADPBaxterBonus					set weaponCondition to (weaponCondition * countADPBaxterBonus)                                    ShowMessage ADPBaxterbonusconditionvalue, weaponCondition, countADPBaxterBonus					player.AddItemHealthPercent ADPWeapBaxter 1 weaponCondition					PlaySound UIRepairWeapon


I'd still like to know why the original code worked for beth, but not for me. not sure about the 1.5 value tho. Does that sound right?

*****

Ugh, I can feel my brain frying... lol

I edited my last post cause it didn't make sense. What I know is this: 1rst schematic sets countADPBaxterBonus to 0; 2nd to 1; 3rd to 1.25. The Schematic item script does what it's supposed to do.

When weaponCondition is first set, in the workbench script, countADPBaxterBonus is back to 0. I know this because of the ShowMessage, put right after the "set weaponCondition to (player.getav Repair/100)" line. So, of course, "anything" * 0 = 0.

Anyway...:

scn SchematicsWorkbenchScript;workbench to create customized weapons; 1. Which schematics does the player have? Display as buttons.; 2. If has items needed to create, do it; otherwise display "error" messageshort HasItemsshort Buttonshort item1short item2short item3short item4float weaponCondition		; calculate what condition the weapon is at when created; how many of these weapons has the player made? ;short countBottlecap;short countDartGun;short countDeathclaw;short countNuka;short countRailway;short countRockit;short countShishkebab ;short countADPBaxterBegin OnActivate	if IsActionRef player == 1		; display message box of possible weapons		set HasItems to 0		if GetHasNote SchematicsBottlecapMineNote == 1  || GetHasNote SchematicsDartGunNote == 1  || GetHasNote SchematicsDeathclawGauntletNote == 1			set HasItems to 1		endif		if GetHasNote SchematicsNukaCocktailNote == 1  || GetHasNote SchematicsRailwayRifleNote == 1  || GetHasNote SchematicsRockitLauncherNote == 1  || GetHasNote SchematicsShishkebabNote == 1			set HasItems to 1		endif          if GetHasNote SchematicsADPBaxterNote == 1               set HasItems to 1          endif		if GetHasNote SchematicsBottlecapMineNote10 == 1  || GetHasNote SchematicsDartGunNote10 == 1  || GetHasNote SchematicsDeathclawGauntletNote10 == 1			set HasItems to 1		endif		if GetHasNote SchematicsNukaCocktailNote10 == 1  || GetHasNote SchematicsRailwayRifleNote10 == 1  || GetHasNote SchematicsRockitLauncherNote10 == 1  || GetHasNote SchematicsShishkebabNote10 == 1			set HasItems to 1		endif          if GetHasNote SchematicsADPBaxterNote10 == 1               set HasItems to 1          endif		if GetHasNote SchematicsBottlecapMineNote20 == 1  || GetHasNote SchematicsDartGunNote20 == 1  || GetHasNote SchematicsDeathclawGauntletNote20 == 1 || GetHasNote SchematicsRockitLauncherNote30 == 1			set HasItems to 1		endif		if GetHasNote SchematicsNukaCocktailNote20 == 1  || GetHasNote SchematicsRailwayRifleNote20 == 1  || GetHasNote SchematicsRockitLauncherNote20 == 1  || GetHasNote SchematicsShishkebabNote20 == 1			set HasItems to 1		endif           if GetHasNote SchematicsADPBaxterNote20 == 1               set HasItems to 1          endif		if HasItems == 1			ShowMessage SchematicsWorkbenchMsg		else			ShowMessage SchematicsWorkbenchNoneMsg		endif	endifEndBegin GameMode	set Button to GetButtonPressed	if ( Button >0 )		; base condition is just repair skill		set weaponCondition to (player.getav Repair)/100                          ShowMessage ADPBaxterbonusconditionvalue, weaponCondition, countADPBaxterBonus		if button == 1			; bottlecap mine			; 1. check for schematics			if GetHasNote SchematicsBottlecapMineNote == 0 && GetHasNote SchematicsBottlecapMineNote10 == 0 && GetHasNote SchematicsBottlecapMineNote20 == 0				ShowMessage SchematicsWorkbenchFailureGenericMsg			else				; 2. check for components				if ( player.GetItemCount LunchBox > 0 ) && ( player.GetItemCount CherryBomb > 0 ) && ( player.GetItemCount SensorModule > 0 ) && ( player.GetItemCount Caps001 >= 10 )					; 3. make it					ShowMessage SchematicsWorkbenchSuccessBottlecapMsg					player.RemoveItem LunchBox 1 1					player.RemoveItem CherryBomb 1 1					player.RemoveItem SensorModule 1 1					player.RemoveItem Caps001 10 1					; Mines and Grenades are always 100%					if player.gethasNote SchematicsBottlecapMineNote						player.AddItemHealthPercent WeapMineBottlecap 1 100					elseif player.gethasNote SchematicsBottlecapMineNote10						player.AddItemHealthPercent WeapMineBottlecap 2 100					elseif player.gethasNote SchematicsBottlecapMineNote20						player.AddItemHealthPercent WeapMineBottlecap 3 100					endif					PlaySound UIRepairWeapon					; increment count					ModPCMiscStat "Weapons Created" 1					set countBottlecap to countBottlecap + 1					;If the player has made one of each item, add Achievement 40					if countWeapAchievement == 0						if countBottlecap >= 1 && countDartgun >= 1 && countDeathclaw >= 1 && countNuka >= 1 && countRailway >= 1 && countRockit >= 1 && countShishkebab >= 1 && countADPBaxter >= 1 							addachievement 40							set countWeapAchievement to 1						endif					endif				else					; 4. failure message					set item1 to player.GetItemCount LunchBox 					set item2 to player.GetItemCount CherryBomb 					set item3 to player.GetItemCount SensorModule 					set item4 to player.GetItemCount Caps001 					ShowMessage SchematicsWorkbenchFailureBottlecapMsg, item1, item2, item3, item4					ShowMessage SchematicsWorkbenchMsg				endif			endif				elseif button == 2			; dart gun			; 1. check for schematics			if GetHasNote SchematicsDartGunNote == 0 && GetHasNote SchematicsDartGunNote10 == 0 && GetHasNote SchematicsDartGunNote20 == 0 				ShowMessage SchematicsWorkbenchFailureGenericMsg			else				;2. check for components				if ( player.GetItemCount PaintGun > 0 ) && ( player.GetItemCount RadscorpionPoisonGland > 0 ) && ( player.GetItemCount ToyCar > 0 ) && ( player.GetItemCount SurgicalTubing > 0 )					;3. make it					;message "Dart Gun created."					ShowMessage SchematicsWorkbenchSuccessDartGunMsg					player.RemoveItem PaintGun 1 1					player.RemoveItem RadscorpionPoisonGland 1 1					player.RemoveItem ToyCar 1 1					player.RemoveItem SurgicalTubing 1 1					; calculate condition					set weaponCondition to (weaponCondition * countDartgunBonus)					if weaponCondition > 100						set weaponCondition to 100					endif					player.AddItemHealthPercent WeapDartGun 1 weaponCondition					PlaySound UIRepairWeapon					; increment count					ModPCMiscStat "Weapons Created" 1					set countDartgun to countDartgun + 1					;If the player has made one of each item, add Achievement 40					if countWeapAchievement == 0						if countBottlecap >= 1 && countDartgun >= 1 && countDeathclaw >= 1 && countNuka >= 1 && countRailway >= 1 && countRockit >= 1 && countShishkebab >= 1 && countADPBaxter >= 1 							addachievement 40							set countWeapAchievement to 1						endif					endif				else					;failure message					set item1 to player.GetItemCount PaintGun 					set item2 to player.GetItemCount RadscorpionPoisonGland					set item3 to player.GetItemCount ToyCar 					set item4 to player.GetItemCount SurgicalTubing 					ShowMessage SchematicsWorkbenchFailureDartGunMsg, item1, item2, item3, item4					ShowMessage SchematicsWorkbenchMsg				endif			endif				elseif button == 3			; deathclaw gauntlet			; 1. check for schematics			if GetHasNote SchematicsDeathclawGauntletNote == 0 && GetHasNote SchematicsDeathclawGauntletNote10 == 0 && GetHasNote SchematicsDeathclawGauntletNote20 == 0				ShowMessage SchematicsWorkbenchFailureGenericMsg			else				; 2. check for components				if ( player.GetItemCount WonderGlue > 0 ) && ( player.GetItemCount DeathclawHand > 0 ) && ( player.GetItemCount LeatherBelt > 0 ) && ( player.GetItemCount MedicalBrace > 0 )					; 3. make it					;message "Deathclaw Gauntlet created."					ShowMessage SchematicsWorkbenchSuccessDeathclawMsg					player.RemoveItem WonderGlue 1 1					player.RemoveItem DeathclawHand 1 1					player.RemoveItem LeatherBelt 1 1					player.RemoveItem MedicalBrace 1 1					; calculate condition					set weaponCondition to (weaponCondition * countDeathclawBonus)					if weaponCondition > 100						set weaponCondition to 100					endif					player.AddItemHealthPercent WeapDeathclawGauntlet 1 weaponCondition					PlaySound UIRepairWeapon					; increment count					ModPCMiscStat "Weapons Created" 1					set countDeathclaw to countDeathclaw + 1					;If the player has made one of each item, add Achievement 40					if countWeapAchievement == 0						if countBottlecap >= 1 && countDartgun >= 1 && countDeathclaw >= 1 && countNuka >= 1 && countRailway >= 1 && countRockit >= 1 && countShishkebab >= 1 && countADPBaxter >= 1 							addachievement 40							set countWeapAchievement to 1						endif					endif				else					; 4. failure message					set item1 to player.GetItemCount WonderGlue					set item2 to player.GetItemCount DeathclawHand 					set item3 to player.GetItemCount LeatherBelt 					set item4 to player.GetItemCount MedicalBrace 					ShowMessage SchematicsWorkbenchFailureDeathclawMsg, item1, item2, item3, item4					ShowMessage SchematicsWorkbenchMsg				endif			endif				elseif button == 4			; nuka grenade			; 1. check for schematics			if GetHasNote SchematicsNukaCocktailNote == 0 && GetHasNote SchematicsNukaCocktailNote10 == 0 && GetHasNote SchematicsNukaCocktailNote20 == 0				ShowMessage SchematicsWorkbenchFailureGenericMsg			else				; 2. check for components				if ( player.GetItemCount MS05NukaColaQtm > 0 ) && ( player.GetItemCount TinCan01 > 0 ) && ( player.GetItemCount Turpentine > 0 ) && ( player.GetItemCount AbraxoCleaner > 0 )					; 3. make it					;message "Nuka Cocktail created."					ShowMessage SchematicsWorkbenchSuccessNukaCocktailMsg					player.RemoveItem MS05NukaColaQtm 1 1					player.RemoveItem TinCan01 1 1					player.RemoveItem Turpentine 1 1					player.RemoveItem AbraxoCleaner 1 1					; Mines and Grenades are always 100%					if player.gethasNote SchematicsNukaCocktailNote						player.AddItemHealthPercent WeapNukaCocktail 1 100					elseif player.gethasNote SchematicsNukaCocktailNote10						player.AddItemHealthPercent WeapNukaCocktail 2 100					elseif player.gethasNote SchematicsNukaCocktailNote20						player.AddItemHealthPercent WeapNukaCocktail 3 100					endif					PlaySound UIRepairWeapon					; increment count					ModPCMiscStat "Weapons Created" 1					set countNuka to countNuka + 1					;If the player has made one of each item, add Achievement 40					if countWeapAchievement == 0						if countBottlecap >= 1 && countDartgun >= 1 && countDeathclaw >= 1 && countNuka >= 1 && countRailway >= 1 && countRockit >= 1 && countShishkebab >= 1 && countADPBaxter >= 1 							addachievement 40							set countWeapAchievement to 1						endif					endif				else					; 4. failure message					set item1 to player.GetItemCount MS05NukaColaQtm					set item2 to player.GetItemCount TinCan01					set item3 to player.GetItemCount Turpentine 					set item4 to player.GetItemCount AbraxoCleaner 					ShowMessage SchematicsWorkbenchFailureNukaCocktailMsg, item1, item2, item3, item4					ShowMessage SchematicsWorkbenchMsg				endif			endif				elseif button == 5			; railway rifle			; 1. check for schematics			if GetHasNote SchematicsRailwayRifleNote == 0 && GetHasNote SchematicsRailwayRifleNote10 == 0 && GetHasNote SchematicsRailwayRifleNote20 == 0				ShowMessage SchematicsWorkbenchFailureGenericMsg			else				; 2. check for components				if ( player.GetItemCount Crutch > 0 ) && ( player.GetItemCount SteamGaugeAssembly > 0 ) && ( player.GetItemCount FissionBattery > 0 ) && ( player.GetItemCount PressureCooker > 0 )					; 3. make it					;message "Railway Rifle created."					ShowMessage SchematicsWorkbenchSuccessRailwayRifleMsg					player.RemoveItem Crutch 1 1					player.RemoveItem SteamGaugeAssembly 1 1					player.RemoveItem FissionBattery 1 1					player.RemoveItem PressureCooker 1 1					; calculate condition					set weaponCondition to (weaponCondition * countRailwayBonus)					if weaponCondition > 100						set weaponCondition to 100					endif					player.AddItemHealthPercent WeapRailwayRifle 1 weaponCondition					PlaySound UIRepairWeapon					; increment count					ModPCMiscStat "Weapons Created" 1					set countRailway to countRailway + 1					;If the player has made one of each item, add Achievement 40					if countWeapAchievement == 0						if countBottlecap >= 1 && countDartgun >= 1 && countDeathclaw >= 1 && countNuka >= 1 && countRailway >= 1 && countRockit >= 1 && countShishkebab >= 1 && countADPBaxter >= 1 							addachievement 40							set countWeapAchievement to 1						endif					endif				else					; 4. failure message					set item1 to player.GetItemCount Crutch					set item2 to player.GetItemCount SteamGaugeAssembly 					set item3 to player.GetItemCount FissionBattery 					set item4 to player.GetItemCount PressureCooker 					ShowMessage SchematicsWorkbenchFailureRailwayRifleMsg, item1, item2, item3, item4					ShowMessage SchematicsWorkbenchMsg				endif			endif				elseif button == 6			; rock-it launcher			; 1. check for schematics			if GetHasNote SchematicsRockItLauncherNote == 0 && GetHasNote SchematicsRockItLauncherNote10 == 0 && GetHasNote SchematicsRockItLauncherNote20 == 0 && GetHasNote SchematicsRockItLauncherNote30 == 0				ShowMessage SchematicsWorkbenchFailureGenericMsg			else				; 2. check for components				if ( player.GetItemCount VacuumCleaner > 0 ) && ( player.GetItemCount LeafBlower > 0 ) && ( player.GetItemCount FirehoseNozzle > 0 ) && ( player.GetItemCount Conductor > 0 )					; 3. make it					;message "Rock-It Launcher created."					ShowMessage SchematicsWorkbenchSuccessRockItMsg					player.RemoveItem VacuumCleaner 1 1					player.RemoveItem LeafBlower 1 1					player.RemoveItem FirehoseNozzle 1 1					player.RemoveItem Conductor 1 1					; calculate condition					set weaponCondition to (weaponCondition * countRockitBonus)					if weaponCondition > 100						set weaponCondition to 100					endif					player.AddItemHealthPercent WeapRockItLauncher 1 weaponCondition					PlaySound UIRepairWeapon					; increment count					ModPCMiscStat "Weapons Created" 1					set countRockit to countRockit + 1					;If the player has made one of each item, add Achievement 40					if countWeapAchievement == 0						if countBottlecap >= 1 && countDartgun >= 1 && countDeathclaw >= 1 && countNuka >= 1 && countRailway >= 1 && countRockit >= 1 && countShishkebab >= 1 && countADPBaxter >= 1 							addachievement 40							set countWeapAchievement to 1						endif					endif				else					; 4. failure message					set item1 to player.GetItemCount VacuumCleaner 					set item2 to player.GetItemCount LeafBlower 					set item3 to player.GetItemCount FirehoseNozzle 					set item4 to player.GetItemCount Conductor 					ShowMessage SchematicsWorkbenchFailureRockItMsg, item1, item2, item3, item4					ShowMessage SchematicsWorkbenchMsg				endif			endif				elseif button == 7			; Shishkebab			; 1. check for schematics			if GetHasNote SchematicsShishkebabNote == 0 && GetHasNote SchematicsShishkebabNote10 == 0 && GetHasNote SchematicsShishkebabNote20 == 0				ShowMessage SchematicsWorkbenchFailureGenericMsg			else			; 2. check for components				if ( player.GetItemCount MotorcycleGasTank > 0 ) && ( player.GetItemCount PilotLight > 0 ) && ( player.GetItemCount LawnmowerBlade > 0 ) && ( player.GetItemCount MotorcycleHandbrake > 0 )			; 3. make it					;message "Shishkebab created."					ShowMessage SchematicsWorkbenchSuccessShishkebabMsg					player.RemoveItem MotorcycleGasTank 1 1					player.RemoveItem PilotLight 1 1					player.RemoveItem LawnmowerBlade 1 1					player.RemoveItem MotorcycleHandBrake 1 1					; calculate condition					set weaponCondition to (weaponCondition * countShishkebabBonus)					if weaponCondition > 100						set weaponCondition to 100					endif					player.AddItemHealthPercent WeapShishkebab 1 weaponCondition					PlaySound UIRepairWeapon					; increment count					ModPCMiscStat "Weapons Created" 1					set countShishkebab to countShishkebab + 1					;If the player has made one of each item, add Achievement 40					if countWeapAchievement == 0						if countBottlecap >= 1 && countDartgun >= 1 && countDeathclaw >= 1 && countNuka >= 1 && countRailway >= 1 && countRockit >= 1 && countShishkebab >= 1 && countADPBaxter >= 1 							addachievement 40							set countWeapAchievement to 1						endif					endif				else			; 4. failure message					set item1 to player.GetItemCount MotorcycleGasTank 					set item2 to player.GetItemCount PilotLight 					set item3 to player.GetItemCount LawnmowerBlade					set item4 to player.GetItemCount MotorcycleHandbrake 					ShowMessage SchematicsWorkbenchFailureShishkebabMsg, item1, item2, item3, item4					ShowMessage SchematicsWorkbenchMsg				endif			endif		elseif button == 8			; ADPBaxter			; 1. check for schematics			if GetHasNote SchematicsADPBaxterNote == 0 && GetHasNote SchematicsADPBaxterNote10 == 0 && GetHasNote SchematicsADPBaxterNote20 == 0				ShowMessage SchematicsWorkbenchFailureGenericMsg			else				; 2. check for components				if ( player.GetItemCount WeapBaseballBat > 0 ) && ( player.GetItemCount LawnmowerBlade > 0 ) && ( player.GetItemCount SpareParts > 0 ) && ( player.GetItemCount WhetStone01 > 0 )					; 3. make it					player.RemoveItem WeapBaseballBat 1 1					player.RemoveItem LawnmowerBlade 1 1					player.RemoveItem SpareParts 1 1					player.RemoveItem WhetStone01 1 1					        ShowMessage SchematicsWorkbenchSuccessADPBaxterMsg					; calculate condition					set weaponCondition to (weaponCondition * countADPBaxterBonus)					if weaponCondition > 100						set weaponCondition to 100					endif                         ShowMessage ADPBaxterbonusconditionvalue, weaponCondition, countADPBaxterBonus					player.AddItemHealthPercent ADPWeapBaxter 1 weaponCondition					PlaySound UIRepairWeapon					; increment count					ModPCMiscStat "Weapons Created" 1					set countADPBaxter to countADPBaxter + 1					;If the player has made one of each item, add Achievement 40					if countWeapAchievement == 0						if countBottlecap >= 1 && countDartgun >= 1 && countDeathclaw >= 1 && countNuka >= 1 && countRailway >= 1 && countRockit >= 1 && countShishkebab >= 1 && countADPBaxter >= 1 							addachievement 40							set countWeapAchievement to 1						endif					endif				else					; 4. failure message					set item1 to player.GetItemCount WeapBaseballBat					set item2 to player.GetItemCount LawnmowerBlade					set item3 to player.GetItemCount SpareParts					set item4 to player.GetItemCount WhetStone01 					ShowMessage SchematicsWorkbenchFailureADPBaxterMsg, item1, item2, item3, item4					ShowMessage SchematicsWorkbenchMsg				endif			endif				endif	endif	End

User avatar
Lexy Corpsey
 
Posts: 3448
Joined: Tue Jun 27, 2006 12:39 am

Post » Mon Dec 20, 2010 3:17 am

Oi.

So, I went back to a page I had seen where it was discussed what condition custom weapons were in when created. A piece of text clicked this time, the part about "each having a value of 0.75" (the page is http://fallout.wikia.com/wiki/User_talk:MadCat221 ). Like I thought something else is giving the countBonus that value. Still don't know where tho. But anyway, I set this value to countADPBaxterBonus in its item script.

Could those variables be set directly in the game engine? Or another script I have found...?

Thanks for the help btw.
User avatar
Yonah
 
Posts: 3462
Joined: Thu Aug 02, 2007 4:42 am

Post » Mon Dec 20, 2010 9:34 am

When you created your global countADPBaxterBonus, did you click the 'constant' box? If so, that would cause it to revert to 0 (or whatever you set it to) every time you restarted the game.
User avatar
Claire Mclaughlin
 
Posts: 3361
Joined: Mon Jul 31, 2006 6:55 am

Post » Mon Dec 20, 2010 2:33 am

EDIT: ROFL! I feel so stupid...: Gameplay > Globals ...all the options are there... how come I didn't come across simple info like that is beyond me. How come I didn't check there... :facepalm:

Well, not-so-mystery solved. Thanks for the help :celebration:
User avatar
Len swann
 
Posts: 3466
Joined: Mon Jun 18, 2007 5:02 pm


Return to Fallout 3