Deleted2746547User Posted October 9, 2012 Share Posted October 9, 2012 (edited) I'm going to try one more time to get a little feedback or advice... if this doesn't work, then I guess it's not going to come at all. I have been working on a pretty big mod and need a little technical advice. There are a number of things I've struggled through and figured out. A few critical things I THANKFULLY got help from a few kind souls in the past. However, now.... Even when I post a sample of the script I can't get to work just right, I get zero feedback. Not sure I understand that. Anyway, if anyone can offer suggestions on two things that would be greatly appreciated."#1. If I have an activator set up to "build something": I have the basic foundation working to enable the items/structures to appear or disappear. How would you make the event itself take time (like waiting), require you to have a certain item (hammer example) in inventory and certain resources (example tin can and rocks). I understand the concept of operators/if/and etc but in practice it's not working. I think I have the resources thing worked out but suggestions for a cleaner way would be helpful. #2 On X marker headings: I have several NPC's running patrol patterns but at one or two points they all seem to get "stuck in position" and won't move until I "wait". Thoughts. Thank you for any advice. Edited October 9, 2012 by Guest Link to comment Share on other sites More sharing options...
viennacalling Posted October 9, 2012 Share Posted October 9, 2012 However, now.... Even when I post a sample of the script I can't get to work just right, I get zero feedback. Not sure I understand that. Not much to understand. Either there was insufficient information for people to comment, no one knew the answer or no one was interested in answering. #1. If I have an activator set up to "build something": I have the basic foundation working to enable the items/structures to appear or disappear. How would you make the event itself take time (like waiting), require you to have a certain item (hammer example) in inventory and certain resources (example tin can and rocks). I understand the concept of operators/if/and etc but in practice it's not working. I think I have the resources thing worked out but suggestions for a cleaner way would be helpful. A cleaner way is to use a recipe. But if you want the event to take time then yes a script attached to the activator with a gamemode block and a timer is probably the way to go. Link to comment Share on other sites More sharing options...
devinpatterson Posted October 9, 2012 Share Posted October 9, 2012 Anyway, if anyone can offer suggestions on two things that would be greatly appreciated."#1. If I have an activator set up to "build something": I have the basic foundation working to enable the items/structures to appear or disappear. How would you make the event itself take time (like waiting), require you to have a certain item (hammer example) in inventory and certain resources (example tin can and rocks). I understand the concept of operators/if/and etc but in practice it's not working. I think I have the resources thing worked out but suggestions for a cleaner way would be helpful. Go ahead and post your script, it will help to discuss specifics instead of hypotheticals. re: the event taking time, you'll have to use a timer. Here is an easy tutorial. and yes the operators is the way to go, using getitemcount >= for your if statement Make sure your using the player container for getitemcount, and the items being enabled are references not base forms. If Player.GetItemCount hammer >= 1 && doOnce == 0;whatever hammer's id is set sTimerBegin to 1 set doOnce to 1 End if if sTimerBegin == 1 run your timer code when your timer code reaches whatever value you want Else house.enable Warning: not a scripting guy, other people may have a much more elegant/sensible solution. Link to comment Share on other sites More sharing options...
Deleted2746547User Posted October 9, 2012 Author Share Posted October 9, 2012 (edited) I know this one is not correct, this is without the "building phase/time code included. What I'm trying to do is have the script check to see if you have the hammer and also the materials needed for construction, if you don't then you get the error message. If you do, it takes the materials out of your inventory and sets the timer to build the structure. I'm just lost on this one, and I haven't even set the timer. scn BlackbriarBuildNorthRedoubtScript Begin onActivate If Player.GetItemCount BlackbriarHammer >= 1 && doOnce == 0 If player.GetItemCount BlackbriarMetalResource player.removeItem BlackbriarMetalResource 2 If player.GetItemCount BlackbriarGlassResource 1 player.removeItem BlackbriarGlassResource 1 set doOnce to 1 BlackbriarNorthernRedoubtActivatorRef.enable Else ShowMessage BlackbriarNorthRedoubtBuildingMaterialsMsg EndifEnd Edited October 9, 2012 by Guest Link to comment Share on other sites More sharing options...
Deleted2746547User Posted October 9, 2012 Author Share Posted October 9, 2012 Thank you both for the response. I've managed to get several other things working right through cannibalizing other scripts and monkeying around... but scripting makes my head hurt and as hard as i try, I just dont "get it" Link to comment Share on other sites More sharing options...
devinpatterson Posted October 9, 2012 Share Posted October 9, 2012 Your missing some logical operators there brother, and your missing some endIf statements too. Basically you want to make sure that *all* of the required resources are there before the house is enabled right? The way you have it set up now, I don't think anything but the hammer and the doOnce matter. I mean you might have been trying to do nested if blocks, but without any endIf and no formatting I can't really tell. In fact, if you could enclose your code with teh code tag thatt would be a lot easier. After your done typing or cutting and pasting the script, highlight it and select the code tag; http://i1066.photobucket.com/albums/u404/devinlpatterson/codeTag_zps277e1a9a.jpg That should preserve the formatting. Begin onActivate If Player.GetItemCount BlackbriarHammer >= 1 && doOnce == 0 && player.GetItemCount BlackbriarMetalResource >= 2 && player.GetItemCount BlackbriarGlassResource >= 1 player.removeItem BlackbriarMetalResource 2 player.removeItem BlackbriarGlassResource 1 set doOnce to 1 BlackbriarNorthernRedoubtActivatorRef.enable Else ShowMessage BlackbriarNorthRedoubtBuildingMaterialsMsg Endif End That way *all* conditions have to be met before the house can be enabled. Also where you have "BlackbriarNorthernRedoubtActivatorRef.enable" is where you'd start your timer or the short to start a timer in a gamemode block......if you didn't want the house to appear right after hitting the activator. Another thing that will help, is if you tell us what the results are........even if it's a spectacular failure. For instance you said this script doesn't work, but does the hammer disappear when the player activates the trigger? Do any of the other materials disappear? Is the house ever enabled, or is it just that it's enabled but the appropriate materials aren't removed? My brain's running on fumes, hopefully at least some of the above is correct and helps a little. Link to comment Share on other sites More sharing options...
Deleted2746547User Posted October 9, 2012 Author Share Posted October 9, 2012 Your missing some logical operators there brother, and your missing some endIf statements too. Basically you want to make sure that *all* of the required resources are there before the house is enabled right? The way you have it set up now, I don't think anything but the hammer and the doOnce matter. I mean you might have been trying to do nested if blocks, but without any endIf and no formatting I can't really tell. In fact, if you could enclose your code with teh code tag thatt would be a lot easier. After your done typing or cutting and pasting the script, highlight it and select the code tag; http://i1066.photobucket.com/albums/u404/devinlpatterson/codeTag_zps277e1a9a.jpg That should preserve the formatting. Begin onActivate If Player.GetItemCount BlackbriarHammer >= 1 && doOnce == 0 && player.GetItemCount BlackbriarMetalResource >= 2 && player.GetItemCount BlackbriarGlassResource >= 1 player.removeItem BlackbriarMetalResource 2 player.removeItem BlackbriarGlassResource 1 set doOnce to 1 BlackbriarNorthernRedoubtActivatorRef.enable Else ShowMessage BlackbriarNorthRedoubtBuildingMaterialsMsg Endif End That way *all* conditions have to be met before the house can be enabled. Also where you have "BlackbriarNorthernRedoubtActivatorRef.enable" is where you'd start your timer or the short to start a timer in a gamemode block......if you didn't want the house to appear right after hitting the activator. Another thing that will help, is if you tell us what the results are........even if it's a spectacular failure. For instance you said this script doesn't work, but does the hammer disappear when the player activates the trigger? Do any of the other materials disappear? Is the house ever enabled, or is it just that it's enabled but the appropriate materials aren't removed? My brain's running on fumes, hopefully at least some of the above is correct and helps a little. Thank you for that and good point I will make sure to leave that info next time. I tried the script though but it won't even save? Link to comment Share on other sites More sharing options...
devinpatterson Posted October 9, 2012 Share Posted October 9, 2012 Thank you for that and good point I will make sure to leave that info next time. I tried the script though but it won't even save? Yeah it's not a whole script, just a little snippet. Like for instance you have to put in your script name, shorts (short BlackbriarMetalResource etc) for your variables, and any other junk you want it to do. Link to comment Share on other sites More sharing options...
Deleted2746547User Posted October 9, 2012 Author Share Posted October 9, 2012 (edited) I did.... Scn BlackbriarNorthernRedoubtBuild short BlackBriarMetalResourcevariable short BlackbriarGlassResourcevariable float BlackBriarMetalResourcevariable float BlackbriarGlassResourcevariable Begin onActivate If Player.GetItemCount BlackbriarHammer >= 1 && doOnce == 0 && player.GetItemCount BlackbriarMetalResource >= 2 && player.GetItemCount BlackbriarGlassResource >= 1 player.removeItem BlackbriarMetalResource 2 player.removeItem BlackbriarGlassResource 1 set doOnce to 1 BlackbriarNorthernRedoubtActivatorRef.enable Else ShowMessage BlackbriarNorthRedoubtBuildingMaterialsMsg Endif End Edited October 9, 2012 by Guest Link to comment Share on other sites More sharing options...
devinpatterson Posted October 9, 2012 Share Posted October 9, 2012 You need to include the BlackbriarHammer in your var declaration. Plus you need to grab powerup so it will tell you what line has an error(s). But make sure to get the new one, the old was broken by FONV updates. Link to comment Share on other sites More sharing options...
Recommended Posts