Jump to content

New script


Serrieth

Recommended Posts

Begin BellsOrder

 

short Rang

 

if ( Rang < 1 )

if ( OnActivate "active_6th_bell_01t" == 1 )

messagebox "You got the first one, has good sound" "Ok"

Set Rang to 1

PlaySound3D "bell1"

endif

endif

******************************************************************************

if ( Rang == 1 )

if ( OnActivate active_6th_bell_02t == 1 )

messagebox "You may know the first two, but what about the rest?" "Ok"

Set Rang to 2

PlaySound3D "bell2"

endif

elseif ( OnActivate active_6th_bell_02t == 1 )

if ( Rang > 2 )

messagebox "You have chosen in the wrong order try again" "Ok"

Set Rang to 0

endif

endif

******************************************************************************

if ( Rang == 2 )

if ( OnActivate active_6th_bell_06t == 1 )

messagebox "The bells are singing well" "Ok"

Set Rang to 3

PlaySound3D "bell6"

endif

elseif ( OnActivate active_6th_bell_06t == 1 )

if ( Rang >= 3 )

messagebox "You have chosen in the wrong order try again" "Ok"

Set Rang to 0

endif

endif

******************************************************************************

if ( Rang == 3 )

if ( OnActivate active_6th_bell_04t == 1 )

messagebox "Keep going the song is well on its way" "Ok"

Set Rang to 4

PlaySound3D "bell4"

endif

elseif ( OnActivate active_6th_bell_04t == 1 )

if ( Rang >= 4 )

messagebox "You have chosen in the wrong order try again" "Ok"

Set Rang to 0

endif

endif

******************************************************************************

if ( Rang == 4 )

if ( OnActivate active_6th_bell_03t == 1 )

messagebox "The swift sounds are awaking" "Ok"

Set Rang to 5

PlaySound3D "bell3"

endif

elseif ( OnActivate active_6th_bell_03t == 1 )

if ( Rang >= 5 )

 

messagebox "You have chosen in the wrong order try again" "Ok"

Set Rang to 0

endif

endif

******************************************************************************

if ( Rang == 5 )

if ( OnActivate active_6th_bell_05t == 1 )

messagebox "The sounds, you are the one, the Tower of Sun Rise is unlocked." "Ok"

PlaySound3D "bell5"

Playsound3D "Open Lock"

Unlock Ex_BM_tomb_door_Tower

Set Rang to 10 ;makes it so you don't have to repeat the bells

endif

elseif ( OnActivate active_6th_bell_05t == 1 )

if ( Rang >= 6 )

 

messagebox "You have chosen in the wrong order try again" "Ok"

Set Rang to 0

endif

endif

******************************************************************************

 

 

 

end

 

 

As you see above there is a code that you must check. The * just help me space my code out, so if its :huh: confusing, then sorry, okay now I made this code so that you must play 6 bells in a type of order, the order for now is 1 2 6 4 3 5

But when I go into the game the code does not work right. What am I doing wrong?

I made this code up my self, I know its stupid but please help.

Link to comment
Share on other sites

Ok... I may be absolutley wrong here but this may still hold true..... :blush:

 

1] Be careful of instatiating empty/null variables.... does the scripting language perform the initialisation for you?

short Rang

Most languages only recognise this as an instruction to allocate stack space. If it was not initialised, whatever was written to the allocated stack space prior may still be greater than your test value, (eg. some other program wrote 50 to that particular allocation, which was subsequently released and you have now been allocated the same mem space.... this value is now being returned....)

 

Perhaps try initialising Rang to 0...? :huh:

 

Also try simplifying the if test.....

 

eg:if ( Rang == 1 && OnActivate active_6th_bell_02t == 1 )

 

Finally, I note that your first if test is performed with the value "active_6th_bell_01t" in inverted commas, while the rest are not... is this significant?

Link to comment
Share on other sites

intialization???

WTF are you yabbering about

This is the CS, Not C++.

Now I see no problems with the script.

short rang is the only way toi add a variable... like short doOnce..

Link to comment
Share on other sites

Don't worry I found anouther way to make a puzzle, but if you have any suggestions to my code please tell me about them.

 

I still have my eye on this code. It took me too long to do so I want to make sure I can correct it and maybe use it, would be a waste of time if I don't use the code.

Link to comment
Share on other sites

what im thinking is that your script is in a way contradicting it self it says "if ( Rang ==1 ) if (onActivate...==1) endif ;closing just the activate; then it goes to elseif(onactivate) then if (rang>2)

 

basically its saying If (rang == 1) AND If (Rang > 2 ) then do the second stuff...

heres my first suggestion: take each section (after the first and do this)

 

if ( OnActivate active_6th_bell_02t == 1 ) ;moved up to make more clean

if ( Rang == 1 )

Set Rang to 2

messagebox "You may know the first two, but what about the rest?" "Ok"

PlaySound3D "bell2"

endif ;on activate is still up and the Rang ==1 is ended

if ( Rang != 1 ) ; what u had before was ok, but u could have clicked the last 1 first

Set Rang to 0

messagebox "You have chosen in the wrong order try again" "Ok"

endif ; rang != 1 closed

endif ; activate closed

 

this makes the script more effiecent, and at in the present state, well its like this

if i had pressed the first bell, and was looking for the second bell, and pressed the third bell, then nothing would happen and i could continue looking. this way, if i pressed the third bell when it was the second bells turn, i would have to start over. if this is what u want then leave the rang part how it was. and just move the OnActivate up

 

also i would try moving the Set Rang to # to the top, this language is really particular, just try that, and if it still doesnt work come back here and tell me, and ill help u debug it. and if the variable works but the sound doesnt play, move the play sound up also. {to check if the variable worked, type If ( Rang == *what # it should be* ), then it should print a 1 to the console....i think....}

Link to comment
Share on other sites

HELP! I hate this script right now and I do not understand why my game quits out...Can someone please explain why? Okay I have a code see and the code is in an object, ( Book ) and when the player gets the ( book ) the game quits out?

 

here is the code for the object

 

Begin SorinPapers

; this script is to check to see that the player has a crime level that is more than 10

; and checks that the player has had the document for more than three days and returns

;Sorin back to balmora and has a clean up.

 

 

float dayspassed ; number of days passed

float xpos

float ypos

float zpos

short Setup ; Values, 1 Off, 0 On, -1 STOP or Return.

short cleanup ; cleans up the script and sets all of the values to 0 and setup to -1

 

if ( MenuMode == 1 )

return

endif

 

 

if ( Player->Getitemcount ZZ_Sorin_papers >= 1 )

set setup to 0 ;starts script if the player has the papers

else

set setup to -1

endif

 

if ( Setup == -1 )

return

endif

 

if ( Setup == 0 )

Set dayspassed to Day ;every day the dayspassed is added by 1

endif

 

if ( cleanup == 1 )

Set xpos to 0

set ypos to 0

set xpos to 0

set dayspassed to 0 ; returns the days back to 0

set cleanup to 0 ;Stop clean up

set Setup to -1 ;Set the value to STOP unless the PC has added the Documents again

StopScript SorinPapers

endif

 

 

if ( GetPCCrimelevel > 10 )

Player->removeitem ZZ_Sorin_Papers 1

messagebox "Your crime level is higher than 10, the third law says that this document must be terminated." "Ok"

set xpos to ( -21272.232 ) ; X

set ypos to ( -17021.928 ) ; Y

set zpos to ( 550.000 ) ; Z

Removeitem ZZ_Bodyguard 1

Placeitem "ZZ_Bodyguard" xpos, ypos, zpos 0 ; Places Sorin in Balmora

Set cleanup to 1 ;Start cleanup

Set setup to 1 ;Stops counting the days

endif

 

if ( dayspassed > 3 )

Player->removeitem ZZ_Sorin_Papers 1

messagebox "Sorry but your three days are up, sorin has returned to balmora and the papers are terminated." "Ok"

set xpos to ( -21272.232 ) ; X

set ypos to ( -17021.928 ) ; Y

set zpos to ( 550.000 ) ; Z

Removeitem ZZ_Bodyguard 1

Placeitem "ZZ_Bodyguard" xpos, ypos, zpos 0 ; Places Sorin in Balmora

set Setup to 1 ;stop the days counting

set cleanup to 1 ; starts clean up

endif

 

 

end

 

This is for my Sorin bodyguard mod, I'm fixing it and making it better. Since I got lots of complaints that there were errors of the game crashing or they could not find sorin or they could not find the topic to hire sorin as a bodyguard. But thats beside the point. I neeed help :angry2:

Link to comment
Share on other sites

Okay never mind for the Reply above I found a way to fix it, here it is :blush:

 

I moved the Menu Mode to the top and made the line Set dayspassed to dayspassed + Day ;every day the dayspassed is 1 ? but the time of days is 3 count

 

Begin SorinPapers

; this script is to check to see that the player has a crime level that is more than 10

; and checks that the player has had the document for more than three days and returns

;Sorin back to balmora and has a clean up.

 

 

if ( MenuMode == 1 )

return

endif

 

float dayspassed ; number of days passed

float xpos

float ypos

float zpos

short Setup ; Values, 1 Off, 0 On, -1 STOP or Return.

short cleanup ; cleans up the script and sets all of the values to 0 and setup to -1

 

 

if ( Player->Getitemcount ZZ_Sorin_papers >= 1 )

set setup to 0 ;starts script if the player has the papers

else

set setup to -1

endif

 

if ( Setup == -1 )

return

endif

 

if ( Setup == 0 )

Set dayspassed to dayspassed + Day ;every day the dayspassed is added by 1

endif

 

if ( cleanup == 1 )

Set xpos to 0

set ypos to 0

set xpos to 0

set dayspassed to 0 ; returns the days back to 0

set cleanup to 0 ;Stop clean up

set Setup to -1 ;Set the value to STOP unless the PC has added the Documents again

StopScript SorinPapers

endif

 

 

if ( GetPCCrimelevel > 10 )

Player->removeitem ZZ_Sorin_Papers 1

messagebox "Your crime level is higher than 10, the third law says that this document must be terminated." "Ok"

set xpos to ( -21272.232 ) ; X

set ypos to ( -17021.928 ) ; Y

set zpos to ( 550.000 ) ; Z

Removeitem ZZ_Bodyguard 1

Placeitem "ZZ_Bodyguard" xpos, ypos, zpos 0 ; Places Sorin in Balmora

Set cleanup to 1 ;Start cleanup

Set setup to 1 ;Stops counting the days

endif

 

if ( dayspassed > 3 )

Player->removeitem ZZ_Sorin_Papers 1

messagebox "Sorry but your three days are up, sorin has returned to balmora and the papers are terminated." "Ok"

set xpos to ( -21272.232 ) ; X

set ypos to ( -17021.928 ) ; Y

set zpos to ( 550.000 ) ; Z

Removeitem ZZ_Bodyguard 1

Placeitem "ZZ_Bodyguard" xpos, ypos, zpos 0 ; Places Sorin in Balmora

set Setup to 1 ;stop the days counting

set cleanup to 1 ; starts clean up

endif

 

 

end

 

But I have another problem!!!!!!!!!!! The day and dayspassed don't seem to work right. As you see in...

(Set dayspassed to dayspassed + Day ;every day the dayspassed is 1?)

the game will then see to that dayspassed then == 3 or more and restarts the script as its suppost to do, but there are suppost to be three days count to have the bodyguard?! :huh:

My question is, how do I make a timer that goes with the days? :help: :help:

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