scarface7454 Posted November 29, 2013 Share Posted November 29, 2013 I have a very limited amount of knowledge about scripting but know the basics. I'm looking to make a script for a armor piece that: OnEquip would check the players standing with all the factions that track crime, and if they go above a certain level they are auto reset to 0 How would I go about doing that? a gamemode script that checks everyframe while wearing the armor? i'm not sure on the exact structure but i feel it is doable... Link to comment Share on other sites More sharing options...
jazzisparis Posted November 29, 2013 Share Posted November 29, 2013 I never attempted anything of this sort before, but this might work: begin OnEquip player ClearFactionPlayerEnemyFlag NCRFactionNV ClearFactionPlayerEnemyFlag VCaesarsLegionFaction ClearFactionPlayerEnemyFlag BrotherhoodSteelFaction ClearFactionPlayerEnemyFlag BoomerFaction ; (and so on) end Link to comment Share on other sites More sharing options...
scarface7454 Posted November 30, 2013 Author Share Posted November 30, 2013 (edited) I did something similar and it only runs that upon putting it on, and that only runs once, i need it to run only while the player is wearing it instead of just the once over on the OnEquip block. I mean that would work for an NPC to clear a players name which would be neat, but it wouldnt accomplish what im currently attempting. I was thinking of using a timer script on the item that runs while its in the players inv?i dont know timer scripts though as they are a bit complex. but i could not imagine a gamemode script running every frame to keep the players rep with every faction to 0. WOuld that not cause game crashes? i'll give it a try and see if it crashes, the script would need to run every frame. Edited November 30, 2013 by scarface7454 Link to comment Share on other sites More sharing options...
jazzisparis Posted November 30, 2013 Share Posted November 30, 2013 I did something similar and it only runs that upon putting it on, and that only runs once, i need it to run only while the player is wearing it instead of just the once over on the OnEquip block.In that case, try this: short bEquipped float fDelay begin OnEquip player set bEquipped to 1 end begin OnUnequip set bEquipped to 0 end begin GameMode if bEquipped if fDelay == 0 set fDelay to 5 ClearFactionPlayerEnemyFlag NCRFactionNV ClearFactionPlayerEnemyFlag VCaesarsLegionFaction ClearFactionPlayerEnemyFlag BrotherhoodSteelFaction ClearFactionPlayerEnemyFlag BoomerFaction ; (and so on) else set fDelay to fDelay - GetSecondsPassed endif endif end It will run once every five seconds, for as long as the armor is equipped. Link to comment Share on other sites More sharing options...
scarface7454 Posted November 30, 2013 Author Share Posted November 30, 2013 You sir are a genius. Thank you for this, im going to go finish it up and tell you how it works. most of cheers to you sir. BTW just noticed your the author of the mods in the sig you have you did great work on them. Link to comment Share on other sites More sharing options...
scarface7454 Posted November 30, 2013 Author Share Posted November 30, 2013 Update: I tried out the script in my mod, as it only uses 1faction for the whole faction (instead of the 10 for freeside) and oddly it did not turn off their enemy behavior towards me. Riddle me this, dont go making a script, but would it be possible for a script to call on the players current standings with the major/minor factions, save them, then every 5 seconds revert the faction rep to 0 or +50? then upon unequip reverting to your old standings? *shrug* Link to comment Share on other sites More sharing options...
jazzisparis Posted November 30, 2013 Share Posted November 30, 2013 It sounds like what you're trying to accomplish is very similar to what faction-associated armors do - when equipped, your current reputation with that faction is stored and then reset to neutral; when unequipped, your reputation is restored to its previous value. You might want to study one of the scripts used by those armors.This page lists all the script functions that manipulate faction-reputation. It can be very helpful to better understand how each of them works. Link to comment Share on other sites More sharing options...
scarface7454 Posted November 30, 2013 Author Share Posted November 30, 2013 Awesome, thanks for the support Jazzi. Much respect and love Link to comment Share on other sites More sharing options...
scarface7454 Posted November 30, 2013 Author Share Posted November 30, 2013 I actually did do some digging and found that the ranger armor, like the other factions, dont run on 1 script but all their own, unique references and what not. I don't see this happening this year but mark my words ill do it! :) If anyone has any other advice to throw in dont hold back Link to comment Share on other sites More sharing options...
Recommended Posts