Jump to content
Heavy Traffic ×

Negate Crime Tracking Armor Script


scarface7454

Recommended Posts

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

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

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 by scarface7454
Link to comment
Share on other sites

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

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

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

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

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...