Jump to content

Need help with a simple script


IWIronWolf

Recommended Posts

Ok, so i have been looking up and down CS wiki and in ingame scripts but to no avail. When it comes to scripting, im a noob. So, if someone can help without to much bashing, that would be nice. The script I want to make aggravates me because its so simple to do. For the morrowind script engine, I would have had it done in like 2 seconds. But oblivions scripting is... twinked out a bit.

 

All i need the script to do, is raise the object up (pos Z) XX amount of units. When activated again, it registers that it has moved the object once, and then returns the object back to its starting location (pos -z). The script is planned to be placed on a painting. When you activate the painting, it moves up XX amount of units. When activated again, it moves back down to cover up the alcove again.

 

Thanks in advance.

Link to comment
Share on other sites

Easy . . . 2 minutes

Attach this script to the painting.

 

scn MyScriptName

short xMoved
float xPosZ

begin onactivate
if xMoved
	set xPosZ to getpos Z - XX ;  number of units you want
	set xMoved to 0
else
	set xPosZ to getpos Z + XX
	set xMoved to 1
endif
setpos Z xPosZ
end

Link to comment
Share on other sites

Here you go.

But this is not for free. There is a price you must pay me(see it below the code box)

 

scn MyScriptName

short xSpeed
short xMoved
float xPosZ
float xPosOri

begin onactivate
set xSpeed to 10  ; <<< Change to your liking  (units per second)
set xPosOri to getstartingpos z
end

begin gamemode
if xSpeed
	if xMoved
		set xPosZ to getpos Z - xSpeed * getsecondspassed
		if getpos Z < xPosOri
			set xPosZ to xPosOri 	
			set xMoved to 0
			set xSpeed to 0
		endif
	else
		set xPosZ to getpos Z + xSpeed * getsecondspassed
		if getpos Z > xPosOri + 80	; <<< change to the diplacement limnit
			set xPosZ to xPosOri + 80; <<< change to the diplacement limnit
			set xMoved to 1
			set xSpeed to 0
		endif
	endif
	setpos Z xPosZ
endif
end

 

The price is that you add at least one idea to this thread of mine.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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