Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

Eaglemania

Allies
  • Posts

    7
  • Joined

  • Last visited

Eaglemania's Achievements

Layman

Layman (1/11)

0

Reputation

  1. Man i just made a video tutorial on global variables but i can't get it to encode right -_- not that it was a good tutorial but it was alot easier to explain with it... anyway. Do all of this Inside the Creation Kit. Create your GlobalVariable - let's call it MyGlobal. Then go to the script in which you want to use MyGlobal. Add a property of type GlobalVariable, let's call that MyProperty and then click on Edit Value and browse to (or type) MyGlobal. Now the created property will point to the global variable MyGlobal and can be used inside the script. You have to add a property like this to every script in which you want to use MyGlobal. so for example: Scriptname GlobalSet extends ObjectReference GlobalVariable Property MyProperty Auto Event OnActivate(ObjectReference akRef) MyProperty.SetValue(5) Debug.MessageBox("Set Value is " + MyProperty.GetValue()) EndEvent MyProperty.SetValue(5) will not actually change the value of MyProperty, but the global it is pointing to, so in this case MyGlobal will be 5 Scriptname GlobalGet extends ObjectReference GlobalVariable Property MyProperty Auto Event OnActivate(ObjectReference akRef) Debug.MessageBox("Get Value is " + MyProperty.GetValue()) EndEvent MyProperty.GetValue() is the same, it will not read out it's value, but the value from MyGlobal which the property is pointing to. So here, if the GlobalSet script did run first, the messagebox would read "Get Value is 5" I have no idea why it is how it is, but after a dreadful week of trial and error, this is how i found it works... Hope this is understandable and helping :/
  2. Can't be of much help, but i did a very small test. int i = -20 If (i < 0) Debug.Notification("k") EndIf This works, so negative numbers do pass.
  3. Such a shame, I guess it's just not working with an equipped weapon. The .self worked and also i can pick up, then drop the sword in any cell and make it glow, useing another sword. So i guess the reference does stick with it. I guess if it would have been possible, the Silent Moon weapons maybe would have used it, as they only do additional damage at night. Anyways, thanks for all the help! I really appreciate it. Learned alot about papyrus and i understand a bit more about oop.
  4. Thank you very much for taking time to explain! But again, i still don't get it to work, i really try not to be dumb but please take a look: ScriptName MyEffectScript extends ActiveMagicEffect EffectShader Property theShader Auto VisualEffect Property theVisual Auto Event OnEffectStart(Actor akTarget, Actor akCaster) Form theWeapon = akCaster.GetEquippedWeapon() as Form theShader.Play(theWeapon) theVisual.Play(theWeapon) endEvent this when compiled spits out error messages: ...\MyEffectScript.psc(8,11): type mismatch on parameter 1 (did you forget a cast?) ...\MyEffectScript.psc(9,11): type mismatch on parameter 1 (did you forget a cast?) EDIT:I tried to cast theWeapon as ObjectReference, but Debug.MessageBox(theWeapon) just said "none".
  5. Thank you Leecarter! However I coudn't find an answer to my problem, your code does quite alot of things. I did a search and read around a bit and, what i think i understand: You compare .GetEquippedWeapon with weapon types to determine if the player is unarmed or not, and you .Play Visual Effects on the Game.getPlayer()? I want to play an Effect Shader on an already equipped sword, ie: theEffectShader.Play(theEquippedSword, 5.0). The problem being, getting the ObjectReference for theEquippedSword. Can you explain the solution a little? Or point me to some lines/functions inside your script that does something like this, please? Again, your code does quite alot of things and i'm new to papyrus and to the whole oop thing. Sorry if i didn't see the answer.
  6. Thank you for the insight and quick reply! That's what i feared, that a equipped weapon can't be referenced to. I do want to make this sword unique, but i thought it would be great if it also worked when smithed / cheated in aswell, but guess that's out of the question then... EDIT: I don't get it to work, maybe i did something wrong. I stored the reference, pointing to the sword still lying around in the cell in a property, attached to the magic effect. Now when i equip the sword and get the counter to where it should play the effect shader, nothing happens. I then tried to place another sword in the cell and pick that up, instead of the referenced sword, this time when i got the counter high enough the referenced sword began to glow (as it should). So it's working, but not while it is equipped. So i guess just storing the reference does not make it persistant or i did something wrong? Also i don't really know how to do it with "any active script with the object reference stored". What would be an "avtive script"? Maybe a never ending loop?
  7. Hi there, just registered because the last week all i been doing with papyrus was hitting walls, hard ones, repeately banging my head at them just won't work. Before i go on an even bigger rant, i just go to the question i'm asking myself right now. Is there some way to get the currently equipped weapon by an actor as an object reference? The goal of this is: I made a sword, which has an enchantment, which has a magic effect, which has a script attached to it. This script counts how often the magic effect is applied to enemies, and do something ones the count reached a certain number. So far the script works great, however what i want it to do is .play (and .stop) an effect shader on the sword. Function Play(ObjectReference akObject, float afDuration) Plays this magic effect shader on the specified object for the specified duration in seconds. there is the problem, i have no idea how to get to the ObjectReference. I tried .GetEquippedWeapon and cast that as ObjectReference, which i'm sure is utterly stupid, but noobs try stupid things. I think i can get the object reference with the OnObjectEquipped event, but i can't check this before the magic effect is applied, and when it is applied, the weapon is already equipped so the event will never run. I also looked at the weapon rack script, this script used .DropObject, wich returns an ObjectReference of the dropped object, but again it's pretty useless. I don't want to drop the sword. Slowly but surely the thought is creeping up on me, that the equipped weapon can't even be referenced to, that it has to be just lying around in a cell. But why woudn't there be something to do this. Really hope this is not a total stupid question/issue and that someone can point me in the right direction.
×
×
  • Create New...