Jump to content

glowplug

Premium Member
  • Posts

    376
  • Joined

  • Last visited

Everything posted by glowplug

  1. PS I accidentally clicked Cancel on another 'No Quotes' warning then got no warning later, it should be... PlayerRef.SetEventHandler "OnSpellCast", FnOnSpellCastActor ...it worked without the quotes but better to get it right. I've tested it by repeating variations of the following with a custom spell called LightNight that has Light+Night-Eye... Night-Eye then Light - Night-Eye Dispelled, Light is castLight then Night-Eye - Light Dispelled, Night-Eye is castLightNight then Light - LightNight Dispelled, Light is castLightNight then Night-Eye - LightNight Dispelled, Night-Eye is castLight then LightNight - Light Dispelled, LightNight is castNight-Eye then LightNight - Night-Eye Dispelled, LightNight is cast...suffice to say that 'elseif' would be wrong and Cast is running after the EventHandler has compeleted.
  2. You're certainly on the right track RomanR, I was forgetting about Dispel by MagicEffect. To be honest, I did not think things through. Unfortunately OnMagicEffectHit doesn't stack, each SetEventHandler "OnMagicEffectHit" removes the previous. The other problem is that the event double fires and fails to interpret refActor.Dispel refSpell. The reason there is no 'elseif' is to ensure all conflicts Dispel. Note: the actual spell is not cast till after the EventHandler - it won't self dispel if it has conflicting effects. Note: MagicItemHasEffectCode passed by long - MagicItemHasEffect passed by string_var won't compile in 'if' statement. scn QstMagicEffectHandlersScript ;Quest script Begin GameMode if GetGameLoaded PlayerRef.SetEventHandler OnSpellCast, FnOnSpellCastActor endif End scn FnOnSpellCastActor ; elseif not used to ensure all desired Dispel occur. ; the actual spell is cast after this EventHandler (it won't self dispel) ref refActor ref refSpell Begin Function { refActor, refSpell } if MagicItemHasEffect LGHT, refSpell call FnActorDispelByMagicEffectCode refActor, (MECodeFromChars "NEYE") endif if MagicItemHasEffect NEYE, refSpell call FnActorDispelByMagicEffectCode refActor, (MECodeFromChars "LGHT") endif if MagicItemHasEffect WABR, refSpell call FnActorDispelByMagicEffectCode refActor, (MECodeFromChars "WAWA") endif if MagicItemHasEffect WAWA, refSpell call FnActorDispelByMagicEffectCode refActor, (MECodeFromChars "WABR") endif End scn FnActorDispelByMagicEffectCode ;Generic function to loop through whichever Actor's spells ;NOTE: MagicItemHasEffectCode using long - MagicItemHasEffect using string_var won't compile int iIndex ref refSpell array_var arrSpells ref refActor long lEffect Begin Function { refActor, lEffect } let arrSpells := refActor.GetSpells while iIndex < ar_Size arrSpells let refSpell := arrSpells[iIndex] if MagicItemHasEffectCode lEffect, refSpell refActor.Dispel refSpell endif let iIndex += 1 loop End
  3. The problem with SetScale is the Range limitiation of 0.5 to 2. The problem with SetScaleEx is the Disable/Enable - OBSE documentation does not mention that these need to be on separate frames. Even then SetScaleEx seems to have an origin problem that can persist over seconds. At this stage I've enforced the 0.5 to 2.0 Range limit.
  4. Directly editing vanilla spells can be nullified by any mod later in load order. A solution is to use the OnSpellCast EventHandler bound to Player. OnSpellCast hands the aruments of Caster and Spell - we know the Caster but Spell provides a solution. The requirement is Dispel by Effect however it is a Many to Many relationship - each effect belongs to many spells and a spell can have many effects. The solution is to use mapping functions for each Effect that should Dispel any other Spell by any other Effect. It may be easier to do in Skyrim Creation Kit but I have to ask, would it be anywhere near the challenge or fun of making Oblivion bow to your will? Pseudo code... scn QstHandleEventsScript Begin GameMode if GetGameLoaded ;__This binds the event handler to player on new, quick or load game. PlayerRef.SetEventHandler "OnSpellCast", FnOnSpellCastPlayer endif End scn FnOnSpellCastPlayer ref refCaster ref refSpell Begin Function { refCaster, refSpell } ;__once bound, this always runs when the player casts a spell if MagicItemHasEffect ABAT, refSpell call FnDispelConflicts "ABAT" elseif MagicItemHasEffect ... call FnDispelConflicts ... endif End scn FnDispelConflicts string_var strEffect Begin Function { strEffect } ;__this does the Dispel(s) - each could be factored out to other functions for readability and tidiness if strEffect == "ABAT" PlayerRef.Dispel BSWarriorFarting PlayerRef.Dispel ... endif End
  5. Done and still no need for programming knowledge. It's now time to get the resource completed with tutorials.
  6. Nice work there GamerRick. Scaling, I meant to come back to that sooner. As XMarker does not support scaling I've done a custom one. Again, the target is that the resource will require no knowledge of programming.
  7. I hope it is more than that. Each step of the way I've aimed to make it easy, not just easier. The outcome is 2 Activator scripts that never need to be changed where their Starter scripts only have a few lines of code. In addition there are a number of functions of further use. For example, instead of using 6 variables and 6 functions to record location and rotation there is 1 function that returns that as 1 variable, a location vector (position and direction). The difficult part is teaching - the hurdle of grasping a few concepts. The first tutorial of importing the code library is fairly short where we use CSE to combine the LerpCode.esp with the exercise esp - this shows us how to combine it with our own esp. The next is making an animation like the lever one in the video - if you know what you're doing less than 2 minutes. I come back to my concern that it is scripted code where people will run into problems and change source for the wrong reasons. I want to write it as an OBSE plugin but I'm finding that too hard, I know C++ but I'm finding myself lost on where to start. If, however, somebody can help me bridge the gap then I'm confident the resource could present Spherical Linear Interpolation (SLERP). This is where the algorithm uses the rotation of each point to plot an arc of points between them. The figure 8 in the video, for example, uses 13 XMarkers which isn't enough to provide the illusion of curvature. Using SLERP it would probably look better on 9, let alone 13 nodes.
  8. There are 2 main scripts, 'looping' and 'travel once', these do not change - each go on the animation object as required. Each of these need to be Started externally, hence the use of Starter objects and scripts The script on the figure 8 animation is the same as the other 2 looping animations. It's Starter is... scn TrigLoopPointsEg01StarterScript Begin OnTrigger if ActiLoopPointsEg01Ref.iInitialized == 0 PlaySound leAMBChimesHit01 let ActiLoopPointsEg01Ref.fDuration := 0.5 let ActiLoopPointsEg01Ref.fFPS := 24 let ActiLoopPointsEg01Ref.iInitialized := 1 endif End ...which is the only programming you need to do - replace names then set fDuration and fFPS. The rest is parenting XMarkers for the animation path. I'm a fair way into creating a course to cover what is in the video. The course also has a section on CS and OBSE variables - to allow for anyone who wants to use the core functions.
  9. Confirmed... The diffuse map(main texture) is the file path to the NiSourceTexture with the format of... textures\YourFolders\FileName.dds The normal map (not declared in the Nif) is implicit as... textures\YourFolders\FileName_n.dds ...Oblivion will find this. The glow map (lighting, not declared in the Nif) is implicit as... textures\YourFolders\FileName_g.dds ...Oblivion will find this. In short, we set each NiSourceTexture to the Diffuse and Oblivion finds the Normal by _n and the Glow by _g Points to note... NiMaterialProperty (material) is child of NiTriStrips or NiTriShape (mesh)NiTextureProperty is also a child of NiTriStrips or NiTriShape.NiMaterialProperty is not unique by name....I don't know why but certain names, such as EnvMap2, seem to be hard coded to evaluate certain things such as reflection and lighting. Using EnvMap2 for lighting requires setting 'NiTexturingProperty > Apply Mode' to 'Apply Highlight'. This applies reflection mapping which seems to be based on environment.
  10. An extensive reply Pellape that I did read at length and can relate to a lot of what you are saying. Two things that I had to learn about myself a long time ago are not to be pedantic or an impatient hot head. Two things that I constantly have to pull myself up on before making an ass of myself and being unfair to others.
  11. Thanks for the reply but have you used any of my mods such as Indornia (player flyable spaceship) or Harodich (self driving submarine) or looked at their code? Indornia has an Inventory stone where it's code let's you skip through all quests and go straight to the ship. My problem is not writing code but teaching it which is what I was trying to say in my post. Another member here had a hard go at me for not sharing my knowledge but refuses to answer my replies - I find that lame but motivating to make sure nobody else has that problem. At this stage I've created exercises on Oblivion Script and OBSE variables ready for the LERP tutorials. The variable exercises are optional but useful for understanding the application of array_var arrays in the animations. Getting on with the LERP tutorials I want to impart the difference from trigonometry.
  12. I put 'Stream Achievements' in one of my mods :happy: For example: Cutting Edge - run past 2 Ayleid swinging blades and survive. Bleeding Edge - sit on a chair between those blades and survive - stand or sit at the wrong time and get your bum cut off, no bum and you can't pooh, can't pooh and you die - no pooh!
  13. Having considered things, I won't factor code out to an OBSE plugin. The resource will require you to copy the core scripts over to your own mod. Anybody can alter them to suit their own mod this way. Using the LERP functions I've written to animate an object from Start to End is fairly simple. I will provide a hands on tutorial, followed by a multiple choice exam. followed by DIY scripts. There will be several more tutorials for looping the animation and multiple destinations. The zombie head example in my previous post has problems... Assuming the head looks along it's Local Y axis, same as Player, it should be 180 degrees opposite Player, right? Wrong, the Player could walk into the trigger at almost -+ 90 degrees relative to the head. The tutorials will step through to this using hands on exercises with 'known steps for known outcomes', followed by multiple choice exams, followed by DIY scripts to test you knowledge. Considering that anyone could still have trouble with this I am planning a further solution. A desktop app to write the scripts for you.
  14. The main advantage of this over Nif animations is that the Start and End can be anywhere, for example... The Player enters a round room through any one of 12 doors.A zombie head flies off a table across the room while screaming.The head stares at the Player for a few seconds then drops to the ground.The problem with this example is that working out the End involves using trigonometry based on Player Position and Rotation. This is the sort of thing eating up my time on this. My aim is to provide this as a resource that requires minimal programming knowledge where you copy over the core scripts then Copy/Paste/Massage the scripts that you require. To provide step by step hands on tutorials. To be honest, an amount of it should be written as an OBSE plugin but I'm a bit lost and don't know who to ask for help.
  15. All CS/Oblivion (except for the other video which is part of my Unity game). I've since refactored the code to only require the position and rotation functions. These perform the same as Vector3.Lerp in Unity. I'm not planning to do Quaternion.Lerp at this stage as I don't see a need for it. As I posted, the next step is to have CS scripts loop through an array of positions. If I get this right, there will be 2 scripts that you Copy/Paste/Massage. The first script you copy/paste, rename and add the name of your xmarkers. The second you rename the script the rename the call to the first script. At this stage it is a thought experiment, same as the first. Having typed some pseudo code in Notepad++ I wrote the functions. The 2 errors were where I did not set 2 arrays but then it ran.
  16. The reason I'm posting here rather than there is that things have changed, I will release a Resource but it will be a work in progress where I need and would appreciate feedback along the way. What does it do? Say you want to have a chair move across a room as if controlled by a ghost. When the player opens the door, the chair moves in their sight - so they don't miss seeing it. What is going to move the chair?.. The function to do this is often referred to as a LERP, short for Linear IntERPolation. Having done the core functions I have a template where you... * Copy/Paste to new script and rename * Rename all MyObjectRef with the name of the object * Rename all MyXMarker with the name of the Destination XMarker ...save and test. I need to provide tuition that expands on how this works. The next template is for Looping Multiple Destination such as a model train track which is where things get a bit more complex. The distance between each Destination varies but we want the train to travel at a constant Rate - this needs to be explained through comprehensive tutorials. Where OBSE Linear Algebra could be used I found it defeatest - correct me if I'm wrong. Where a dll could wrap OBSE array with Vector based functions I think that would be more complex - correct me if I'm wrong. In short, any help in getting this off the ground would be greatly appreciated, especially in making it usable.
  17. Note that I've corrected my first post to say how fast instead of how far.
  18. This uses Linear Interpolation. Fire == Drop/Grab where Grab is up to 30 virtual meters. Fire+Sprint == Throw at up to 15 virtual meters Fire+Alt-Fire == Hurl at up to 30 virtual meters. Fire is also Use - whatever you're looking at, saving whatever other inputs certain games waste our fingers on. Unity Cross-Platform (UCPI) Input hard codes Left and Right Mouse - the only reason I can play this is because I deleted UCPI on my game. I have acute ulna compression and nerve damage in my left shoulder. After deleting UCPI, it took me a few days to write an interface to bind anything to anything on any platform using keyboard, mouse and/or controller (all at the same time) - it is working here, wtf is wrong with these high paid AAA game programmers that don't do this?! Note that the color coded buttons seem to be magnetic in response to matching colored cubes - the reason for the shape of the halls. When we grab a cube off a button it's collision physics stop. The idea is to bounce the cube you're holding off the cornice then grab the cube on the button fast enough so it all works - I stuffed this up a lot nearly failing time on this level. Similar can be done on Oblivion but it needs to be an out of process plugin. I'm not seeing a way to extend OBSE or write it independently.
  19. Unreal has Interp and Unity has Lerp, here is Linear Interpolation on Oblivion. The core functions uses the start and destination coordinates of the object - these do not change. EDIT: the following line should be "Your code has to tell them how Fast the object should go from start (0) to destination (1). Your code has to tell them how far the object is from start (0) to destination (1). 'FnNormalizedIncrement Seconds' returns the increment to achieve this. The increment is capped at 30fps to ensure almost any computer can smoothly render it - if not, just run a little slower. NOTE: The timing on GetSecondsPassed is at 30fps to sync with fIncrement. GameMode could be re-factored but without code reduction - I think this is okay. The problem I have is explaining this simply and making it easy to use. This is simply an A-B demonstration where multiple destinations and/or looping is a little harder. My question is whether anyone is going to bother to use it? Is it worth me taking time to develop the tutorials? scn kvLerpObjectScript int iActivated array_var arrPositionStart array_var arrPositionEnd array_var arrRotationStart array_var arrRotationEnd array_var arrCurrentPosition array_var arrCurrentRotation float fIncrement float fInterval float fTimer Begin OnActivate if iActivated == 0 let iActivated := 1 let arrPositionStart := call FnGetVector3Position kvLerpObjectRef let arrPositionEnd := call FnGetVector3Position kvMkrLerpObject let arrRotationStart := call FnGetVector3Rotation kvLerpObjectRef let arrRotationEnd := call FnGetVector3Rotation kvMkrLerpObject let fInterval := 0 let fIncrement := call FnNormalizedIncrement 20 endif End Begin GameMode if iActivated == 1 let fTimer += GetSecondsPassed if fTimer >= (1 / 30) let fTimer := 0 let arrCurrentPosition := call FnLerpPosition arrPositionStart, arrPositionEnd, fInterval call FnSetPosition kvLerpObjectRef, arrCurrentPosition[0], arrCurrentPosition[1], arrCurrentPosition[2] let arrCurrentRotation := call FnLerpRotation arrRotationStart, arrRotationEnd, fInterval call FnSetRotation kvLerpObjectRef, arrCurrentRotation[0], arrCurrentRotation[1], arrCurrentRotation[2] let fInterval += fIncrement if fInterval >= 1 let iActivated := -1 endif endif endif End
  20. As I said, 'Why buy a container that you would have to pick up and drop each use?'. My first problem was finding the Imperial Furniture store - the Description says 'just outside the Imperial City' whereas it is down near the jail sewer exit - why does it not just state that? If we pick up more than we can carry... Pandora's Box: Open Inventory Select Tab/Item for.. Transfer whatever Close InventoryImperial Furniture: Drop excess Find Store (took me 20 minutes) Buy Chest Open Inventory Select Tab for.. Drop Chest Find the chest fell through groundmesh (I've had this happen) Reload Game Save repeat from 1 through to... Use Chest Select Open Transfer whatever Close Chest Use Chest Select Pick Up Return to pick up excess dropped earlier.Why do 3 or 4 steps if you can do 1? Don't get me wrong GamerRick, many thanks for promoting Imperial Furniture which is an outstanding mod. There are a lot of fantastic mods for Oblivion that allow players to select what they want. If I remember, Pandora's Box is precise on Mercantile, correct me if I'm wrong. Based on posts, I believe the item should not only be quested for but have a usage penalty - what do you think?
  21. As I said, 'Why buy a container that you would have to pick up and drop each use?'. My first problem was finding the Imperial Furniture store - the Description says 'just outside the Imperial City' whereas it is down near the jail sewer exit - why does it not just state that? If we pick up more than we can carry... Pandora's Box: Open Inventory Select Tab/Item for.. Transfer whatever Close InventoryImperial Furniture: Drop excess Find Store (took me 20 minutes) Buy Chest Open Inventory Select Tab for.. Drop Chest Find the chest fell through groundmesh (I've had this happen) Reload Game Save repeat from 1 through to... Use Chest Select Open Transfer whatever Close Chest Use Chest Select Pick Up Return to pick up excess dropped earlier.Why do 3 or 4 steps if you can do 1? Don't get me wrong GamerRick, many thanks for promoting Imperial Furniture which is an outstanding mod.
  22. 'Simple' - I think so. 'Safe Container' - absolutely. Why buy a container that you would have to pick up and drop each use? You might like Pandora's Box. Infinite storage with vending that increments Mercantile.
  23. In one way, replying after skimming, especially when over tired, I was mistaken. On the other, your response to that clarifies a lot of what I was missing.
  24. Thank you for answering my question in detail Pellape, As far as your questions, I should have presented them to start with. The mod is survival based with a significant amount of time underwater, possibly to great depths but I have to work that out. What I need to resolve is static versus procedural placed enemy. Static placement will result in under or overwhelming player opposition. Procedural will allow analysis and calculation of player danger levels. To be honest, I should be asking for people to help me on this mod but they, of course, are too busy with their mod. Maybe I should offer to help on other people's mod's while my Ukraine friends are unable to do anything.
  25. Thank you for taking so much time to help with this Pellape. Having followed your instructions I still found the same issue - while the collision mesh follows the material mesh, it fails to respond to other collision mesh such as Terrain. In addition, I still found no setting in NifSkope to rectify that. In the end, I think it's more important for the mod to enable what it's supposed to do. The player will have to pilot the sub from point to point in allocated time - they will wear a Dwemer diving suit due to the version of Gamebryo not having code-able water bubble. Argonians will have to wear the same suit to interface with the sub - a matter of having 1 set of programming code. This will require MenuQue to show the submarine health. When the player goes below ground mesh the sub will make metal fatigue noise and lose health. I need to work out a repair tool, probably as a weapon. When the sub goes above water height for more than a second, player input will be paused while the sub and contents LERPed back underwater. More in another post , as and when.
×
×
  • Create New...