Jump to content

Quick Question - Quick Answer


Cipscis

Recommended Posts

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

  • Replies 804
  • Created
  • Last Reply

Top Posters In This Topic

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

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

@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" statement

ScriptName 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

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

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 0

It shouldn't make any difference, but I thought I'd mention it anyway.

 

Cipscis

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...