Jump to content

Fallout 3 Scripting help


Ares1

Recommended Posts

Hi, I've recently began more work on my mod: Placeable lights and ran into an issue making the lights turn on\off. is there any commands that allow you to replace an object in the game world or a way to change the radius of the light through a script?
Link to comment
Share on other sites

Thanks! :D Thats what I'm trying now I'm trying to get the current object to disable itself while moving another object to the old ones exact position to make a light "appear" on, and vice versa if I want the light to "appear" off. my code is still very... lets say crappy :P as it can only make the object disappear and not reappear again. Also once the objects has been toggled once the message with the choices simply does not appear again :/ I started using reference ID's in an attempt to get it to work but with very limited results (it only vanishes the current object while not moving the new one). Here is my code so far...

 

scn Lightonoffscript

 

short button

short rset

ref b8

ref c2

ref 010022b8

ref 010022c2

float xang

float zang

float yang

float x

float z

float y

begin onActivate

showmessage 1lightoptions

if button == 0 && rset ==0

set xang to 010022b8.getangle x

set zang to 010022b8.getangle z

set yang to 010022b8.getangle y

lampoff.disable

set x to xang

set y to yang

set z to zang

ref 010022c2.setPos z

ref 010022c2.setPos y

ref 010022c2.setPos x

set rset to 1

set rset to 0

elseif button == 1 && rset == 0

set xang to 010022c2.getangle x

set zang to 010022c2.getangle z

set yang to 010022c2.getangle y

set x to xang

set y to yang

set z to zang

ref 010022c2.disable

ref 010022b8.setPos z zang

ref 010022b8.setPos y yang

ref 010022b8.setPos x xang

set rset to 0

elseif button == 2 && rset == 0

player.additem 1lampoff 1

set rset to 0

elseif button == 3 && rset == 0

set rset to 0

endif

end

Link to comment
Share on other sites

Is this lights movable? , static? , turned via switch? , how they will be placed ?

Guess I just can make a suggestion.

use can this for light turned ON (example)

 

scn LightONscript

short iButton
short iButtonPressed
ref rMySelf

Begin OnActivate Player
set rMySelf to GetSelf
ShowMessage LightOptionsON	
set iButtonPressed to 1
end

Begin GameMode

if iButtonPressed == 1
	set iButton to GetButtonPressed
	if iButton > -1
		set iButtonPressed to 0
		if iButton == 0	;Disable  ?
			rMySelf.disable
			rMySelf.PlaceAtMe TurnedOffLight		
			rMySelf.markfordelete
		elseif iButton == 1	;take ?
			Player.Activate	;misc. item ?
		elseif iButton == 2	;do nothing ?
		endif
	endif
endif

end

 

and OFF

 

scn LightOFFscript

short iButton
short iButtonPressed
ref rMySelf

Begin OnActivate Player
set rMySelf to GetSelf
ShowMessage LightOptionsOFF - for turned off light
set iButtonPressed to 1
end

Begin GameMode

if iButtonPressed == 1
	set iButton to GetButtonPressed
	if iButton > -1
		set iButtonPressed to 0
		if iButton == 0	; Enable ?
			rMySelf.disable
			rMySelf.PlaceAtMe TurnedOnLight
			rMySelf.markfordelete
		elseif iButton == 1	;take ?
			Player.Activate	;misc. item ?
		elseif iButton == 2	;do nothing ?
		endif
	endif
endif

end

Link to comment
Share on other sites

thanks :D

 

Ya the lights are placeable and carry-able

 

this script looks way more understandable than my own, is there a way to have the off and on scripts on the same script so it is like this in game

 

______________

|.......turn on......|

|.......turn off......|

|.......pick up......|

|....do nothing....|

~~~~~~~~~~~~

 

I'm going to mess around with your scripts and see what I can do :P thanks again for the help

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...