fg109 Posted April 17, 2012 Author Share Posted April 17, 2012 (edited) Well, this is what I came up with: Scriptname ESG_RefundMessageScript extends ActiveMagicEffect GlobalVariable Property ESG_RefundPoints Auto Message Property ESG_MainMenuRefund Auto Message Property ESG_MagicalRefund Auto Message Property ESG_PhysicalRefund Auto FormList Property ESG_SkillMessageLists Auto FormList Property ESG_GroupMessageLists Auto Formlist Property ESG_PerkMessageLists Auto Spell Property ESG_RefundSpell Auto Actor Player Event OnEffectStart(Actor akTarget, Actor akCaster) Player = Game.GetPlayer() MenuTier01() if (ESG_RefundPoints.Value == 0) Player.RemoveSpell(ESG_RefundSpell) endif Dispel() EndEvent Function MenuTier01() int choice = ESG_MainMenuRefund.Show(ESG_RefundPoints.Value as Int) if (choice == 2) Return else MenuTier02(choice) endif EndFunction Function MenuTier02(Int StyleChoice) int choice if (StyleChoice == 0) ;magical refund choice = ESG_MagicalRefund.Show(ESG_RefundPoints.Value as Int) else ;physical refund choice = ESG_PhysicalRefund.Show(ESG_RefundPoints.Value as Int) endif if (choice == StyleChoice + 5) MenuTier01() else MenuTier03(StyleChoice, choice) endif EndFunction Function MenuTier03(Int StyleChoice, Int SkillChoice) int choice = ((ESG_SkillMessageLists.GetAt(StyleChoice) as FormList).GetAt(SkillChoice) as Message).Show(ESG_RefundPoints.Value as Int) if (choice == 4) MenuTier02(StyleChoice) else MenuTier04(StyleChoice, SkillChoice, choice) endif EndFunction Function MenuTier04(Int StyleChoice, Int SkillChoice, Int PerkChoice) int GroupIndex = (SkillChoice * 4) + PerkChoice int choice = ((ESG_GroupMessageLists.GetAt(StyleChoice) as FormList).GetAt(GroupIndex) as Message).Show(ESG_RefundPoints.Value as Int) if (choice == 6) MenuTier03(StyleChoice, SkillChoice) else int PerkIndex = (StyleChoice * 5) + SkillChoice Player.AddPerk((ESG_PerkMessageLists.GetAt(PerkIndex) as FormList).GetAt(PerkChoice) as Perk) ESG_RefundPoints.SetValueInt((ESG_RefundPoints.Value as Int) - 1) endif EndFunction No doubt someone else could come up with someone better (JustinOther and PurpleLunchBox seems to use a lot of menus in their mods) but it should get the job done. Now I got to wondering why this is happening the way it is happening. Does Show() pause your script until the user selects an option to give it something to return, meaning the while loop is not running while a menu is active? Or does the while loop keep running? The script is paused until an option is selected. Once something is selected, the while loop should continue running. Edited April 17, 2012 by fg109 Link to comment Share on other sites More sharing options...
elseagoat Posted April 17, 2012 Share Posted April 17, 2012 Wish I was as smart as you... works perfectly and is ten times simpler than my script, in terms of legibility. Plus it actually works. Link to comment Share on other sites More sharing options...
Woverdude Posted April 17, 2012 Share Posted April 17, 2012 I don't have a script request, but I would like to put my support behind fg109. He's helped me through quite a number of scripting troubles, and I am very grateful for his help. I vouch for him. :smile: Link to comment Share on other sites More sharing options...
scrivener07 Posted April 17, 2012 Share Posted April 17, 2012 Ill throw my kudos in for fg too. Hes one of these forums best scripters. Keep up the awesome help! :thumbsup: Link to comment Share on other sites More sharing options...
ChampionOfHircine Posted April 17, 2012 Share Posted April 17, 2012 (edited) This is my first script ever so please explain it to me like I'm an idiot lol. I need to make the player fast travel at the end of a conversation. I know where to write the script to make it run at the end of the conversation but I have no idea what it should say. Can you just show me what it should look like? I don't know how to set where to travel to, how do I do that? Edited April 17, 2012 by ChampionOfHircine Link to comment Share on other sites More sharing options...
fg109 Posted April 17, 2012 Author Share Posted April 17, 2012 (edited) This is my first script ever so please explain it to me like I'm an idiot lol. I need to make the player fast travel at the end of a conversation. I know where to write the script to make it run at the end of the conversation but I have no idea what it should say. Can you just show me what it should look like? I don't know how to set where to travel to, how do I do that? http://www.youtube.com/watch?v=-GuuL6U8aZc @woverdude & scrivener07 :blush: <--- blushing emote doesn't blush! Edited April 17, 2012 by fg109 Link to comment Share on other sites More sharing options...
Fury945 Posted April 17, 2012 Share Posted April 17, 2012 Hi, Is it possible to script a spell so that it adds an effect (say like a disease) to the player,e.g. the player casts this spell and it does masses of damage to his opponent but adds an incurable (by normal means) disease to the player? I'd like to know this because I'm working on a construct race (e.g. an Android, it'd have to be Dwemer in origin) and I'd like them to be able to sacrifice a little bit of their energy/power/electricity (health) to hurt their enemies and then have to find a specific object to recharge them (most likely a power cell). Thanks This is possible, but it will require a scripted ability as well. So when you cast the spell, you add the scripted ability to the player. The scripted ability will keep checking the player to see if he has the disease, if not then it will add the disease to the player. You need the ability because diseases can be dispelled by a Cure Disease potion or a shrine. So as soon as your disease is dispelled, the scripted ability would re-apply it. Your recharging activator should remove the ability and the disease from the player when activated. Thank you,How would I go about the script?Also how would I get the ability to add itself to the player? Link to comment Share on other sites More sharing options...
ChampionOfHircine Posted April 17, 2012 Share Posted April 17, 2012 @fg109 It worked (I think) but I still don't go anywhere. I'm assuming it's because I have to set somewhere to travel to? How do I do that? Link to comment Share on other sites More sharing options...
MrMino Posted April 17, 2012 Share Posted April 17, 2012 Hi,Could you please help me with a script as part of a scene to make a group of NPCs suddenly appear.This is how the scene plays out:You walk into a deserted town with a friendly NPC and at some point hostile enemies appear out of nowhere, surrounding the player and attacking.I would be very grateful if you could provide any advice on how to achive this.cheers Link to comment Share on other sites More sharing options...
avenger404 Posted April 17, 2012 Share Posted April 17, 2012 Any chance that I could script a fight? It's a little specific, so I'll do what I can to explain... (the fight revolves 99% around magic spells) Step 1: Cast a certain spell 5 times (spell 1)Step 2: After 5 successful casts of spell 1, cast spell 2 (enables a bunch of really powerful runes on the floor, or just casts them himself (5-8x unique runes)Step 3: After successful cast of spell 2, cast spell 1 5x times.Step 4: After successful casts of spell 1, cast spell 3 (preferably he'd run to a certain area in the room he's in (will be only 1 area), and cast the spell at the player, or wait until the player is in range)Step 5: After successful cast of spell 3, cast spell 1 5x times.Step 6: After successful casts of spell 1, shout ice form on player (infinite version)Step 7: After successful shout, cast spell 4.Step 8: Repeat this procedure endlessly until he is at 1/4 health. (or player leaves)Step 9: At 1/4 health, heal up to 3/4 again.Step 10: Repeat steps 1-7 until he is at 1/4 health.Step 11: At 1/4 health, pull out a weapon and start attacking with melee until dead. If you can help with this, that'd be fantastic! I created a procedure package for steps 1-7, tried implementing it as a combat override, and it didn't work. If you could write a script (feel free to call spells (X,Y,Z or something like that) and just show me how to write something like this, that would help immensely. I have no idea what I'm doing when I try to script (I don't know terminology or anything, so any help you could give would be invaluable! Thanks for your time! Link to comment Share on other sites More sharing options...
Recommended Posts