Semi-Complex scripts needed

Post » Sun May 01, 2011 10:07 pm

Today, I need some scripts, and it seems like they ought to be quite long and a little complicated. It may require up to 4, but IDK.

OK, first thing's first, I need an object, that, every 3 game hours, a spell is cast on the wearer, a message is displayed (the box that appears with an "OK" and you click it to make it dissapear and continue the game), and the object is switched with another and the second is equiped to the player while the first dissapeared.

Second object, the first spell is intact, and casts the same one every 3 hours, untill the player replaces it "OK option box" is displayed as each spell is cast (saying the same thing every time).

Then, after you replace the second item with one of the first, the whole thing is removed to start again. Also, in order to replace, you need to have 2 misc objects in your inventory that do nothing else.

I am also hopless with global scripts, so I'd like a global script that will keep the player from unequiping the object when a certain ability is active, and instantly adding many of the first object to the player's inventory, adding the item to most shops, and forcing one to be equiped to the player. I hope to achieve this through journal entry, and then another entry that will negate the script from the first, and disable the script from both objects.

I also do not have script extender, tribunal or bloodmoon
User avatar
lucile
 
Posts: 3371
Joined: Thu Mar 22, 2007 4:37 pm

Post » Sun May 01, 2011 6:32 pm

Today, I need some scripts, and it seems like they ought to be quite long and a little complicated. It may require up to 4, but IDK.

OK, first thing's first, I need an object, that, every 3 game hours, a spell is cast on the wearer, a message is displayed (the box that appears with an "OK" and you click it to make it dissapear and continue the game), and the object is switched with another and the second is equiped to the player while the first dissapeared.

Second object, the first spell is intact, and casts the same one every 3 hours, untill the player replaces it "OK option box" is displayed as each spell is cast (saying the same thing every time).

Then, after you replace the second item with one of the first, the whole thing is removed to start again. Also, in order to replace, you need to have 2 misc objects in your inventory that do nothing else.

I am also hopless with global scripts, so I'd like a global script that will keep the player from unequiping the object when a certain ability is active, and instantly adding many of the first object to the player's inventory, adding the item to most shops, and forcing one to be equiped to the player. I hope to achieve this through journal entry, and then another entry that will negate the script from the first, and disable the script from both objects.

I also do not have script extender, tribunal or bloodmoon


As far as I know (but that's not much, :) ) there is no way to force a player to equip or unequip anything. Perhaps removeitem would work for that, but it wouldn't be in his inventory.

The other stuff would be fairly easy, the timed spell cast, and message box....
User avatar
SiLa
 
Posts: 3447
Joined: Tue Jun 13, 2006 7:52 am

Post » Mon May 02, 2011 12:49 am

http://www.scribd.com/doc/7007668/Morrowind-Scripting-for-Dummies-9 is a great resource for most all of your scripting needs.

I also do not have script extender, tribunal or bloodmoon


This might be a problem for some parts of what you're interested in. TR/BM not only add important functions, but fix others, as well. I'd recommend getting Morrowind GotY edition, honestly, as it's easily available for $10-$15, has tons of great content, and modding features you'll need. Good luck!
User avatar
Cool Man Sam
 
Posts: 3392
Joined: Thu May 10, 2007 1:19 pm

Post » Sun May 01, 2011 11:46 pm

Not to be off topic, but for the reply above.

May I ask what exactly is script extender? I assume it's like "advanced" scripting?
User avatar
Isabella X
 
Posts: 3373
Joined: Sat Dec 02, 2006 3:44 am

Post » Sun May 01, 2011 11:13 pm

Not to be off topic, but for the reply above.

May I ask what exactly is script extender? I assume it's like "advanced" scripting?


There are third party programs -- the Morrowind Graphics Extender, Morrowind Script Extender, and Morrowind Enhanced -- which can compile scripts that make use of additional functions not present normally in Morrowind.

Morrowind Enhanced (MWE) has not been actively developed for a long time.

Morrowind Script Extender (MWSE) hasn't gotten new functions in a while, but is very easy to use since it is now included in MGE.

Morrowind Graphics Extender (MGE) has not only things like Distant Land, but a bunch of additional script functions through its internal MWSE version for all the normal MWSE stuff plus things related to distant land, shaders, certain view matrices, etc.


So in a way, yes, it could be considered "more advanced" scripting but isn't really more difficult, it just requires different ways of thinking. Which I am still trying to adapt to. I find http://www.tesnexus.com/downloads/file.php?id=20927 to be an excellent resource for MWSE modding (thanks Yacoby!)
User avatar
Jennifer Munroe
 
Posts: 3411
Joined: Sun Aug 26, 2007 12:57 am

Post » Sun May 01, 2011 10:38 pm

As far as I know (but that's not much, :) ) there is no way to force a player to equip or unequip anything. Perhaps removeitem would work for that, but it wouldn't be in his inventory.

The other stuff would be fairly easy, the timed spell cast, and message box....


You can force equip an item on the player using the Equip function. This is done in some scripts to make cursed armor or weapons that can't be removed until certain other conditions are met, and then the armor or weapon is removed via script or the player is allowed to remove it by stopping the call on the equip function. You can't force-unequip an item though. You can only remove the item, or make it so the player can't re-equip the item using SkipEquip. Actually, I'm not sure if you can use SkipEquip to un-equip an item that's already equipped. It's worth testing out.
User avatar
Nathan Barker
 
Posts: 3554
Joined: Sun Jun 10, 2007 5:55 am

Post » Sun May 01, 2011 1:09 pm

No, equip was fixed in the expansions/GOTY. Without that, it exists but it's broken.
User avatar
Sarah Unwin
 
Posts: 3413
Joined: Tue Aug 01, 2006 10:31 pm

Post » Mon May 02, 2011 3:36 am

Ah ok. I've been playing with the expansions for so many years that I forgot about the limitations in MW alone.
User avatar
matt
 
Posts: 3267
Joined: Wed May 30, 2007 10:17 am

Post » Sun May 01, 2011 11:48 pm

You can force equip an item on the player using the Equip function. This is done in some scripts to make cursed armor or weapons that can't be removed until certain other conditions are met, and then the armor or weapon is removed via script or the player is allowed to remove it by stopping the call on the equip function. You can't force-unequip an item though. You can only remove the item, or make it so the player can't re-equip the item using SkipEquip. Actually, I'm not sure if you can use SkipEquip to un-equip an item that's already equipped. It's worth testing out.

Well, if i use equip, then equip again, the first item would have to be unequipped, right?

if so, then is there something that can make an item simply dissappear? removeitem, perhaps?
User avatar
Adrian Powers
 
Posts: 3368
Joined: Fri Oct 26, 2007 4:44 pm

Post » Sun May 01, 2011 5:52 pm

Well, if i use equip, then equip again, the first item would have to be unequipped, right?

if so, then is there something that can make an item simply dissappear? removeitem, perhaps?

Yes, equipping a second item unequips the first (edit: the equip function needs Tribunal or Bloodmoon)
Yes, removeitem would do that for you.

here's an example for unequipping a cuirass:
player-> additem "my_junk_cuirass" 1
player-> equip "my_junk_cuirass"
player-> removeitem "my_junk_cuirass" 1

Replace "my" with something unique you use only in that mod; maybe NosEq. You'll also need to make your junk item, the game can't make something that doesn't exist.
User avatar
Dragonz Dancer
 
Posts: 3441
Joined: Sat Jun 24, 2006 11:01 am

Post » Sun May 01, 2011 5:38 pm

Yes, equipping a second item unequips the first
Yes, removeitem would do that for you.

here's an example for unequipping a cuirass:
player-> additem "my_junk_cuirass" 1
player-> equip "my_junk_cuirass"
player-> removeitem "my_junk_cuirass" 1

Replace "my" with something unique you use only in that mod; maybe NosEq. You'll also need to make your junk item, the game can't make something that doesn't exist.


Yeah, but the OP specified no script extender, Tribunal, or Bloodmoon... and:
Equips the given item on its owner. Note that this function does not work as intended some of the time. Equipping items on the player often does not work, although I had successfully equipped repair hammers from a script. Similarily with NPCs, equipping weapons/armor may not be possible although you can make them quaff potions.

Note that this function appears to be broken in the original Morrowind game (you may receive a bad function code error in the game or things simply will not work) but is fixed with the Tribunal expansion. In Tribunal you can successfully get NPCs to equip weapons/armor as well as on the player.


This quote is from the UESP wiki, and my own experiences with equip and vanilla morrowind are in line with that.
User avatar
Chad Holloway
 
Posts: 3388
Joined: Wed Nov 21, 2007 5:21 am

Post » Sun May 01, 2011 10:35 pm

Yeah, but the OP specified no script extender, Tribunal, or Bloodmoon... and:

yes, this is correct.

Can anyone else think of any commands that might be used for the other stuff? Also, it would probably require a timer, so does anyone know the time ratio in morrowind?
User avatar
matt
 
Posts: 3267
Joined: Wed May 30, 2007 10:17 am

Post » Sun May 01, 2011 11:51 pm

yes, this is correct.

Can anyone else think of any commands that might be used for the other stuff? Also, it would probably require a timer, so does anyone know the time ratio in morrowind?


Time ratios are altered by several mods, but the normal is 30 to 1.
User avatar
Kahli St Dennis
 
Posts: 3517
Joined: Tue Jun 13, 2006 1:57 am

Post » Sun May 01, 2011 8:55 pm

Time ratios are altered by several mods, but the normal is 30 to 1.

as in 1 hour in morrowind=30 minutes?
User avatar
Avril Churchill
 
Posts: 3455
Joined: Wed Aug 09, 2006 10:00 am

Post » Sun May 01, 2011 9:36 pm

as in 1 hour in morrowind=30 minutes?

No, if you stand around for 1 minute real-time, 30 minutes of game time will have passed. A day goes by in something just under an hour of real-time.
User avatar
Greg Cavaliere
 
Posts: 3514
Joined: Thu Nov 01, 2007 6:31 am

Post » Mon May 02, 2011 1:22 am

No, if you stand around for 1 minute real-time, 30 minutes of game time will have passed. A day goes by in something just under an hour of real-time.

ok, thanks.

Edit: and what of the global scripts? I don't understand how to start them...
User avatar
Celestine Stardust
 
Posts: 3390
Joined: Fri Dec 01, 2006 11:22 pm

Post » Sun May 01, 2011 11:23 pm

Hope no one minds about the double post, but I now have the construction set, so I'm open to ANY scripting options not available to me before. I have scripted spells and the extender, also
User avatar
Eire Charlotta
 
Posts: 3394
Joined: Thu Nov 09, 2006 6:00 pm

Post » Sun May 01, 2011 3:07 pm

ok, thanks.

Edit: and what of the global scripts? I don't understand how to start them...


Open the construction set, under Gameplay>Edit start scripts and add the script there, or in dialogue or another script use an event or dialogue with the startscript "Whateverscript". You're going to want Morrowind Scripting for Dummies for a reference, and you'll also want to check out this http://www.uesp.net/wiki/Tes3Mod:Alphabetical_Function_List to learn and check how various functions work.

By the way, having the construction set doesn't give you options for Tribunal and Bloodmoon functions and items unless you have those expansions installed....
User avatar
Sweets Sweets
 
Posts: 3339
Joined: Tue Jun 13, 2006 3:26 am

Post » Mon May 02, 2011 1:03 am

Open the construction set, under Gameplay>Edit start scripts and add the script there, or in dialogue or another script use an event or dialogue with the startscript "Whateverscript". You're going to want Morrowind Scripting for Dummies for a reference, and you'll also want to check out this http://www.uesp.net/wiki/Tes3Mod:Alphabetical_Function_List to learn and check how various functions work.

By the way, having the construction set doesn't give you options for Tribunal and Bloodmoon functions and items unless you have those expansions installed....

When you say "installed", you mean that i used the disks to put the data into the computer, and, when opening the construction set, I activate those files?
User avatar
Emma Copeland
 
Posts: 3383
Joined: Sat Jul 01, 2006 12:37 am

Post » Sun May 01, 2011 7:19 pm

When you say "installed", you mean that i used the disks to put the data into the computer, and, when opening the construction set, I activate those files?


Yup.
User avatar
D LOpez
 
Posts: 3434
Joined: Sat Aug 25, 2007 12:30 pm

Post » Sun May 01, 2011 10:24 pm

When you say "installed", you mean that i used the disks to put the data into the computer, and, when opening the construction set, I activate those files?

Yes. After you install the expansions and activate them in the CS when working on your mod, you can use the new script possibilities that they have.
User avatar
Poetic Vice
 
Posts: 3440
Joined: Wed Oct 31, 2007 8:19 pm


Return to III - Morrowind