would these 2 scripts work together,

Post » Fri May 27, 2011 11:54 pm

the assistance is greatly appreciated


main
Spoiler


scn HaroKArrowForgeQST2Script

float fQuestDelayTime

ref CNTRef

short Alchemy


short Fire
short Frost
short Shock
short FireArea
short FrostArea
short ShockArea
short Light
short DamHeal
short DamMag
short DamFtg
short DamAtt
short DrainMag
short Dispel
short Silence

short TotalFire
short TotalFrost
short TotalShock
short TotalFireArea
short TotalFrostArea
short TotalShockArea
short TotalLight
short TotalDamHeal
short TotalDamMag
short TotalDamFtg
short TotalDamAtt
short TotalDrainMag
short TotalDispel
short TotalSilence

short DoOnce

begin GameMode

set fQuestDelayTime to 0.001

if (DoOnce == 0)
StopQuest HaroKArrowForgeQST2
return
endif
set DoOnce to 0

;Message "Start Enchanting..."

set CNTRef to HaroKArrowForgeCNT

SetQuestObject HaroKArrowForge 1

set TotalFire to call functionCountFire CNTRef
set TotalFrost to 0
set TotalShock to 0
set TotalFireArea to 0
set TotalFrostArea to 0
set TotalShockArea to 0
set TotalLight to 0
set TotalDamHeal to 0
set TotalDamMag to 0
set TotalDamFtg to 0
set TotalDamAtt to 0
set TotalDrainMag to 0
set TotalDispel to 0
set TotalSilence to 0


StopQuest HaroKArrowForgeQST2
end



function
Spoiler

scn functionCountFire


ref CNTRef

short Alchemy

short Fire
short TotalFire

short multi1
short multi2
short multi3
short multi4

begin Function {CNTRef}

Set Alchemy to Player.GetActorValue Alchemy

if (Alchemy < 25)
set multi1 to 15
set multi2 to 0
set multi3 to 0
set multi4 to 0
elseif (Alchemy < 50)
set multi1 to 20
set multi2 to 30
set multi3 to 0
set multi4 to 0
elseif (Alchemy < 75)
set multi1 to 25
set multi2 to 40
set multi3 to 60
set multi4 to 0
elseif (Alchemy < 100)
set multi1 to 30
set multi2 to 50
set multi3 to 70
set multi4 to 90
else
set multi1 to 45
set multi2 to 75
set multi3 to 105
set multi4 to 135
endif

if (Alchemy >= 1)
set TotalFire to 0


set Fire to Fire + CNTRef.GetItemCount FireSalts
;mmm
set Fire to Fire + CNTRef.GetItemCount BeholderEye

set TotalFire to TotalFire + Fire * multi1
endif

;--------------------Level 2 Effect--------------------

if (Alchemy >= 25)

set TotalFire to 0

set Fire to Fire + CNTRef.GetItemCount SteelBlueEntolomaCap
;cobl
set Fire to Fire + CNTRef.GetItemCount cobTiSaltpetre
;ooo
set Fire to Fire + CNTRef.GetItemCount GolemMagmaHeart

set TotalFire to TotalFire + Fire * multi2

endif

;--------------------Level 3 Effect--------------------

if (Alchemy >= 50)

set TotalFire to 0

set Fire to Fire + CNTRef.GetItemCount SpiddalStick
;cobl
set Fire to Fire + CNTRef.GetItemCount cobColFishChowder
set Fire to Fire + CNTRef.GetItemCount cobGeoGoldDust
;ooo
set Fire to Fire + CNTRef.GetItemCount GoldDust
;mmm
set Fire to Fire + CNTRef.GetItemCount VCVirvatuliGlitter

set TotalFire to TotalFire + Fire * multi3

endif

;--------------------Level 4 Effect--------------------

if (Alchemy >= 75)

set TotalFire to 0

;-----Fire Damage
set Fire to Fire + CNTRef.GetItemCount ImpGall
;ooo
set Fire to Fire + CNTRef.GetItemCount ImpGallCrazed
;mmm
set Fire to Fire + CNTRef.GetItemCount ElementalSalts

set TotalFire to TotalFire + Fire * multi4


endif

;--------------------------------------------------
setfunctionvalue TotalFire

end





thanks
User avatar
Karl harris
 
Posts: 3423
Joined: Thu May 17, 2007 3:17 pm

Post » Sat May 28, 2011 1:08 am

I think so, but there are a couple of weird things in your scripts.

This:
if (DoOnce == 0)StopQuest HaroKArrowForgeQST2returnendifset DoOnce to 0
seems wrong. What are you trying to achieve?


if (Alchemy >= 1)...endifif (Alchemy >= 25)...endifif (Alchemy >= 50)...endifif (Alchemy >= 75)...endif

means that if alchemy >= 75, all of the checks will be true, and the script will go through all of them, which is probably not what you want. Use the same checks as higher up in your script.
User avatar
Ben sutton
 
Posts: 3427
Joined: Sun Jun 10, 2007 4:01 am

Post » Sat May 28, 2011 7:55 am

Is it possible to make the condition like:
if ((Alchemy >=1) && (Alchemy < 25))..........endif

User avatar
Siobhan Thompson
 
Posts: 3443
Joined: Sun Nov 12, 2006 10:40 am

Post » Sat May 28, 2011 1:01 am

Is it possible to make the condition like:
if ((Alchemy >=1) && (Alchemy < 25))..........endif


Yes - though personally I would get rid of the superfluous parentheses.
User avatar
Pants
 
Posts: 3440
Joined: Tue Jun 27, 2006 4:34 am

Post » Sat May 28, 2011 2:47 am

I think so, but there are a couple of weird things in your scripts.

This:
if (DoOnce == 0)StopQuest HaroKArrowForgeQST2returnendifset DoOnce to 0
seems wrong. What are you trying to achieve?


if (Alchemy >= 1)...endifif (Alchemy >= 25)...endifif (Alchemy >= 50)...endifif (Alchemy >= 75)...endif

means that if alchemy >= 75, all of the checks will be true, and the script will go through all of them, which is probably not what you want. Use the same checks as higher up in your script.


this is the 3rd part to the overhual of the haroks arrow forge mod. the mod works, and that is the original code, but being separated into functions for size reasons, (original is 55k) and I want it to include cobl ingredients. this is until I can make it scan ingredients instead of being hard coded.

all I did, was take out each damage type separately while maintaining his code, and turning each damage type into a function.

and it will go through each, yes, because the ingredients are hard coded, the effects are broken by tier and must go through each tier to get all ingredients with the specific effect. that is how it was originally. and if the player's alchemy is less than the tier, it will by pass it.

I have a friend who is a Programmer, he will be coming by next week to help me out. now that we have the function to scan the ingredients, we should be able to make a much smoother script able to handle any ingredient from any mod... that is the end goal.

original mod can be found here
http://www.tesnexus.com/downloads/file.php?id=3176
User avatar
Bryanna Vacchiano
 
Posts: 3425
Joined: Wed Jan 31, 2007 9:54 pm

Post » Fri May 27, 2011 5:59 pm

got em working, thanks
User avatar
David John Hunter
 
Posts: 3376
Joined: Sun May 13, 2007 8:24 am


Return to IV - Oblivion