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...

[OB] Removing Player Infamy and Crime gold through scripting


KWITS
 Share

Recommended Posts

Good Day,

Every method I have employed in TESIV Construction Set allow a NPC to remove the Player's infamy and crime gold has produced no positive results without freezing game play. Interestingly, I have been able to accomplish this task through an activator object but not as a trigger to start a new stage during a topic discussion between a NPC and the Player. I have found one script that supposedly can accomplish this task and below is the extract:

Begin GameMode

Float PCCrimeGold

Float PlayerInfamy

Float PlayerFame

Float TempCrimeGold

Float TempPCInfamy

Float TempFame

If ( GetStage WaVLTFoundQuest == 50 )

If GetPlayerInSEWorld == 0

Set PCCrimeGold to Player.GetCrimeGold

Set TempCrimeGold to Player.GetCrimeGold

Player.SetCrimeGold PCCrimeGold

endIf

Set TempFame to GetPCFame

SetPCFame PlayerFame

Set TempPCInfamy to GetPCInfamy

SetPCInfamy PlayerInfamy

playSound3D SPLAlterationCast

Endif

End

Link to comment
Share on other sites

Gotcha.

Here's the thing: You can't just call another script from a script. There's no function that means "run this script now, please" (without OBSE, that is). So, you have a few options:

1) Just put it in your quest script, but if you are having trouble with freezing, use a variable as a flag so this bit doesn't run right on top of whatever else you have going on. Like so:


short FlagVariable

Begin GameMode

If GetStage WaVLTFoundQuest == 50 && FlagVariable == 0
;do whatever else you need to do at Stage 50
Set FlagVariable to 1
EndIf

If GetStage WaVLTFoundQuest == 50 && FlagVariable == 1
Player.SetCrimeGold 0
ModPCInfamy -99999
EndIf

End
[/codebox]

2) Make a new dummy quest with the "Start Game Enabled" tickbox checked, and attach your stuff to that quest as a quest script:

[codebox]
Begin GameMode

If GetStage WaVLTFoundQuest == 50
Player.SetCrimeGold 0
ModPCInfamy -99999
StopQuest [YourDummyQuestIDGoesHere]
EndIf

End

This will be less efficient, but is probably the simplest method of running the script outside of your main script.

3) Attach your script to a persistent reference with a flag variable, and use your main script to set the variable. For example, in your main script, you would:


short DoOnce

Begin GameMode

If GetStage WaVLTFoundQuest == 50 && DoOnce == 0
Set [YourPersistentRefIDGoesHere].FlagVariable to 1
Set DoOnce to 1
EndIf

End
[/codebox]

And then in the script attached to the base object of your persistent ref:

[codebox]short FlagVariable

Begin GameMode

If FlagVariable == 1
Player.SetCrimeGold 0
ModPCInfamy -99999
Set FlagVariable to 0
EndIf

End

One of these solutions should work for you. These functions aren't generally harbingers of game freezes though, so I suspect you will find something else is causing your freezing.

Edited by Khettienna
Link to comment
Share on other sites

Khett,

I am still locking up. Here is the program flow:

.....

; WaV001 Main Script block

If ( GetStage WaVLTFoundQuest == 50 )

WaVRemoveInfamySCRIPT.Call WaVAvrusAdasNPCRef.GetTalkedToPC

Endif

......

scn WaVRemoveInfamySCRIPT

short FlagVariable

Begin GameMode

If GetStage WaVLTFoundQuest == 50 && FlagVariable == 0

playSound3D SPLAlterationCast

Set FlagVariable to 1

EndIf

If GetStage WaVLTFoundQuest == 50 && FlagVariable == 1

Player.SetCrimeGold 0

ModPCInfamy -99999

EndIf

GetCallingScript WaV001QuestScript

End

Link to comment
Share on other sites

Yeah, I really and truly don't think it's your script (or at least this part of it) that's causing your lock up.

In your main script, try replacing this block:

If ( GetStage WaVLTFoundQuest == 50 )

WaVRemoveInfamySCRIPT.Call WaVAvrusAdasNPCRef.GetTalkedToPC

Endif

With:

If ( GetStage WaVLTFoundQuest == 50 )

Message "This is a test."

Endif

And see if you still get the lock up.

Link to comment
Share on other sites

Khett, I have already done this test and there are no lockups with game play. The problem occurs when I either try to remove crime gold or player infamy while using a script. However, I can execute these functions freely under the TM console.

Link to comment
Share on other sites

  • 1 month later...
Here is a plugin in which I have a quest script that clears infamy and bounty using the same methods I showed you. The quest is triggered by a giant AR switch in the TestingHall. This plugin works fine for me, and does not crash my game. Please test it yourself with no other mods loaded, and let me know if your game freezes.
Link to comment
Share on other sites

Khett, please explain what you mean by, "I see your problem; you need to move your script call to the game block". What do you mean? I thought the idea was to fire the script call under the Results box immediately at the conclusion of the dialogue sequence.

Link to comment
Share on other sites

Oh, no, I said you should move that bit of code to the game mode block of your quest script instead of running it from the dialogue results box directly. Having an NPC cast a spell in the same frame as they are finishing speaking in menu mode could easily cause a lockup/freeze/crash/other bad things. But let's stick to PMs and IMs to discuss things we discussed in PMs or IMs because the general public has no idea what we're talking about now. :P

Link to comment
Share on other sites

  • 5 weeks later...

There is still no known resolution under TESIV to allow a NPC to remove a Player's infamy or crime gold. However, I was able to develop a script to allow an object to accomplish this task with no issues. Working the NPC route will lock up game play every single time. I obviously require more assistance.

Link to comment
Share on other sites

You weren't having the NPC remove the dialog before when it was freezing your game, you were doing it with a quest script. An NPC cannot directly remove bounty or infamy, anyway; either way you end up doing it in a script.

The method I quoted you in this post works fine outside of your mod, because I tested it in-game on its own before I posted it (note: it does set infamy to a negative value, so use the script in the plugin I uploaded for you instead to get it an even zero).

There is still no known resolution under TESIV to allow a NPC to remove a Player's infamy or crime gold.

That is because no resolution is needed, it works fine. Whether the block of code used to do it is in a quest script, object script, magic script, or results script, the end result is the same, and it works in all four cases. It is only in your mod that it is not working, so as I have already told you a dozen times over the last few months, the block of code executing those commands is not the problem.

And I can't tell you what the problem actually is, because as far as I know, you never finished cleaning the plugin or reworked the scripts from the annotations I spent several hours writing for you. Instead, you just keep building more stuff/features on the broken foundation, making it increasingly harder to see where the bugs actually are, so I'm not giving the matter any more attention. :P Good luck!

Link to comment
Share on other sites

During our last PM session, you suggested to use a custom spell to emulate a NPC to remove Player infamy. I did that and my game locked up immediately. My mod is as clean as it can do. I am debugging my mod under CSE v5.1 every day. In fact, my mod is now cleaner than some TESA mods. I am still open for suggestions for improving the gaming experience of my mod plug-in, Word and Void.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...