Jump to content

Lunalle

Members
  • Posts

    12
  • Joined

  • Last visited

Nexus Mods Profile

About Lunalle

Lunalle's Achievements

Apprentice

Apprentice (3/14)

  • First Post
  • Collaborator Rare
  • Week One Done
  • One Month Later
  • One Year In

Recent Badges

0

Reputation

  1. Right, didn't even realize that perks could access global variables. Thanks for that. :)
  2. TLDR: How to stop skill xp from being rewarded automatically, but still able to increase skill via game.advanceskill (or alternative). My mod is coming along nicely, with a big thank you to this community. There are a couple things I'm still trying to work out, but this one in particular has me stumped. I've condensed some of the perk trees, and added my own. For example, "Light Armor" and "Heavy Armor" are now two branches on the same tree. Now I want to use the "Light Armor" tree for whatever (I chose fitness, but can be anything), the point is... how do I block the advancement of the skill when getting hit while in light armor? I originally set the Skill Usage Multiplier to 0, which worked well enough, but then I couldn't manually give skill xp either with game.advanceskill. I'm not sure where to go from here. Any pointers would be greatly appreciated!
  3. That.... that actually worked (might have had something to do with creation kit crash and relaunch as well). Anyway, awesome. Thank you so much. I'm going to save this separately and go over it again tomorrow. Yeah, for what it's worth, I'm honestly trying to learn papyrus better at this point. I've done more than enough programming to know I can't build Rome in my first week. Thanks again for everything.
  4. Okay, I lied, I can't let it go... also, I kind of need to store floats =\ Please, for the love of Stendarr, someone explain this to me. It's been hours, and obviously my years of programming have not prepared me for scripting in papyrus. Here's what I've found through testing: Scriptname Test2 extends ReferenceAlias int i = 0 ;iterator int gf = 0 int[] CastCount ;array to keep track of different types of spells cast event onInit() CastCount = new int[20] ; init while i < 21 CastCount[i] = 0 ; starting vals i += 1 endwhile Debug.MessageBox("Reset") ; never seen endevent event onSpellCast(Form akSpell) gf += 5 ; value of CastCount[0] increases by 5 TAKING THIS LINE OUT CAUSES THE OUTPUT TO BE STATIC | what does 'gf' have to do with 'CastCount' ?! int oldValue = CastCount[0] int newValue = oldValue + 2 ; output starts at 7, and increases by 5 CastCount[0] = newValue ; newValue is presumably x + 2, where x = number of times script has run Debug.MessageBox("Number of Spells Cast: " + CastCount[0]) ; 7, 12, ... ; CastCount[1] shows the same values as CastCount[0] ; a bunch more code endevent Thanks in advance to anyone who can clear up this mess. EDIT: My guess would be that the array is never getting its own memory allocation, and has a memory allocation that is shared with gf. Hence when updating gf, the array also updates. This also explains why when there is no gf, the array value remains static (presumably, it would work with any variable that was declared immediately adjacent to the array (sharing memory)). I suppose where that leaves me, is in need of a working function to hook when the player starts/loads my mod. I'd think there'd be an onmodinit or some such function, but I have yet to find it. creationkit.com is useful, but not without its bugs, and certainly not with all the answers. Cheers
  5. 1) Well... that's rather concerning. It does seem to work though. 2) No array is needed for this, it is a simplified proof of concept example. Thank you for your help on this. I found a workaround! I don't understand what's happening exactly, but if I use an int type, it works as expected. When changing back to float, the value stays at (or possibly is reset to) 1.000. I'll just list this under limitations of the scripting language and move on with my life. :geek:
  6. Uhhm... okay. Still no dice here. Scriptname Test2 extends RefrenceAlias float[] CastCount int i = 0 event onConfigInit() CastCount = new float[20] while i < 21 CastCount[i] = 0 i += 1 endwhile endevent event onSpellCast(Form akSpell) float oldValue = CastCount[0] float newValue = oldValue + 1 CastCount[0] = newValue Debug.MessageBox("Number of Spells Cast: " + CastCount[0]) endevent That should be the full code for a script to count the number of times the player casts a (any) spell. You can try it out for yourself; for me the messagebox always says 1.
  7. Doesn't work for me... here's my test code: Scriptname Test2 extends ReferenceAlias float[] damage2 event onConfigInit() damage2 = new float[20] endevent event onSpellCast(Form akSpell) Player.DamageActorValue("CarryWeight", 1.0) Damage2[0] = Damage2[0] + 1 ;not sure why Damage2[0] += 1 throws a comiler error =\ Debug.MessageBox("Total Dmg Caused: " + Damage2[0]) endevent In game it displays 1 every time I cast, instead of incrementing. It seems I'm missing something rather basic here. :embarrassed:
  8. I've written a script that has a number of variables (currently in an array) which is about 25 members long. I'd like to just slap the array in to global space so it will be retained across event firings. I really don't want to expand my code and use the UI to make 25 different global variables, but I don't see an alternative at this point. So I'm asking for some confirmation: is there a way to do this, and if not is there a different shortcut? Thanks
  9. I hadn't even looked at OnHit yet.... I assumed that fired when <reference> hit something, not when something hit <reference>. Thanks.
  10. I think I can get done what I want with SKSE, would appreciate confirmation about the possibility (or not) of hooking activemagiceffect somehow though. :)
  11. Thank you for that amazing reply. I think my confusion lies in the fact that I am trying to use activemagiceffect, from my "extends ReferenceAlias" script but, as far as I can tell, "activemagiceffect" is not extended by anything, and extends nothing. If I understand correctly, this means there is no way to cast to it. Basically what I want to do is hook when the player casts or gets hit by a spell, and get the details of that spell. I can make a new script extending activemagiceffect, and attach it to every single magiceffect in the CK, but that seems like a horribly inefficient waste of time. Any advice on the best way to proceed?
  12. Greetings all. I'm hoping one of the more veteran scripters would clear some confusion up for me. I'm rather new to papyrus, but not to programming in general. Thanks in advance. 1) I'm monitoring the player via a blank quest w/ script attached for various events. However, those scripts extend ReferenceAlias (of the player). I don't fully understand what that means, and I would appreciate some clarification. E.x. are onX triggers only when fired by the player, or seen by the player, or in radius Y of the player etc. 2) To build on that a bit, how would I reference a "this" value from another extender. E.x. if a script extends activemagiceffect then "this" becomes the active magic effect. However, I can't seem to access it in the script attached to the player (extends ReferenceAlias). How would I go about doing so? I've tried "Import ActiveMagicEffect" "ActiveMagicEffect.this" etc. with no success. Cheers
×
×
  • Create New...