Jump to content

Mod Help


bobzed_106

Recommended Posts

Hey, I am writing a script that makes it so that you can't just sleep in the beds to serve your time in jail, you actually have to wait it out. I have the script written, I just cant get it to start! How do I get the script to start running as soon as the player is in jail?
Link to comment
Share on other sites

Hey, I am writing a script that makes it so that you can't just sleep in the beds to serve your time in jail, you actually have to wait it out. I have the script written, I just cant get it to start! How do I get the script to start running as soon as the player is in jail?

 

EDIT: sorry, i didn't read your question careful enough. Nevermind hope it helps, though

 

First you'd need to deactivate/remove or alter the script on the bed that lets you pass the time.

One way would be to change the base object of the bed so that no script is assigned at all. In other words: Just a plain bed to sleep in.

 

The real scripting would require that you make a quest that activates once the player goes to jail.

This can be checked for with IsPlayerInJail.

Then you need some way of determining how long you need to wait. I guess in vanilla this is just the bounty multiplied by x (no idea what x is, though. Just take some number).

The quest(or better, the script the quest is using) would then compare the date of imprisonment with the current date and get the player out of jail once the time is up.

The script on the bed that normally lets you skip the time in jail probably does this (get you out of jail, that is), so you could just copy that in to your script. If it doesn't then I guess it's just something like setting the bounty to 0 and teleporting the player to another cell and giving him/her all the items back.

 

For scripting help always check out this site:http://cs.elderscrolls.com/constwiki/index.php/Portal:Scripting

Some specific funtions: Crime_Functions, Time_Functions, Quest_scripts

Link to comment
Share on other sites

Hey, I am writing a script that makes it so that you can't just sleep in the beds to serve your time in jail, you actually have to wait it out. I have the script written, I just cant get it to start! How do I get the script to start running as soon as the player is in jail?

 

EDIT: sorry, i didn't read your question careful enough. Nevermind hope it helps, though

 

First you'd need to deactivate/remove or alter the script on the bed that lets you pass the time.

One way would be to change the base object of the bed so that no script is assigned at all. In other words: Just a plain bed to sleep in.

 

The real scripting would require that you make a quest that activates once the player goes to jail.

This can be checked for with IsPlayerInJail.

Then you need some way of determining how long you need to wait. I guess in vanilla this is just the bounty multiplied by x (no idea what x is, though. Just take some number).

The quest(or better, the script the quest is using) would then compare the date of imprisonment with the current date and get the player out of jail once the time is up.

The script on the bed that normally lets you skip the time in jail probably does this (get you out of jail, that is), so you could just copy that in to your script. If it doesn't then I guess it's just something like setting the bounty to 0 and teleporting the player to another cell and giving him/her all the items back.

 

For scripting help always check out this site:http://cs.elderscrolls.com/constwiki/index.php/Portal:Scripting

Some specific funtions: Crime_Functions, Time_Functions, Quest_scripts

 

I got all that but the player can't just walk out of jail once they have served their sentence. Their bounty goes to 0, but they get attacked by a guard and are given the escaping bounty. I know I have to set isplayerinjail to 0 but the game crashes when I do... any advice?

Link to comment
Share on other sites

  • Recently Browsing   0 members

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