AtomicAmelyn Posted November 19, 2012 Share Posted November 19, 2012 (edited) Hi. I starting this topic because I need help into making chemistry sets re-usable in New Vegas. I find it sad that I could only use them once, to create chems or stimpacks, and what I'd like to do would be to make them re-usable every 24 or 48 hours, for example. Therefore, I'll post the Chemistry Set script here and have you guys take a look. scn GSChemistrySetScript short Button begin OnActivate if IsActionRef player ShowMessage GSChemistrySetMsg endif end BEGIN MenuMode 1001 set Button to GetButtonPressed if ( Button == 1 ) player.AddItem Stimpak 5 SetDestroyed 1 elseif ( Button == 2 ) player.AddItem Psycho 1 player.AddItem Buffout 1 player.AddItem Mentats 1 player.AddItem NVSteadyChem 1 player.AddItem NVReboundChem 1 SetDestroyed 1 endif END PasteBin version available here. If anyone good enough with scripting may know which variables I need to change, please tell me. I will like you and give you kudos. Thanks again. Lady S. Edited November 19, 2012 by LadySinestro Link to comment Share on other sites More sharing options...
Xaranth Posted November 19, 2012 Share Posted November 19, 2012 (edited) Hi. I starting this topic because I need help into making chemistry sets re-usable in New Vegas. I find it sad that I could only use them once, to create chems or stimpacks, and what I'd like to do would be to make them re-usable every 24 or 48 hours, for example. Therefore, I'll post the Chemistry Set script here and have you guys take a look. scn GSChemistrySetScript short Button begin OnActivate if IsActionRef player ShowMessage GSChemistrySetMsg endif end BEGIN MenuMode 1001 set Button to GetButtonPressed if ( Button == 1 ) player.AddItem Stimpak 5 SetDestroyed 1 elseif ( Button == 2 ) player.AddItem Psycho 1 player.AddItem Buffout 1 player.AddItem Mentats 1 player.AddItem NVSteadyChem 1 player.AddItem NVReboundChem 1 SetDestroyed 1 endif END PasteBin version available here. If anyone good enough with scripting may know which variables I need to change, please tell me. I will like you and give you kudos. Thanks again. Lady S. EDIT01: After half a cup of coffee, my brain figured out what was nagging me... That check should be in the activate block. So. scn GSChemistrySetScript short Button short bTimeFlag float fDayUsed float fDayTodaybegin OnActivate if IsActionRef player Set fDayToday to GetGameDaysPassed Set bTimeFlag to 0 if (fDayToday >= (fDayUsed + 3)) Set bTimeFlag to 1 ShowMessage GSChemistrySetMsg else ;Probably want to show a message about needing mor time here. endif end BEGIN MenuMode 1001 set Button to GetButtonPressed if bTimeFlag == 1 if ( Button == 1 ) player.AddItem Stimpak 5 Set fDayUsed to GetGameDaysPassed Set bTimeFlag to 0 elseif ( Button == 2 ) player.AddItem Psycho 1 player.AddItem Buffout 1 player.AddItem Mentats 1 player.AddItem NVSteadyChem 1 player.AddItem NVReboundChem 1 Set bTimeFlag to 0 endIf else ;Might use this block to let the character 'reload' the chemset. endifEnd[/Code] That's still off the top of my head, untested, etc. EDIT02: Added a missing LeftSquareBracketEDIT03: Added a missing assignment statement. Right, no more coding before coffee. Edited November 19, 2012 by Xaranth Link to comment Share on other sites More sharing options...
CaptMitch Posted November 19, 2012 Share Posted November 19, 2012 remove SetDestroyed 1 from the script scn GSChemistrySetScript short Button begin OnActivate if IsActionRef player ShowMessage GSChemistrySetMsg endif end BEGIN MenuMode 1001 set Button to GetButtonPressed if ( Button == 1 ) player.AddItem Stimpak 5 SetDestroyed 1 elseif ( Button == 2 ) player.AddItem Psycho 1 player.AddItem Buffout 1 player.AddItem Mentats 1 player.AddItem NVSteadyChem 1 player.AddItem NVReboundChem 1 SetDestroyed 1 endif END Link to comment Share on other sites More sharing options...
Xaranth Posted November 19, 2012 Share Posted November 19, 2012 remove SetDestroyed 1 from the script That was my first thought, too, but then I realized that just striking the SetDestroyed would allow it to be reused, but it wouldn't impose a once every several days limit. You could just keep using it forever. Link to comment Share on other sites More sharing options...
AtomicAmelyn Posted November 19, 2012 Author Share Posted November 19, 2012 EDIT01: After half a cup of coffee, my brain figured out what was nagging me... That check should be in the activate block. So. scn GSChemistrySetScript short Button short bTimeFlag float fDayUsed float fDayTodaybegin OnActivate if IsActionRef player Set fDayToday to GetGameDaysPassed Set bTimeFlag to 0 if (fDayToday >= (fDayUsed + 3)) Set bTimeFlag to 1 ShowMessage GSChemistrySetMsg else ;Probably want to show a message about needing mor time here. endif end BEGIN MenuMode 1001 set Button to GetButtonPressed if bTimeFlag == 1 if ( Button == 1 ) player.AddItem Stimpak 5 Set fDayUsed to GetGameDaysPassed Set bTimeFlag to 0 elseif ( Button == 2 ) player.AddItem Psycho 1 player.AddItem Buffout 1 player.AddItem Mentats 1 player.AddItem NVSteadyChem 1 player.AddItem NVReboundChem 1 Set bTimeFlag to 0 endIf else ;Might use this block to let the character 'reload' the chemset. endifEnd[/Code] That's still off the top of my head, untested, etc. EDIT02: Added a missing LeftSquareBracketEDIT03: Added a missing assignment statement. Right, no more coding before coffee. I tried your script, but it gave me this error message upon saving: http://i1161.photobucket.com/albums/q513/LadySinestro/errormessage00.jpg I don't know what to do. Lady S. Link to comment Share on other sites More sharing options...
blove Posted November 19, 2012 Share Posted November 19, 2012 In your OnActivate block you are missing an EndIf for "if IsActionRef player". Link to comment Share on other sites More sharing options...
Xaranth Posted November 19, 2012 Share Posted November 19, 2012 In your OnActivate block you are missing an EndIf for "if IsActionRef player". Yeah, it should look like this: begin OnActivate if IsActionRef player Set fDayToday to GetGameDaysPassed Set bTimeFlag to 0 if (fDayToday >= (fDayUsed + 3)) Set bTimeFlag to 1 ShowMessage GSChemistrySetMsg else ;Probably want to show a message about needing mor time here. endif endIf end My bad, but that's what happens when you mix me, coding, and no coffee. >.> Good catch, blove. Link to comment Share on other sites More sharing options...
AtomicAmelyn Posted November 20, 2012 Author Share Posted November 20, 2012 Alright guys. I tried out the new script and it saved just fine but, I have another problem now. I tested it in-game and when I tried to activate the chemistry set, it didn't do anything. What should I do now? Link to comment Share on other sites More sharing options...
Xaranth Posted November 20, 2012 Share Posted November 20, 2012 Alright guys. I tried out the new script and it saved just fine but, I have another problem now. I tested it in-game and when I tried to activate the chemistry set, it didn't do anything. What should I do now? I think the fault here is that I took GetGameDaysPassed for a function, when what's proper is checking the variable GameDaysPassed. With some minimal testing, this works for me. I don't know why yours compiled with GetGameDaysPassed used, but the GECK is weird. scn GSChemistrySetScript short DARCdummyButton short bTimeFlag float fDayUsed float fDayToday begin OnActivate if IsActionRef player Set fDayToday to GameDaysPassed Set bTimeFlag to 0 if (fDayToday >= (fDayUsed + 3)) Set bTimeFlag to 1 ShowMessage GSChemistrySetMsg else ;Probably want to show a message about needing mor time here. endif endif end BEGIN MenuMode 1001 set DARCdummyButton to GetButtonPressed if bTimeFlag == 1 if ( DARCdummyButton == 1 ) player.AddItem Stimpak 5 Set fDayUsed to GameDaysPassed Set bTimeFlag to 0 elseif ( DARCdummyButton == 2 ) player.AddItem Psycho 1 player.AddItem Buffout 1 player.AddItem Mentats 1 player.AddItem NVSteadyChem 1 player.AddItem NVReboundChem 1 Set bTimeFlag to 0 endIf else ;Might use this block to let the character 'reload' the chemset. endif End Link to comment Share on other sites More sharing options...
CaptMitch Posted November 21, 2012 Share Posted November 21, 2012 scn GSChemistrySetScript short Button float Timer Begin GameMode if (Timer > 0) Set Timer to Timer - GetSecondsPassed endif END begin OnActivate if IsActionRef player if (Timer <= 0) ShowMessage GSChemistrySetMsg else If you want a message for timer put here (but you will have to change the buttons below) endif end BEGIN MenuMode 1001 set Button to GetButtonPressed if ( Button == 1 ) player.AddItem Stimpak 5 Set Timer to 86400 elseif ( Button == 2 ) player.AddItem Psycho 1 player.AddItem Buffout 1 player.AddItem Mentats 1 player.AddItem NVSteadyChem 1 player.AddItem NVReboundChem 1 Set Timer to 86400 endif END Link to comment Share on other sites More sharing options...
Recommended Posts