irswat Posted April 16, 2014 Share Posted April 16, 2014 (edited) JIP confirmed what you said about local variables. So I was looking into how to customize a HUD that would make you feel as if your were in a mech. Apparently it is all .dds textures, xml, and script. I can't hardly find any tutorials on editting the mod. Can you point me in the right direction of somebody who could point me in the right direction of a good place to start? Edited April 17, 2014 by irswat Link to comment Share on other sites More sharing options...
irswat Posted April 16, 2014 Share Posted April 16, 2014 http://geck.bethsoft.com/index.php/Useful_Scripts#Simulating_Global_Functions_in_your_Modhttp://forums.nexusmods.com/index.php?/topic/763771-variables-question/ So I'll start with my ideas on one of the basics, Variables. If you want to share Variables across more than one script then one simple way is to create a Quest called MyModQuestVAR. You don't need to do anything other than tick the StartGame enabled box and hit ok, it doesn't need any dialogue or anything else. Then create a script and call it something like MyModQuestVARScript, use the pull down box at the top to turn it into a Quest Script. In this create any Varibles you want to share across scripts or allow other people to read for other Mods. If the you create variables inside an item or effect it is a seperate brandnew script for each item so when it first starts everything will be zero unless you pull in info from a VAR script. You do this by using the name of the VAR script with the variable... Link to comment Share on other sites More sharing options...
irswat Posted April 17, 2014 Share Posted April 17, 2014 (edited) So I have been playing around with ref-walking, and how we can go about implementing a gradient of weapon effectiveness against the mech. The challenge seemed to be, how can I get a list of all of the NPC'S that are currently attacking the player. It is a nice little challenge, and a great opportunity to learn what GECK is capable of. I was scouring through the FOSE documentation and found some functions that may be useful. I do not know the proper syntax, or what arguments the functions take.Here is my optimized pseudocode: ScriptName MechDamageGradient int counter int numNPC int MechCheckFlag ref rCurrentNPC ref rCurrentNPCWpn ref rNPCTarget float NPCProximity short NormalAttackDmg short NormalDmgMultiplier Begin GameMode set numNPC to GetNumRefs 200 Depth 1 set counter to 0 if (numNPC == 0)||(player.IsInCombat == 0) return elseif (numNPC > 0)||(player.IsInCombat) set rCurrentNPC to GetFirstRef 200 Depth 1 if Player.GetEquipped ArmorUniqueEnclaveMech set MechCheckFlag to 1 else return endif endif while (counter <= numNPC) && (rCurrentNPC != 0) set counter+=1 if (rCurrentNPC.IsInCombat) set rNPCTarget to rCurrentNPC.GetCombatTarget if (rNPCTarget == player) set rCurrentNPCWpn to rCurrentNPC.GetEquippedObject 5 if (GetWeaponType rCurrentNPCWpn == 0) || (GetWeaponType rCurrentNPCWpn == 1) ||(GetWeaponType rCurrentNPCWpn == 2) || (GetWeaponType rCurrentNPCWpn == 3) set NormalAttackDmg to GetAttackDamage CurrentNPCWpnType set NormalAttackDmg to (NormalAttackDmg-(NormalAttackDamage*.65)) ;I would like to buff up these formulas to incorporate actor values SetAttackDamage NormalAttackDmg CurrentNPCWpnTypeRef elseif (GetWeaponType rCurrentNPCWpn == 7) || (GetWeaponType rCurrentNPCWpn == 9) ||(GetWeaponType rCurrentNPCWpn == 10) || (GetWeaponType rCurrentNPCWpn == 11) set NormalAttackDmg to GetAttackDamage CurrentNPCWpnType set NormalAttackDmg to (NormalAttackDmg*1.9) SetAttackDamage NormalAttackDmg CurrentNPCWpnTypeRef endif endif endif SetAttackDamage NormalAttackDmg rCurrentNPCWpn set rCurrentNPC to Apple set rCurrentNPC to GetNextRef loop return End I would like to add a projectile effectiveness gradient, as well as bonus multipliers depending on what type of weapon you are using, and where you hit the mech. Imagine hitting the mech low with a guass rifle and the thing falls head of heals.DevP if you have used any of these functions can you lend any insight? Specifically regarding ref-walking and the damage modification globals.Here is an example of what appears to be a highly efficient ref-walker script: ref rCurrentRef Begin GameMode set rCurrentRef to GetFirstRef 200 1 0 ; Actors Label 10 if rCurrentRef ; Do stuff with rCurrentRef set rCurrentRef to Pencil01 ; Prevent apple bug set rCurrentRef to GetNextRef Goto 10 endif End Here is another ref-walking script. Note that I used while/loop instead of label/goto. I hope the achieved ends are the same. Some interesting functions I came across that may prove useful for this weapon effectiveness gradient for the mechs:GetRefCountGetNumRefsGetFirstRefSetAttackDamageSetWeaponCritDamageSetWeaponLimbDamageMultI was thinking we could definitely use a person who knows how to work in xml, dds, and HUD modifications to make this thing believable. DevP, do you think it will be possible to make the hud literally look like you are in the cockpit of a mech? 42 - NPC 43 - Creature 44 - LeveledCreature 45 - LeveledCharacter 200 - Actor Edited April 17, 2014 by irswat Link to comment Share on other sites More sharing options...
irswat Posted April 17, 2014 Share Posted April 17, 2014 DevP, I was misunderstanding. I was under the impression that the re-equip previous armor was not working. If you call equip item does it automatically unequip the items the actor has equipped? ; Is this redundant? player.unequipItem ArmorUniqueEnclaveMech 0 1 player.unequipItem armorUniqueEnclaveHelmet 0 1 player.removeItem armorUniqueEnclaveHelmet 1 1 .... ; Could you just use this? player.drop ArmorUniqueEnclaveMech 1 player.equipitem rPLayerArmor 0 1 player.equipitem rPLayerHelmet 0 1 player.equipitem rPLayerHat 0 1 Link to comment Share on other sites More sharing options...
irswat Posted April 17, 2014 Share Posted April 17, 2014 (edited) I was thinking we could definitely use a person who knows how to work in xml, dds, and HUD modifications to make this thing believable.I downloaded GECK, the DDS and Normal Map plug-ins. I'm going to see if I can get permission to use the Radar Mod in the HUD module. Today I would like to finish my proof of concept: turning the HUD into a mech warrior cockpit.If anyone can point me in the right direction so that I can make this compatible with Unified Jud that'd be awesome. Also any step by step directions regarding making custom UI either the artwork or code, would be greatly appreciated. Edited April 17, 2014 by irswat Link to comment Share on other sites More sharing options...
devinpatterson Posted April 17, 2014 Author Share Posted April 17, 2014 This is just what I communicated a few posts back in regard to GetScriptVariable. But it can work equally well with an object script, it just makes sense to use a quest script because it can fire off much less often (any number of seconds or fractions as opposed to every frame which is more resource heavy) and it's loaded at the start of the game as opposed to object scripts that are loaded when their attached model is. But it doesn't have any intrinsic quality that makes it more akin to a glob just because it's a quest script. Part of the reason I was curious about the way you portrayed it is due to the naming scheme. You can't have two globs with the same ID so when you said you can use quest script variables as global variables, I was intrigued.....since many scripts share the same local var name. DevP, I was misunderstanding. I was under the impression that the re-equip previous armor was not working. If you call equip item does it automatically unequip the items the actor has equipped? ; Is this redundant? player.unequipItem ArmorUniqueEnclaveMech 0 1 player.unequipItem armorUniqueEnclaveHelmet 0 1 player.removeItem armorUniqueEnclaveHelmet 1 1 .... ; Could you just use this? player.drop ArmorUniqueEnclaveMech 1 If they are in the same body slot, yes it should bump them (unequip them). And just about all armor occupies the same upper body slot Re: drop, it has a couple of problems;Does NOT appear to trigger OnDrop blocks when called on the player.Item stats (i.e., Health, Charges, Script Variables) are reset as if it's a new item. Let me get back to you on ref walking, I'v only skimmed it...and that was a while ago. I do have concerns though since this will be an outside cell with potentially a lot of refs. I was thinking we could definitely use a person who knows how to work in xml, dds, and HUD modifications to make this thing believable. I downloaded GECK, the DDS and Normal Map plug-ins. I'm going to see if I can get permission to use the Radar Mod in the HUD module. Today I would like to finish my proof of concept: turning the HUD into a mech warrior cockpit. If anyone can point me in the right direction so that I can make this compatible with Unified Jud that'd be awesome. Also any step by step directions regarding making custom UI either the artwork or code, would be greatly appreciated.We're OK with permission, invalidfate gives it in his profile page for all his mods. Yeah xml skills would be really handy. I think I could work up a decent little overlay by mixing some game assets and free hand (got my pen for my win8 tablet....gonna do some drawing). OK gotta jet to work. Edit: Hmmmm code tag must have been open ended, put all my txt in it :sad: Link to comment Share on other sites More sharing options...
irswat Posted April 17, 2014 Share Posted April 17, 2014 (edited) the script should only check references of actors within the cell, and the 8 immediately surrounding cells. Those that are not hostile are loaded out of memory. I tried being as efficient as possible. Have not tested the dmg, vats, or mouse wheel disabling. just did the script. Will test today hopefully.is the hud simply a matter of getting a nice JPG of the overlays (including cockpit graphics), converting them to dds, making a normal map, and loading them into the game using xml? Is there any documentation for keeping mods friendly with unified HUD?regarding ref walking and efficiency Edited April 17, 2014 by irswat Link to comment Share on other sites More sharing options...
devinpatterson Posted April 17, 2014 Author Share Posted April 17, 2014 the script should only check references of actors within the cell, and the 8 immediately surrounding cells. Those that are not hostile are loaded out of memory. I tried being as efficient as possible. Yeah that's what I was kind of worried about, since wilderness cells can contain a lot of actors, but it's good to hear that non hostiles are filtered out. is the hud simply a matter of getting a nice JPG of the overlays (including cockpit graphics), converting them to dds, making a normal map, and loading them into the game using xml? Is there any documentation for keeping mods friendly with unified HUD? I'm afraid I'm clueless when it comes to the HUD. I did do a tiny bit of research in regard to changing the UI color as their was a request for a shimmering effect. I didn't get around to doing it yet though. OK gotta jet, I'll try to study up a bit on xml when I get some free time. Link to comment Share on other sites More sharing options...
irswat Posted April 17, 2014 Share Posted April 17, 2014 (edited) something like this: http://www.mechlivinglegends.net/wp-content/uploads/2012/03/mwll-mechhud-concept01.jpgDo they have what you see is what you get editors for xml? I'd just open these menus up and go at it. Edited April 17, 2014 by irswat Link to comment Share on other sites More sharing options...
devinpatterson Posted April 17, 2014 Author Share Posted April 17, 2014 something like this: http://www.mechlivinglegends.net/wp-content/uploads/2012/03/mwll-mechhud-concept01.jpgLooks good Do they have what you see is what you get editors for xml? I'd just open these menus up and go at it. I don't know, but since xml is such a widespread standard, I bet there are a ton of tools/apps that could do the trick or at least make it a easier process. Link to comment Share on other sites More sharing options...
Recommended Posts