yibiyul Posted August 6, 2024 Share Posted August 6, 2024 Hello everyone, this is my first time making a mod, or programming in general. I'm trying to make a farming-oriented character that gets stat buffs at the start of each day, which is dependent on the amount of farm plants in the world. My progress so far has been using the code from the c_countprefabs() command to make a function that returns only the count of the specified prefab. I then use a local variable to hold the total number of farm plants using every farm plant prefab ("farm_plant_tomato," "farm_plant_eggplant," etc.) using that function. The next plan was to update the count when a day begins, add that count to the character's stats, and play a quote for the character. The main problem I'm running into is that I have no idea how to trigger the function when the day starts. I've tried searching for some keywords or mechanics related to time in my copy of the game's script files, but I've turned up nothing. I've tried insight, skill trees, music, darkness, Charlie, and other mechanics that I can think of related to time passing, but I haven't found anything yet. Any clues as to the specific script or script name I can look at would be greatly appreciated. Link to comment https://forums.kleientertainment.com/forums/topic/158881-how-to-dynamically-update-a-custom-characters-stats-at-the-beginning-of-each-day/ Share on other sites More sharing options...
Haruhi Kawaii Posted August 7, 2024 Share Posted August 7, 2024 On 8/6/2024 at 1:22 PM, yibiyul said: Hello everyone, this is my first time making a mod, or programming in general. I'm trying to make a farming-oriented character that gets stat buffs at the start of each day, which is dependent on the amount of farm plants in the world. My progress so far has been using the code from the c_countprefabs() command to make a function that returns only the count of the specified prefab. I then use a local variable to hold the total number of farm plants using every farm plant prefab ("farm_plant_tomato," "farm_plant_eggplant," etc.) using that function. The next plan was to update the count when a day begins, add that count to the character's stats, and play a quote for the character. The main problem I'm running into is that I have no idea how to trigger the function when the day starts. I've tried searching for some keywords or mechanics related to time in my copy of the game's script files, but I've turned up nothing. I've tried insight, skill trees, music, darkness, Charlie, and other mechanics that I can think of related to time passing, but I haven't found anything yet. Any clues as to the specific script or script name I can look at would be greatly appreciated. Try inst:WatchWorldState("cycles", Needupdatestats) Link to comment https://forums.kleientertainment.com/forums/topic/158881-how-to-dynamically-update-a-custom-characters-stats-at-the-beginning-of-each-day/#findComment-1739615 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now