TheDarkWearoner75 Posted November 6, 2021 Share Posted November 6, 2021 Good afternoon, I have a problem with displaying debug notifications and casting spells on player. I made kind of magic altar with activator and script which should, when you click on the activator, show a menu on the screen in which you can choose one of three options and get a temporary magic effect. So far, I've managed to get only one option from the menu to give out a magic effect and show debug notification. I can't cram two Event OnActivate into one script, and I also can't make two separate scripts with these events, since only one still works When I try to make a function with IntButton and Elseif then I don't have any debug notification displayed at all despite the fact that when compiling the script, I don't get any errorsI'm just lost in guesses and don't know what to do with it and how to make my altar works correctly Link to comment Share on other sites More sharing options...
Sphered Posted November 7, 2021 Share Posted November 7, 2021 Event OnActivate(ObjectReference akActionRef) Bool ShowMenu = akActionRef.GetFormID() == 0x14 && WhateverOtherConditionsYouWant() If ShowMenu Int Prompt = WhateverMessage.Show() If Prompt == 1; Choice 1 EffectOne.Cast(akActionRef) Debug.Notification("You have gained " + EffectOne.GetName()) ElseIf Prompt == 2; Choice 2 EffectTwo.Cast(akActionRef) Debug.Notification("You have gained " + EffectTwo.GetName()) ElseIf Prompt == 3; Choice 3 EffectThree.Cast(akActionRef) Debug.Notification("You have gained " + EffectThree.GetName()) EndIf EndIfEndEvent Above assumes choice 0 is set to cancel so adapt as desired. This also assumes you named your effects so again tailor as wanted Link to comment Share on other sites More sharing options...
TheDarkWearoner75 Posted November 7, 2021 Author Share Posted November 7, 2021 Thanks for the help! And taking this opportunity, I want to ask: is it possible to make each of these three options give out two more spells in random order and show the corresponding debug notifications? Is it possible to add something to the script for this?It seems to me that this is an impossible thing, but nevertheless Link to comment Share on other sites More sharing options...
TheDarkWearoner75 Posted November 17, 2021 Author Share Posted November 17, 2021 Greetings once again, I tried your script and it seems that I have correctly set all the properties, but when compiling I get an error "GetName is not a function or doesn't exist" What should I do with it? Link to comment Share on other sites More sharing options...
dylbill Posted November 17, 2021 Share Posted November 17, 2021 GetName requires skse. If you don't want to use skse, replace GetName with a string such as "Ability A". You can also use a string property and set it's value in the creation kit. String Property AbilityNameA Auto Debug.Notification("You have gained " + AbilityNameA) Although, I would recommend just using another message form that's not a message box to display the notification. Reason being it makes your mod easier to translate, and with debug.notification sometimes doesn't display capitals correctly. Link to comment Share on other sites More sharing options...
Sphered Posted November 17, 2021 Share Posted November 17, 2021 String format is just a Bethesda quirk. If the engine has already declared a string in a certain context it doesnt change between upper and lower if it sees that string again A somewhat reliable workaround is to declare a Read Only String Property where it is the visually preferred format. Couple other tricks too but I havent scripted for a while so dont remember them but the readonly thing is good Link to comment Share on other sites More sharing options...
dylbill Posted November 18, 2021 Share Posted November 18, 2021 Cool, I didn't know about the Read Only trick. Thanks for the info. Link to comment Share on other sites More sharing options...
TheDarkWearoner75 Posted November 18, 2021 Author Share Posted November 18, 2021 Thank you both for your help!I'll also try to do something about it and let you know if something goes wrong again Link to comment Share on other sites More sharing options...
Recommended Posts