blackbelt Posted November 17, 2008 Share Posted November 17, 2008 I'm making a house mod that contains many quests and other things. This will be my first released mod and I need help with a couple scripts.In my quest you help a man build a house. I need scripts to know how to set an amount of time (24hours) until the house is built.So you talk to the man about the house and in 24 hours its built. How do i do this. (I'm using script Enable Ref to actually make the house appear.) Also I need to know how after that time I add new AI Packages to the NPC who helps you buy the house. And finally, how do I make a script that checks if you have enough Gold before removing it. Because if I use " Player.removeitem f 500"and the player doesn't have 500gold he'll have -gold. For example if he has 400 gold his gold will go down to -100g. I hope I didn't make this sound too confusing. Thanks Link to comment Share on other sites More sharing options...
blackbelt Posted November 18, 2008 Author Share Posted November 18, 2008 I think I found out how to add AI. (addscriptpackage "ThePackageIWantToAdd") Right? Link to comment Share on other sites More sharing options...
AzirAphale001 Posted November 18, 2008 Share Posted November 18, 2008 Go to the CS Wiki. Link to comment Share on other sites More sharing options...
blackbelt Posted November 24, 2008 Author Share Posted November 24, 2008 Lol thanks for telling me the wiki. I found out how to do my other mod but I couldn't find out how to do the .enable for NPCs or how to add new packages to an NPC after a quest. Link to comment Share on other sites More sharing options...
Vagrant0 Posted November 24, 2008 Share Posted November 24, 2008 Lol thanks for telling me the wiki. I found out how to do my other mod but I couldn't find out how to do the .enable for NPCs or how to add new packages to an NPC after a quest.The syntax for enabling an NPC is to use <reference>.Enable. You need to have either a named, persistant reference, the reference ID of a persistant reference, or have that thing selected in game. Form IDs and editor IDs cannot be used in this case. For AI, all AI that you want to remain on the NPC for any reasonable duration needs to be added to the base NPC in the CS, and controlled by having the conditions on that package match the conditions of that part of the quest. Packages added through scripting are temporary, and should be considdered unreliable for triggering any sort of event as these packages are cleared any time the NPC re-evaluates their packaging. Link to comment Share on other sites More sharing options...
blackbelt Posted November 26, 2008 Author Share Posted November 26, 2008 Thanks a lot, I completely understand the AI thing now thanks to you. I think I understand what you're saying about the enabling NPC's, and I think I know how to make the condition that the player has the amount of gold. I'll try this all out thx. Lol I think this is the 4th or 5th time you've helped me out Vagrant0. Kudos. Link to comment Share on other sites More sharing options...
blackbelt Posted November 28, 2008 Author Share Posted November 28, 2008 Ok I got it all almost figured out, only thing left to figure out is to make a topic condition that the player has a certain amount of gold. Shouldn't be hard, thanks guys. Link to comment Share on other sites More sharing options...
blackbelt Posted November 28, 2008 Author Share Posted November 28, 2008 Ok I got it all almost figured out, only thing left to figure out is to make a topic condition that the player has a certain amount of gold. Shouldn't be hard, thanks guys. Link to comment Share on other sites More sharing options...
Khet Posted November 28, 2008 Share Posted November 28, 2008 For your house construction (if you still want this aspect) the script would look something along the lines of this: Short DoOnce Short CurrentDay Short DayCount Begin GameMode If DoOnce1 == 0 && GetStage QuestID == ## If CurrentDay == 0 Set CurrentDay to GameDay Elseif CurrentDay != GameDay Set DayCount to DayCount + 1 Set CurrentDay to GameDay If DayCount == 3 HouseReferenceID.Enable Set DoOnce1 to 1 Set DayCount to 0 Setstage QuestID ## Set CurrentDay to 0 endif endif endif endif For the line If DayCount == 3 change it to whatever number you want. Now, this will ONLY work if it's attached to a quest script because if it's on an object it won't run if they're not in the cell. The Set CurrentDay to 0, found after SetStage command, can be used to build multiple houses without having to have a seperate CurrentDay variable for each house. Same goes with the Set DayCount to 0 This is the exact script I've used in my own mod so it is tested and fully functional. The only downside to this however, is since it runs during GameMode if the player decides to wait/sleep the script it paused, and if they wait/sleep again without waiting a few seconds it won't have the chance to update the DayCount (so if they don't wait a few seconds between each wait/sleep it could easily take an extra two, three, or more days for the house to be built.) Link to comment Share on other sites More sharing options...
blackbelt Posted December 5, 2008 Author Share Posted December 5, 2008 Hey thanks a lot:) And yes I am still doing the house construction. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.