Noob To Scripting, I'm So Confused

Post » Sun Aug 23, 2009 11:33 am

Okay, all my mods are personal use only, as I combined and edit lots of other people's mods to fit my liking. Sense I don't feel like bugging these people, I will never release them (doubt anyone would want them anyways)

Okay, first off, I have no knowledge of OBSE, but I do have it. (I think version 17?)

So far, the only script I have made is one that sets the players scale to 2.0 when an amulet is equipped. (and returns it to normal when unequipped)

So, right now I am wanting to make a script so that when the same amulet is equipped, a full set of armor/shield/sword is equipped (Already in the player's inventory or not, doesn't matter.) And when the amulet is removed, they are auto unequipped. (In addition to the setscale 2.0, and a crapload of vanilla magic effects)

Is there even any point in my trying such a script? I know the xenomorph race mod I have uses a similar script, but I'm scared tot touch it. (not to mention it has no unequip, and is not based on equipping something)

Thanks =3
User avatar
Poetic Vice
 
Posts: 3440
Joined: Wed Oct 31, 2007 8:19 pm

Post » Sun Aug 23, 2009 4:40 am

I wrote this for someone a while ago...should get you on the road.

This went on a token item that was added to a characters inventory.
It gives them a full suit of Legion armor and makes them put it on.
(theres a delay between adding the armor and equiping it to avoid some potential problems)

If you've made an amulet that changes the player's you should be able to handle splicing this in to your code

Roughly speaking something like this goes in the OnEquip section on your amulet.

In the Begin OnUnEquip section you're probably going to want to put in a bunch of removeitem calls if you want the magic stuff to disappear when you take the amulet off.


scn EquipLegionArmorSCRIPTref NPCshort equipDelayBegin Gamemode if ( equipDelay == 0 ) 	Set NPC to GetContainer 	NPC.additem LegionShield 1 	NPC.additem LegionBoots 1 	NPC.additem LegionCuirass 1 	NPC.additem LegionGreaves 1 	NPC.additem LegionGauntlets 1 	NPC.additem LegionHelmetOld 1 	set equipDelay to 1 elseif ( equipDelay < 10 ) ; wait 10 frames 	set equipDelay to equipDelay + 1 elseif ( equipDelay > 0 ) 	NPC.equipitem LegionShield 	NPC.equipitem LegionBoots 	NPC.equipitem LegionCuirass 	NPC.equipitem LegionGreaves 	NPC.equipitem LegionGauntlets 	NPC.equipitem LegionHelmetOld 	set equipDelay to -1 ; finished 	removeme endifEND

User avatar
Claire Vaux
 
Posts: 3485
Joined: Sun Aug 06, 2006 6:56 am

Post » Sun Aug 23, 2009 2:35 am

Thanks I modified it to fit, but I am having a bit of trouble

The armor is added and removed correctly, but it won't equip automatically (I can equip it manually however, but that won't work for this). Also, once the armor/weapon is removed by the amulet's effect, it won't be re-added my the amulet's effect (Only works again if I reload a previous save, and then only works once, again.)

This is the script I am using, added to an amulet. (I have a question, do the nine spaces make any defernce in the script itself, or are they just to make things more readable? (Things in [] are unimportant code that links to items edited for this mod (correctly) )

scn [myscriptname]ref playershort equipdelaybegin onequip if ( equipdelay == 0 )        set player to getcontainer        player.additem [refID] 1        player.additem [refID] 1        player.additem [refID] 1        player.additem [refID] 1        player.additem [refID] 1        player.additem [refID] 1        player.additem [refID] 1        set equipdelay to 1 elseif ( equipdelay < 10 ) ; wait 10 frames        set equipdelay to equipdelay + 1 elseif ( equipdelay > 0 )        player.equipitem [refID]        player.equipitem [refID]        player.equipitem [refID]        player.equipitem [refID]        player.equipitem [refID]        player.equipitem [refID]        player.equipitem [refID]        set equipdelay to -1 ; finished        removeme endifendbegin onunequip        player.removeitem [refID] 1        player.removeitem [refID] 1        player.removeitem [refID] 1        player.removeitem [refID] 1        player.removeitem [refID] 1        player.removeitem [refID] 1        player.removeitem [refID] 1end

User avatar
bonita mathews
 
Posts: 3405
Joined: Sun Aug 06, 2006 5:04 am


Return to IV - Oblivion