evanbgood Posted June 17, 2010 Share Posted June 17, 2010 Hello there, I'm quite new to scripting and modding in general. I'm learning a lot from the various forums and wikis out there, but I'm still stuck on this one mod I'm trying to make. I'm trying to expand upon this mod: http://www.tesnexus.com/downloads/file.php?id=29149 It's pretty simple. When player isincombat == 1 the script displays a message. When combat ends, the message goes away. I like this idea of a visual "combat alert" that doesn't require me to be sneaking to know I'm in danger. However, I didn't like how it monopolized the message screen. So, I tried to think of where else it could go. I'm assuming a UI mod would be WAY over my head, even though that would probably be the coolest looking. Instead, I decided to go with a spell or ability to add an icon to the active effects bar at the top of the screen (using Darnified, but I'm pretty sure vanilla has that bar). I tried to make a custom spell with no effect, then activated it by adding player.addspell combatalert to the if isincombat == 1 string and player.removespell combatalertto the if isincombat == 0 string. It... almost works. This is what happens: Player is attacked.Combat Alert added message spams the message box.Blank effect is added, but icon is not visible anywhere but in the player's spell menu (fortified effects section)Effect goes away when combat ends. I also had to destroy the (seemingly) unused magic effect BA08 so I could add a custom icon and blank script and such.I'd be happy to get any advice that would move me forward on this one. For now, I'm going to take a break... I've been reading on this stuff all day! Link to comment Share on other sites More sharing options...
AxelDominatoR Posted June 17, 2010 Share Posted June 17, 2010 Hi! You may try setting the spell as "Ability" type, with duration set to 0. You will addspell and removespell accordingly. I don't know if that will show the effect icon, tough. Another thing you may try is having the spell as "Lesser Power" and changing "player.addspell" to "player.cast". Spell may be cast even if they are not into the spell list, and when cast the effect icon will appear in the effects bar.Then, you may want to play with the script to terminate the spell when combat ends ( I think the Dispel script function to dispel the currently active spell may do what do you need ). You may want to put a very high duration and spell cost manually to 0 (unchecking "Auto calculate" ). Tell us if things seem to work this way; some problems may raise with spell casting animation and such. If yes, then you may try creating an item with a magic effect and equipping and unequipping it on combat. By setting no body equip part on the item you will be always able to equip and unequip it without interfering with existing equipment. Link to comment Share on other sites More sharing options...
evanbgood Posted June 18, 2010 Author Share Posted June 18, 2010 Thanks for trying! Unfortunately those didn't quite seem to work. I already had it set as an ability (that's the closest to success I've had), but that had message spam and didn't make a bar icon. The lesser power idea didn't make the bar icon and, for some reason, player got stuck with his arm lifted in the air, like he was casting, but nothing happened. Funny, if nothing else! Lesser power with addspell didn't seem to do anything at all other than a (strangely) non-spammed message that the spell had been added. I haven't tried the item idea yet, but I already forsee a problem. Items never produce effect bar icons do they? Unless they're potions... but those would go away after one use. Perhaps an item that "casts" a "permanent" enchantment on the player, then a script to dispel that? Is that possible? I haven't even tinkered with item making yet, so that could be a challenge. Link to comment Share on other sites More sharing options...
David Brasher Posted June 18, 2010 Share Posted June 18, 2010 You can kill spam with two identical messages in a row. SCN AASpamalotSCRIPT Begin Gamemode If Getdistance Player < 1000 Message " " Message " " Message " SPAM! " EndIf End With this script, you won't see the word " SPAM! " There will only be blank messages you won't see. But you probably already know this and have plans to eliminate your spam when you are done using it to test the function of your mod. A spell icon would be the most pleasing. A breath bar, sneak icon, or cursor icon might look bad. Unless you could have the aiming reticule change color or shape like it does in some first-person shooters. Link to comment Share on other sites More sharing options...
evanbgood Posted June 30, 2010 Author Share Posted June 30, 2010 A spell icon would be the most pleasing. A breath bar, sneak icon, or cursor icon might look bad. Unless you could have the aiming reticule change color or shape like it does in some first-person shooters. I agree with that, definitely, a subtle UI change like you would see in an MMO, such as a red boarder around the status bar or a tiny icon that changes to crossed swords, would look great. Unfortunately, UI modding is WAY out of my skill level and if I did it, I'd want it to work into Darnified UI. The spell icon would work best for now, if it were possible. I'm kinda surprised that no one else has come up with something like this, actually. Usually when I imagine a "convinience" mod, I end up finding it already made somewhere. I can't imagine I'm the only one who likes to play without music yet doesn't like to be randomly smacked in the back of the head. If anyone knows of a mod that simply does what I'm looking for without monopolizing the message bar, I'd love to see it. Link to comment Share on other sites More sharing options...
AxelDominatoR Posted July 1, 2010 Share Posted July 1, 2010 Here's another idea.Anyone knows if an activator/npc which casts a spell upon you will show an effect icon? I think yes, but I'm not sure. If I'm right, then you may create an invisible activator. Every time you want to show the icon you may "MyActivator.moveto player 0,0,100" and then "MyActivator.Cast CombatActiveEffect player" The effect duration can then be controlled via OBSE, so you may have a quest script which checks every 3-5 secs if combat is still on or not and update the effect duration accordingly. If icons appears when someone casts something to you, then this should work. Link to comment Share on other sites More sharing options...
evanbgood Posted July 2, 2010 Author Share Posted July 2, 2010 Sounds awesomely over my skill level, as well! Interesting idea, though. Although it does seem a bit complex for something that doesn't seem like it should be, eh? I'm not 100% sure if external effects do that, though. I think the only thing that might actually pop up there are timed enchantments. Either way, I think I'm in over my head, so if anyones curious enough to throw something like this together, I'd love to see it. If not, I'll just make do with the message alert. It's still better than being snuck up on! Link to comment Share on other sites More sharing options...
AxelDominatoR Posted July 4, 2010 Share Posted July 4, 2010 I made a brief proof-of-concept to test my idea and it does works! This is not hard to do, I'll write you a brief tutorial: 1) If you don't have one already, create an empty test cell. In the Cell Editor scroll down until you find TestQuest01, double click it and the "Duplicate Cell". Assign a name like "MyTestCell". Then doubleclick MyTestCell to load it into the editor. 2) Create an Activator, by going into WorldObjects->Activators, then renaming ActivatorFlameNode0 to "MyActivator". The CS will ask if you want to duplicate it, press Yes. Now, drag "MyActivator" into the "MyTestCell" you already opened into the cell editor. You will create a reference item. Double click it and you will have a window. Name the reference "MyActivatorRef", then set it "Initially Disabled" and "Persistent Reference". 3) Create a new spell. Name it "MyCombatStatusSpell" or something. Type should be "Spell", check everything except "PC Start Spell". Uncheck Auto-Calculate and ensure spell cost is 0. 4) Add a new effect to "MyCombatStatusSpell". Type: "Script Effect", Range: "Touch", Duration "20". Script NONE, Visual Effects NONE, uncheck Effect is Hostile. 5) Last step: every time you want your icon to show up, simply write this code: MyActivatorRef.MoveTo player 0, 0, 0 MyActivatorRef.Cast MyCombatStatusSpell player Ok, so the following will happen: the invisible activator is moved to the player and will cast a spell. The spell has no effect and the only thing visible is the icon which will be displayed for 20 seconds (the duration of the spell effect). As I said, it is just a proof of concept, but with a few tweaks you may be able to adapt it and tweak the duration (you may choose to have for example a very high duration of 999something and then removing the spell effect when you are out of combat). I hope I didn't forget anything. Let me know if this works for you! Link to comment Share on other sites More sharing options...
Recommended Posts