Jump to content

Need Help With Scripting


Carah

Recommended Posts

This is my first attempt at scripting, and everything is working like I want it to. What I have going on is when you activate a container a message pops up, but I haven't figured out how to only have it pop up once. So, every time I open and close the container the message keeps appearing.

 

How do I get to only pop up once?

 

I had a good laugh when I typed in the script "disable messagebox", and when I went into the game the container wasn't there... lol!

 

Thank-you for your time :thumbsup:

Link to comment
Share on other sites

This is my first attempt at scripting, and everything is working like I want it to. What I have going on is when you activate a container a message pops up, but I haven't figured out how to only have it pop up once. So, every time I open and close the container the message keeps appearing.

 

How do I get to only pop up once?

 

I had a good laugh when I typed in the script "disable messagebox", and when I went into the game the container wasn't there... lol!

 

Thank-you for your time :thumbsup:

 

You need to add a condiitional statement. Something like this:

 

begin onactivate

 

if ( doonce == 0 )

messagebox " _ "

set doonce to 1

endif

 

end

Link to comment
Share on other sites

Exactly what jefe says....

This is the full tutorial from the CSWiki: MessageBox Tutorial

But you're not using any choices, so jefe's example would be enough...

 

Take a look at the first (second murder) DarkBrotherhood Quest at the crate script too.

I find it the best example there is...(It is called Darko02CrateScript) It doesn't run in MenuMode, but is a great follow-up from your own.

Take a look after you've finished yours, it uses many essential/used functions concerning scripting in general ;).

Link to comment
Share on other sites

Thank-you guys I'll give it a try.

 

This is what I originally had:

 

Begin OnActivate

if IsActionRef player == 1

Messagebox "__"

endif

else

activate

endif

end

Link to comment
Share on other sites

You need to add a condiitional statement. Something like this:

 

begin onactivate

 

if ( doonce == 0 )

messagebox " _ "

set doonce to 1

endif

 

end

 

I must of done something wrong. Every thing did what I wanted, except the door of the glass case kept opening and closing, repeatedly on its own.

Link to comment
Share on other sites

Exactly what jefe says....

This is the full tutorial from the CSWiki: MessageBox Tutorial

But you're not using any choices, so jefe's example would be enough...

 

Take a look at the first (second murder) DarkBrotherhood Quest at the crate script too.

I find it the best example there is...(It is called Darko02CrateScript) It doesn't run in MenuMode, but is a great follow-up from your own.

Take a look after you've finished yours, it uses many essential/used functions concerning scripting in general ;).

 

 

The Darko02CrateScript, and Tutorial helped me out, but I'm still trying to understand the fundamentals of scripting, it doesn't come natural to me. It's starting to remind me of math class. When I use some of the scripting from the Crate Script. I'm always getting a window popping-up about errors in certain lines when I try saving.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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