Jump to content

Why Is Scripting So Complicated ?


alonsomartinez

Recommended Posts

I need some help on a script. Basically t what it does is remove the soul level from any soul gem that you place in a container. and the other part is used to make Grand Soul gems. I do this by using this script

 

 

scn myscript

 

begin onmagiceffecthit STRP

 

 

;For every Grand Soul Gem in the container, swap out 1

if aa.getitemcount SoulGemEmpty1Petty >= 6

aaa.removeitem SoulGemEmpty1Petty 6

aaa.additem SoulGemEmpty5Grand 1

cast MGAnchoriteAltarSpell player

endif

if aaa.getitemcount SoulGemEmpty2Lesser >= 4

aaa.removeitem SoulGemEmpty2Lesser 2

aaa.additem SoulGemEmpty5Grand 1

cast MGAnchoriteAltarSpell player

endif

if aaa.getitemcount SoulGemEmpty3Common >= 3

aaa.removeitem SoulGemEmpty3Common 3

aaa.additem SoulGemEmpty5Grand 1

cast MGAnchoriteAltarSpell player

endif

if aaa.getitemcount SoulGemEmpty4Greater >=2

aaa.removeitem SoulGemEmpty4Greater 2

aaa.additem SoulGemEmpty5Grand 1

cast MGAnchoriteAltarSpell player

endif

end

 

 

Begin OnMagicEffectHit DSPL

 

if aaa.getitemcount SoulGem1Petty1PettySoul >=1

aaa.removeitem SoulGem1Petty1PettySoul 1

aaa.additem SoulGemEmpty1Petty 1

endif

if aaa.getitemcount SoulGem2Lesser1PettySoul >= 1 || aaa.getitemcount SoulGem2Lesser2LesserSoul >=1

aaa.removeitem SoulGem2Lesser1PettySoul 1 || aaa.removeitem SoulGem2Lesser2LesserSoul 1&&

aaa.additem SoulGemEmpty2Lesser 1

endif

if aaa.getitemcount SoulGem3Common1PettySoul >= 1

|| aaa.getitemcount SoulGem3Common2LesserSoul >= 1

|| aaa.getitemcount SoulGem3Common3CommonSoul >= 1

aaa.removeitem SoulGem3Common1PettySoul 1

|| aaa.removeitem SoulGem3Common2LesserSoul 1

|| aaa.removeitem SoulGem3Common3CommonSoul 1

aaa.additem SoulGemEmpty3Common 1

endif

if aaa.getitemcount SoulGem4Greater1PettySoul >= 1

|| aaa.getitemcount SoulGem4Greater2LesserSoul >=1

|| aaa.getitemcount SoulGem4Greater3CommonSoul >= 1

|| aaa.getitemcount SoulGem4Greater4GreaterSoul >= 1

aaa.removeitem SoulGem4Greater1PettySoul 1

|| aaa.removeitem SoulGem4Greater2LesserSoul 1

|| aaa.removeitem SoulGem4Greater3CommonSoul 1

|| aaa.removeitem SoulGem4Greater4GreaterSoul 1

aaa.additem SoulGemEmpty4Greater 1

endif

end

The thing is that's not working for me is that there are several of these scripted containers around that I have placed and It would be really hard to go through every reference name and change it.I tried to do a workaround by deleting the reference name but it was buggy and sometimes it did what it was supposed to do.Is there any way to make a universal reference name that will work for all of the altars ? Im trying not to use OBSE

I have looked on the CS page but I couldnt understand what they were saying.The script works fineand all and it does what it is suppposed to do but I really dont want to have to go trhough all over again.As you can see its a long script. :thanks:

 

PS Please dont take my script ! I worked hard on it.

Link to comment
Share on other sites

I'm pretty sure that someone did this same exact thing a few years ago. You might want to take a look and see how they did it.

 

On a side note, you might want to use more complete form names for your references. You should really get into the habit of using a descriptive name for the object which is combined with a 3-4 character prefix based on your name or handle, avoiding common ones such as aaa, xxx, zzz, or anything beginning with a number.

 

Also, || and && can only appear within condition statements, not action statements. If you want more than one thing to be done based on an action, you will need to call each one in a linear order. If you want either one action or another, you will need to use another condition.

 

As far as references go, if the referenced object is only being used within the script that is placed on that object, you don't need to name each placed reference, and instead can just use a script reference variable to write the id of that object locally to be used with other functions. Getself is probably the most used although others might be used depending on the situation.

 

Really though, the scripting language and process isn't that complicated once you get some basic understanding of the syntax used and become familiar with how oblivion functions work. You might want to try with a script that uses fewer conditions until you have the basics down.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...