Jump to content

Help with scripting my mod


smoblikat

Recommended Posts

I have a mod that i made called The Salty Muffin and if you have played it you will notice that it has 2 "jammed doors" i put them there for later expansion so as not to close all my opportunities with that house. Well while doing the dishes i had the best idea ever i would make one of the doors scripted to teleport you to a mod idea that i had, (no spoilers) but i cant script for $h1t, i know a little bit of BASH but not alot of C so i was hoping if someone could help me out with my script what i want is:

The door upon activation teleports you to a place (i know enough to input the names of the places you just need to leave me a blank spot to put them in) if your luck is level 75 or higher and if it is then a message box will appear saying something, again i will input what the box says, and if your luck is 74 or lower than it says the door is jammed and cannot open ,in a non message box.

If i didnt explain what i need good enough i will try to clarify as best i can, hopefully when i see your script i can start to understand how real scripting works.

 

THANK YOU SO MUCH for putting up with my noobiness, you should check out my mod http://tesnexus.com/downloads/file.php?id=32520 to see what doors i am talking about, its a house mod.

Link to comment
Share on other sites

here's you script

 

 

scriptname > insert name <

 

begin onactivate

 

short doonce ; skip this line if you want the luck above 75 messagebox each time the door is activated, this makes sure it will only show once - I will indicate this with ;optional in the rest of the script

 

begin onactivate

if player.getactorvalue luck <= 74

message "The door is jammed shut and cannot be opened" ; don't forget the quotes

elseif player.getactorvalue luck >= 75 & doonce == 0

messagebox "saying something"

activate

set doonce to 1 ; optional

elseif player.getactorvalue luck >= 75 & doonce == 1 ;optional

activate ;optional

endif

end

 

 

happy modding!

Link to comment
Share on other sites

here's you script

 

 

scriptname > insert name <

 

begin onactivate

 

short doonce ; skip this line if you want the luck above 75 messagebox each time the door is activated, this makes sure it will only show once - I will indicate this with ;optional in the rest of the script

 

begin onactivate

if player.getactorvalue luck <= 74

message "The door is jammed shut and cannot be opened" ; don't forget the quotes

elseif player.getactorvalue luck >= 75 & doonce == 0

messagebox "saying something"

activate

set doonce to 1 ; optional

elseif player.getactorvalue luck >= 75 & doonce == 1 ;optional

activate ;optional

endif

end

 

 

happy modding!

 

That was EXACTLY what i was looking for and i know what those variables mean so now i can kinda make some scripts on my own THANK YOU truly you are cool.

 

Just a question before the doonce why do you put short what does it do?

Link to comment
Share on other sites

You sound like you'd be happy with more help, so here is a version of the script with everything explained ;p I also included a link for you to a site all about modding, this is the portal on scripting ;]

 

 

scriptname > insert name < (this gives your script a name, much like an object ID... or rather, exactly like an object ID)

 

short doonce (this is a variable, this can be set to any number, for more explanation or variables explore the link ;] )

 

begin onactivate (this makes the script run when a player or npc performs the action done by the action key, I've never tested this on inventory items)

if player.getactorvalue luck <= 74 (this checks for the player's luck, this can also be used for any other skill or attribute. most of the commands can be used as "requirement")

message "The door is jammed shut and cannot be opened" (message is a command that displays the entered text in the upper left corner of the screen)

elseif player.getactorvalue luck >= 75 & doonce == 0 (this time the variable earlier in the script is used as requirement too. in this block doonce will be set to 1, preventing this block from running in the future)

messagebox "saying something" (this is a message that draws more attention to the player, but it can be found very lore-breaking)

activate (this makes the object do it's normal function, as this is interupted by the onactivate block)

set doonce to 1 (this should be obvious ;)

elseif player.getactorvalue luck >= 75 & doonce == 1

activate ;optional

endif (endif is REQUIRED if you have an "if" block - it ends the requirements block)

end (this ends this block, after this you can start a new one like "begin onequip player" or "begin gamemode" )

 

 

Scripting site

happy modding !! ;D

Link to comment
Share on other sites

Sweet site man and i really appreciate all the time it took to write down all that text if my mod comes out good ill donate it to shadow software so you can start earning some modding respcect, thanks alot all of you for your help, i hope to be a big part of the modding community.
Link to comment
Share on other sites

Does using parenthesis for comments work? I thought it required the semicolon to declare a comment.

No. You have to use a semicolon if you want the compiler to ignore it. :happy:

Link to comment
Share on other sites

  • Recently Browsing   0 members

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