Jump to content

Rizalgar

Supporter
  • Posts

    193
  • Joined

  • Last visited

Everything posted by Rizalgar

  1. Ok, the answer is most likely "No" but I figured it worth asking. Say I have a global, let's say Defense. Can I have two seperate NPC's read that global with two different values? So that each NPC has their own "Defense" set by the same global? Edit - Don't code half asleep. The answer is obvious Assign them a script with the global....
  2. Fortunately for you, I've been working with a hella lot of this lately. All it involves is a few Global Variables, some custom scripts and you're good to go. Edit - I guess I shouldn't be so vague... Create a global, call it OneHandXP or whatever. Create a script. Call to the global and apply the experience formula. I've been working with custom skill experiences so I'm not sure what the default XP modifier is to look for, but I am sure the Wiki will elt you know. However, your script should look something like this ScriptName SomeExperienceScript Extends Actor ( ? I believe, mine use Object reference but they're handled a different way. Could be quest, can't say.) GlobalVariable Property OneHandXP Auto Event OnHit(on hit stuff, can't remember off the top of my head, Wiki, my friend :P | or however you're wanting to call the experience gain) ;;find way to get damage or however it is you want to level the skill;; (OneHandXP.GetValue().SetValue + modifier) EndEvent Come cross any troubles, or if you want to get more in depth with me on it about how to create it, lemme know Here's a relatively simple script to modify the skill. Create, duplicate or use an original weapon. Add this script to a magic effect, add that to an enchant, then add that to the weapon. Scriptname OneHandMachoMan Extends ActiveMagicEffect GlobalVariable Property OneHandXP Auto Event OnEffectStart(Actor akTarget, Actor akCaster) If akCaster == Game.GetPlayer() Int Damage = Utility.RandomInt(0,10) ;; or however much damage you want to do Int XP = Damage ;; can be multiplied, added to, subtracted from, whatever akTarget.DamageActorValue("Health", Damage) OneHandXP.SetValue(OneHandXP.SetValue() + (Damage)) EndIf EndEvent
  3. I'm actually running into the same problem with Exterior World spaces. I don't know what's going on, but you find an answer let me know lol
  4. Oof, well, guess that would be better than starting all over. Too bad I already did that. It seems to occur (from multiple tests on my end) if you manually the set world space height in the WorldSpace options box. IDK, that's the case for me anyway. Creating a new world, leaving it all default, then manually raising and flattening the land didn't replicate the error. Everytime I tried to set the default land height to a set value though, it sure did chop the world up. Anyone else able to confirm this bug? Not that Beth will fix it but...
  5. Holy crap. The way you put it. I've been doing it the hard way and overworking myself. I greatly appreciate it. Just made my life tons easier! I will definitely check out the video as well, thank you Ishara!
  6. Ok, before I go to sleep I have one question for you guyses. How do I disable an Activator? Google has failed me, yet again. Thanks in advance for any replies. Here is the script, which compiles and everything, albeit incomplete, but I cannot select the activator (GardenEastWall) in the Properties window. Scriptname RS_Construction_ParlorGate extends ObjectReference MiscObject Property Gold001 Auto ;; Message Property RS_Message_Construction_Garden_ParlorDoor Auto ;; ObjectReference Property GardenEastWall Auto ObjectReference Property ParlorWall1 Auto ObjectReference Property ParlorWall2 Auto Function Enable(bool abFadeIn = false) native Event OnActivate(ObjectReference akActivator) If akActivator != Game.GetPlayer() ;ignore Else Int aType = RS_Message_Construction_Garden_ParlorDoor.Show() If aType == 0 ;yes Int Gold = Game.GetPlayer().GetItemCount(Gold001) If Gold < 1000 Debug.MessageBox("The Parlor costs 1000 gold") Else GardenEastWall.Disable(False) ParlorWall1.Enable() ParlorWall2.Enable() Game.GetPlayer().RemoveItem(Gold001, 1000) EndIf EndIf EndIf EndEvent
  7. I thought creating a world space would be easy. It is, really. The problem is when I load the damn thing and in game the world space is cut into tiles, by cell. I've tried googling the issue but can't find anything relatable. Have any of you run across this? Were you able to remedy it? Sorry for the crappy Paint picture to show, but the Screenshot was too big of a file and I'm not creating a pastebin account just to upload it.
  8. Yeah I see how doing it consecutively can be an issue for getting the current vs the last. That'll be a task all on its own. I have a script on an ME, attached to an Enchantment, attached to an Explosion, attached to a Projectile. Any idea why a simple debug like this won't print? Event OnEffectStart(Actor akTarget, Actor akCaster) Debug.MessageBox("Hit") EndEvent Whenever CK finishes loading I'll send screens of the Effects Edit -- For anyone trying to achieve a similar thing, make your Magic Effect as a Fire & Forget Contact, make your Enchantment the same, do not choose Constant Effect. Attach the script to the ME, attack the EN to the weapon, and voila, you got your script reading in game. Don't forget to set the EN charge to at least 1 with a cost of 0. Or that's what I needed in my case, anyway.
  9. I thank you for your reply! I'm curious to get it how to work though. I've tried using an OnHit script with a bow and on the arrows to do a simple debug but it never prints out. So I'm no quite sure where to even begin. Edit -- I think the Elemental Arrows mod uses some scripts. I'm going to check it out see how he does it. If it's even relatable to what I'm trying to achieve, that is.
  10. Okay, thanks for checking out my topic :smile: I need to create a script that reads the players damage output. So, let's say I shoot a bow at an enemy. I need to be able to read that damage so that I can have my script change a global variable. Any ideas on how to accomplish this? I know there's a 'flaoting numbers' mod out there. I'll take a peek into it in the mean time. As long as it doesn't use an ini file, I think I can maybe figure it out. Otherwise, I'm heavily relying on you guys to help me with this one :tongue: --- Edit, checked out the floating numbers mod. It DOES use an Ini file instead of a plugin with scripts. RIP --- Edit2, I'm sure I could use the GetBaseDamage function attach it to the weapon and apply my script that way using a static multiplier, but I'm trying to use the actual damage instead of a static. --- Edit3, Would perhaps an OnHit function work? Have an OnHit check for Max/Current AV? It's a thought. I'll be giving that a go in the meantime.
  11. Ok, I'm wondering if I can call a Float from outside a Function/Event. I ask because my attempts so far have been futile. So maybe one of you guys know a way, or whether it's even possible. Edit 2 - I can post the actual script if prefered, it's not too long. Yet. Edit 3 - Removed the dumb example script and replaced it with my actual script. Sorry, I have yet to figure out how to hide content so the scripts not spamming on page load. Edit 4 - Ok, you CAN call from outside a function... However, it's not doing the multiplication part. I could use some advice as to why. Is there a max of one math function or something? Float MXP = AStrikeXP + Damage * XPMultiplier Is the bit in question Figured it out. For anyone who runs across a similar error, all I had to do was change the XPMultiplier from a Float to an Int. Easy sauce.
  12. Anyone know why these errors are popping up? Are they not defined in the framework? I'm at a real loss here. I got it to work, using Rasikko's method. In the external function call I just had to add (akTarget, akCaster).
  13. I thank you for your reply, sir! I'll keep that in mind. Now if only I could figure out why a script calling a function from another script keeps compiling with "aktarget is not defined... blah blah..."
  14. Ah, I thought you just wanted a Z reference for height.
  15. Place an item, then check its editor info. If I'm understanding the question correctly.
  16. Yep, confused lol. Let me read it 40 more times and get back to you Edit --- Yeah, super confused. I'm not sure where to put this in the script. Given I've been drinking, I think even sober I'd still be confused New errors on compile with that. Saying the ak's aren't specified or whatever \RS_Spell_SmokeRush_Script.psc(13,32): argument akcaster is not specified and has no default value \RS_Spell_SmokeRush_Script.psc(13,32): argument aktarget is not specified and has no default value \RS_Spell_SmokeRush_Script.psc(13,32): argument akspell is not specified and has no default value \RS_Spell_SmokeRush_Script.psc(13,7): type mismatch while assigning to a float (cast missing or types unrelated) \RS_Spell_SmokeRush_Script.psc(10,0): the parameter types of function oneffectstart in the empty state on script rs_spell_smokerush_script do not match the parent script activemagiceffect.
  17. Ok, I am trying to get it to compile, but the spell script throws errors about not matching the parent script (I'm assuming it means the Quest script) Here is both of the scripts. The Spell script followed by the Quest script. Sorry about the spacing, I didn't think I'd have to do this. Scriptname RS_Spell_SmokeRush_Script extends ActiveMagicEffect {Smoke Rush Script} Spell Property SmokeRush Auto rsFrameworkAncientMagicks Function GetFrameworkAncientMagicks() Global Return (Game.GetFormFromFile(0x594A88, "Rizalgars Skyscape") as Quest) as rsFrameworkAncientMagicks EndFunction Event OnSpellCast(Form akSpell) If akSpell == SmokeRush GetFrameworkAncientMagicks().SmokeRush EndIf EndEvent Event OnEffectStart(Spell akSpell) EndEvent Scriptname rsFrameworkAncientMagicks extends Quest {Main framework for Ancient Magicks handling XP, Damage and Damage effects} ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Call to main RsFrameworkMenu ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; rsFrameworkMenu Function GetFrameworkMenu() Global Return (Game.GetFormFromFile(0x294A97, "Skyscape.esm") as Quest) as rsFrameworkMenu EndFunction ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;; ;;;; ;;; ;; ; ;; ;;; ;;;; ;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;; ;; MiscObject Variables ;; ;;;;;;;;;;;;;;;;;;;;;;;;;; MiscObject Property AirRune Auto MiscObject Property WaterRune Auto MiscObject Property EarthRune Auto MiscObject Property FireRune Auto MiscObject Property ChaosRune Auto MiscObject Property DeathRune Auto MiscObject Property BloodRune Auto MiscObject Property SoulRune Auto ;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;; ;;;; ;;; ;; ; ;; ;;; ;;;; ;;;;; ;;;;;;;;;;;;;;;;;;;;; ;; Spell Variables ;; ;;;;;;;;;;;;;;;;;;;;; Spell Property SmokeRush Auto Spell Property SmokeBurst Auto Spell Property SmokeBlitz Auto Spell Property SmokeBarrage Auto Spell Property ShadowRush Auto Spell Property ShadowBurst Auto Spell Property ShadowBlitz Auto Spell Property ShadowBarrage Auto Spell Property BloodRush Auto Spell Property BloodBurst Auto Spell Property BloodBlitz Auto Spell Property BloodBarrage Auto Spell Property IceRush Auto Spell Property IceBurst Auto Spell Property IceBlitz Auto Spell Property IceBarrage Auto Spell Property SmokeRushPoison Auto ;;;;;;;;;;;;;;;;;;;;; ;; ;; ;;;;;;;;;;;;;;;;;;;;; ;;;;; ;;;; ;;; ;; ; ;; ;;; ;;;; ;;;;; ;;;;;;;;;;;;;;;;;;; ;; XP Multiplier ;; ;;;;;;;;;;;;;;;;;;; Float XPM = 1.0 ;;;;;;;;;;;;;;;;;;; ;; ;; ;;;;;;;;;;;;;;;;;;; ; ;; ;;; ;;;; ;;;;; ;;;;;;;;;;;;;;;;;;;;;;;; ;; Spell Calculations ;; ;;;;;;;;;;;;;;;;;;;;;;;; Function SmokeRush(Actor akCaster, Actor akTarget, Spell akSpell) If akCaster == Game.GetPlayer() Int AirRuneCt = Game.GetPlayer().GetItemCount(AirRune) Int FireRuneCt = Game.GetPlayer().GetItemCount(FireRune) Int ChaosRuneCt = Game.GetPlayer().GetItemCount(ChaosRune) Int DeathRuneCt = Game.GetPlayer().GetItemCount(DeathRune) If AirRuneCt < 1 || FireRuneCt < 1 || ChaosRuneCt < 2 || DeathRuneCt < 2 Game.GetPlayer().UnequipSpell(SmokeRush, 0) Game.GetPlayer().UnequipSpell(SmokeRush, 1) Debug.Notification("You lack the required runes") Else Int Poison = Utility.RandomInt(0,1) If Poison == 1 Game.GetPlayer().RemoveItem(AirRune, 1) Game.GetPlayer().RemoveItem(FireRune, 1) Game.GetPlayer().RemoveItem(ChaosRune, 2) Game.GetPlayer().RemoveItem(DeathRune, 2) Int dam = Utility.RandomInt(1,13) akTarget.DamageAV("Health", dam) akTarget.AddSpell(SmokeRushPoison) Debug.Notification("The enemy is poisoned") Float BaseXP = 30 Float MMXP = ((BaseXP) + dam * XPM) rsFrameworkMenu.rsXPGain("magic", MMXP) Else Game.GetPlayer().RemoveItem(AirRune, 1) Game.GetPlayer().RemoveItem(FireRune, 1) Game.GetPlayer().RemoveItem(ChaosRune, 2) Game.GetPlayer().RemoveItem(DeathRune, 2) Int dam = Utility.RandomInt(1,13) akTarget.DamageAV("Health", dam) Float BaseXP = 30 Float MMXP = ((BaseXP) + dam * XPM) rsFrameworkMenu.rsXPGain("magic", MMXP) EndIf EndIf EndIf EndFunction ;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;; Just realized I forgot to drop the .esp at the end of GetFormFromFile, but I doubt that's the reason. the parameter types of function oneffectstart in the empty state on script rs_spell_smokerush_script do not match the parent script activemagiceffect ------- is the error I'm getting Edit 2 ----- I forgot to drop the spell script back into OnEffectStart instead of OnSpellCast. But I have tried both ways
  18. Hmm, I just had a thought. Maybe I could just create a 'framework' that contains all of the information, then just create a script for each spell that calls to said framework. That sounds plausible, yeah? It would save a tremendous amount of time over not setting properties 4+ times for each spell. Instead I could just make one script, set all the properties and spell effects, then have the spell script call from this script.
  19. My bad. The spells themself have no defined effect, the effect is determined by the script. So I'm wondering if I can have multiple spell effects in a script, with each effect for a specific spell, but the specified effect only triggers when the proper spell is cast. So say I have 'Damage A' and 'Damage B' in a script. Then I have 'Spell A' and 'Spell B'. If I cast 'A' is it possible to have the script read that specific spell was cast, and only do the function for that spell, or would it trigger 'B' effect as well? This is for player specific spells.
  20. Ah, I figured as much. I'm rewriting the whole thing using custom functions to see if I can maybe get a call that way. But probably not :laugh: Edit - One more question... Would it be possible then, to instead, have one script on multiple spells, that only casts the effects of the spell currently equipped?
  21. Is it possible to use a script that updates a global variable when a spell is cast? My attempts so far have proven futile, or it could be the way my Quest is setup to check for the spell, since I'm not even getting debug with the spell cast. Quest is set up as Start Game Enabled, no other changes. Does Run Once need to be checked? I need it to check everytime the spell is cast though so I'm not sure, I've heard different opinions on this. Here is the bit of script I am using to get the check, which again, I have not gotten working. (This is based off the Wikipedia for OnSpellCast, which I am most certain has to actually be attached to the spell, but I'm not sure of what other way to get the check) Event OnSpellCast(Form akSpell) Spell spellCast = akSpell as Spell If spellCast == AirStrike Debug.Notification("Broke") EndIf EndEvent
  22. Okay, TripleSixes is a busy person, which is entirely understandable... SO! I'm here to ask you guys :smile:. Am I calling this from the wrong location or something? I cannot seem to get it to Unequip the spell when not having the proper items. The only thing I can think of is calling an If statement for each required item, but he used the same formula in his other spells and they worked without a hitch. So, any clues, super awesome scripters in the Skyrim community? Before it gets asked, everything in the script works flawlessly minus the Unequip, it's the only thing here I'm having trouble with. Part not working is asterisked. Scriptname RS_Spell_FireBolt_Script extends activemagiceffect {Fire Bolt script} Spell Property FireBolt Auto MiscObject Property AirRune Auto MiscObject Property ChaosRune Auto MiscObject Property FireRune Auto Event OnSpellCast(Form akSpell) EndEvent Event OnEffectStart(Actor akTarget, Actor akCaster) If akCaster == Game.GetPlayer() Int AirRuneCt = Game.GetPlayer().GetItemCount(AirRune) Int ChaosRuneCt = Game.GetPlayer().GetItemCount(ChaosRune) Int FireRuneCt = Game.GetPlayer().GetItemCount(FireRune) ***** If AirRuneCt < 3 && ChaosRuneCt < 1 && FireRuneCt < 4 Game.GetPlayer().UnequipSpell(FireBolt, 0) Game.GetPlayer().UnequipSpell(FireBolt, 1) ***** Else Game.GetPlayer().RemoveItem(AirRune, 3) Game.GetPlayer().RemoveItem(ChaosRune, 1) Game.GetPlayer().RemoveItem(FireRune, 4) Int damage = Utility.RandomInt(1,12) akTarget.DamageActorValue("Health", damage) Float BaseXP = 22.5 Float ModMagicXP = ((BaseXP) + damage) rsFrameworkMenu.rsXPGain("magic", ModMagicXP) EndIf EndIf EndEvent
  23. I'm sorry to be late getting back to the party. I really appreciate you guys helping me out here. I got a hold of TripleSixes and he told me how to access his API, which was all I needed to do. Thank you again!
×
×
  • Create New...