Jump to content

Question on Script


Serrieth

Recommended Posts

I am working on a mod and well I did a quest where you must find a Fire Guard

(Goes on the right hand) and you must use it to pick up another item.

 

I put in the script

 

 

Begin TooHotScrip

 

;If the player doesnot have the Fireguard then display msgbox and can't pick up

;item

;If the player does have the fireguard then he/she can pick up item.

 

if ( OnAcrivate == 1 )

if ( Player->GetItemCount fireguard < 1 )

MessageBox " " "ok"

return

elseif ( Player->GetitemCount Fireguard > 1 )

(What do I put?)

endif

endif

 

End

 

 

I'm not sure if I should put 'return' after the elseif or before the elseif, Also what does the command return mean? :help:

Link to comment
Share on other sites

1: Wrong forum, moving this to TES CS.

 

2: Return is a command that stops the game from reading the rest of the script. So when it runs into the Return command, it will ignore the rest of the script.

 

3: It should read If ( OnActivate == 1 ) not Acrivate :P

 

4: It should be If ( Player -> GetItemCount Fireguard == 1 ) unless it needs to be set so it checks if the player has MORE than one of the item.

 

5: Hmm... maybe put:

 

Player -> AddItem, "IDOfItemYouWantToPickUp" 1

IDOfItemYouWantToPickUp -> Disable

 

That should add it to the player's inventory and make the item disappear from the game world.

Link to comment
Share on other sites

Just do activate... It'd do the same thing as Switch's two lines, but without that iffy self-disable routine.

 

Begin TooHotScrip

 

If ( OnActivate == 1 )

If ( Player->GetItemCount FireGuard == 0 )

MessageBox "The object is too hot to be touched." ;Replace with whatever you want to go here; a game-stopping messagebox would be pretty useless unless you're going to give the PC a choice...

Return ;This won't break the script as it's in a conditional...

Else ;Support for multiple FireGuards... Don't ask.

Activate

EndIf

EndIf

 

; Ahem... Forgetting something? How about we put the script name after End...

 

End TooHotScript

 

Or, if you want to have the message displayed until the PC equips FireGuard, make a short global and put this script on FireGuard...

 

Begin FireGuardEquip

 

If ( OnPCEquip == 1 )

Set GLOBAL_REPLACE to 1 ;Replace GLOBAL_REPLACE with the name of your global

EndIf

 

End FireGuardEquip

 

...and modify TooHotScript like so...

 

Begin TooHotScrip

 

If ( OnActivate == 1 )

If ( GLOBAL_REPLACE == 0 ) ;Same thing, replace GLOBAL_REPLACE with the name of your global

MessageBox "The object is too hot to be touched."

Return

Else

Activate

EndIf

EndIf

 

End TooHotScript

Link to comment
Share on other sites

Just for the sake of completness:

OnPCEquip has to be declared in order to work properly, otherwise you'll get the "EXPRESSION" script error.

Begin FireGuardEquip

Short OnPCEquip

If ( OnPCEquip == 1 )

Set GLOBAL_REPLACE to 1  ;Replace GLOBAL_REPLACE with the name of your global

EndIf

 

End FireGuardEquip

Link to comment
Share on other sites

  • 2 weeks later...

This is a script that I'm working on, and nothing is working, can anyone help me out? The Script is to move a rock down when the Player gets close enough.

 

:help:

Begin OpenRock

 

Short done

float timerspeed

float timer

 

if ( MenuMode == 1 )

return

endif

 

if ( GetDistance, player < 10 )

Set done to 1

endif

 

if ( done < 1 )

return

endif

 

Set timerspeed to 1

 

Set timer to timer + Getsecondspassed

 

if ( Timer >= timerspeed )

PlaySound3DVP "Stone Door Open 1" 1.0, 1.0

Position Z, - 10 Rotate Z, 0

endif

endif

 

if ( Position , ,5418 < 5052 )

Set done to -1

else

Set done to 1

endif

 

end

Link to comment
Share on other sites

Im not sure completely y i does not work but herres for starters...

 

 

1. some of those commands may need to be declared

 

2. change if ( done < 1 ) to if ( done != 1 )

 

3. Im not usre but this doesnt look right ... Position Z, - 10 Rotate Z, 0

i dont thinnk position is a script command (note i may be wrong)

 

 

Thats all that i can see otherwise it should work.

Link to comment
Share on other sites

  • 4 weeks later...

Okay a little problem here, How do I work with GLOBALS I have no idea how to work them and I'm sure its simple but I try to make a script were it does not need to be placed inside of an item.

 

Is this how you make one?

 

Begin ""

 

startscript ""

 

StopScript ""

 

End

 

What do I do? Please answer me!

Link to comment
Share on other sites

global scripts?

 

for a global script, say we have the script "Im_Jimmy"

 

basically you would have a script, or the results of a dialogue that said

StartScript, "Im_Jimmy"

 

then you would have the script:

 

Begin Im_Jimmy

 

short progress

short bla

 

If ( Progress == 1 )

StopScript, "Im_Jimmy"

endif ;this stops the script when you dont need it anymore

 

if ( bla == 1 )

;when done put this:

Set Progress to 1

endif

 

end

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...