TGBlank Posted May 3, 2009 Share Posted May 3, 2009 sorry, use additem bpchurchswitchtoken 1, instead of additem bpchurchswitchtoken. you can't showmessage a note, you showmessage a message. Also, you can't do getbuttonpressed there, since it'd only check for a single frame (in short, it'll never do a thing).There's a nice menu tutorial/example on the geck wiki that you should be able to clone and adapt. Link to comment Share on other sites More sharing options...
Triumph675 Posted May 3, 2009 Share Posted May 3, 2009 Sorry I keep bothering you all :) So I've been looking through the geck wiki and put together this script. This is placed right on the activator ScriptName bpchurchswitch ref light short doonce Begin OnActivate if (doonce == 0) if player.getitemcount fissionbattery >= 25 if light == 0 set light to GetLinkedRef endif if light.GetDisabled light.Enable else light.Disable endif Activate set doonce to 1 endif elseif player.getitemcount fissionbattery <= 24 showmessage bpchurchswitchmessage endif if (doonce == 1) if light == 0 set light to GetLinkedRef endif if light.GetDisabled light.Enable else light.Disable endif Activate endif End It saves... Looks like it should work, but in game does nothing....... Basically, I`m looking for it to check if you have 25 fissionbatteries. If so it then turns on the lights and sets the variable to 1. If you don't it will show the message. After being set to 1 you can turn the lights on and off. Link to comment Share on other sites More sharing options...
TGBlank Posted May 4, 2009 Share Posted May 4, 2009 Should work, if not, you got the other things setup wrongly. ScriptName bpchurchswitch ref light short doonce Begin OnActivate if (doonce == 0) if player.getitemcount fissionbattery >= 25 if light == 0 set light to GetLinkedRef endif if light.GetDisabled light.Enable else light.Disable endif set doonce to 1 Activate elseif player.getitemcount fissionbattery <= 24 showmessage bpchurchswitchmessage return endif Else if light.GetDisabled light.Enable else light.Disable endif Activate endif End Link to comment Share on other sites More sharing options...
Cipscis Posted May 4, 2009 Author Share Posted May 4, 2009 @Triumph675:It looks to me like the problem is that the two conditions checking the value of "doonce" are in separate "blocks", which means that they can both be triggered in the same iteration of the script, which could cause the light's enable state to be toggled twice within the same frame - essentially doing nothing. The revision that TGBlank posted should work just fine, although the second GetItemCount condition could be changed to an "else" statementScriptName bpchurchswitch ref light short doonce Begin OnActivate if doonce == 0 if player.GetItemCount fissionbattery < 25 ShowMessage bpchurchswitchmessage Return else set doonce to 1 set light to GetLinkedRef endif endif if light.GetDisabled light.Enable 0 else light.Disable endif Activate End (I've made a couple more optimisation/shortening tweaks, but that shouldn't affect the functionality) Cipscis EDIT: @Diehard335:Have you tried doing the same thing without FOSE loaded? The crash is very unlikely to be caused by FOSE, although it may be caused by a buggy script that utilises FOSE functions. If that's not the case, have you updated to the most recent patch? The latest patch has introduced some issues with mods that can cause crashes, so you might want to look into this possibility. If this is the case, then I recommend that you reinstall Fallout 3 and patch to v1.0.15, and use JustinOther's Fake Patch. Cipscis Link to comment Share on other sites More sharing options...
Triumph675 Posted May 4, 2009 Share Posted May 4, 2009 Thanks guy, it works flawlessly now.. Now to start implementing part two.. I will be back, with more questions :thumbsup: Link to comment Share on other sites More sharing options...
Triumph675 Posted May 4, 2009 Share Posted May 4, 2009 Hello again, I am trying to use the ash pile activator. But my problem is that it's a movable object and not static, so it can be kicked around and not. Is there a to make this static, so it isn't movable by the player/npc? Link to comment Share on other sites More sharing options...
TGBlank Posted May 4, 2009 Share Posted May 4, 2009 make a static item and give it the same mesh. Link to comment Share on other sites More sharing options...
Zuzaski Posted May 6, 2009 Share Posted May 6, 2009 I noticed somebody asking about tutorialsI made a nice organized list of them a month agohere: http://thenexusforums.com/index.php?showtopic=112021 Link to comment Share on other sites More sharing options...
ikermen Posted May 6, 2009 Share Posted May 6, 2009 Hi,I have a silly question, please.I want change ALL the fungus brain (total 312) to activator with this script:scn ScriptName float FungusTime Begin OnActivate if IsActionRef player == 1 if FungusTime < GameDaysPassed set FungusTime to GameDaysPassed + 4 player.AddItem Fungus 1 0 endif endif End Well, my question is: Add to the game this number of float variables and activators (312) could cause problems with the performance? PD: I guess not, but I want to ask people more experienced than me.Thanks!! Link to comment Share on other sites More sharing options...
Cipscis Posted May 6, 2009 Author Share Posted May 6, 2009 I'm not really sure what you're trying to do with your "FungusTime" variable in that script, but I can tell you that adding 312 scripted activators is not something to worry about. For the vast majority of people, the performance bottleneck is their video card, so unless they're all going to be rendered simultaneously you shouldn't notice a difference. The amount of memory required to declare a variable is negligible. While I always try to minimise the number of variables that I declare, it's never something that you should worry about. Functionality is always more important than optimisation. One thing that I will mention is that you should remove the " == 1" from your IsActionRef condition. Using "if IsActionRef" will achieve the exactly the same result, and is more efficient. You also don't need to include the third parameter of AddItem, as it is optional and if omitted will default to a value of 0, so the following two lines of code are equal:player.AddItem Fungus 1 player.AddItem Fungus 1 0It shouldn't make any difference, but I thought I'd mention it anyway. Cipscis Link to comment Share on other sites More sharing options...
Recommended Posts