Jump to content

Need help with a onDeath script


CarnivalOfFear

Recommended Posts

Im trying to get this script working I want the NPC dying to trigger a quest event. right now the script wont even save because theres something wrong with it :/

 

scn 00silverrushDeathSCRIPT

begin onDeath 00VangraphContact

    if getStage 00expanding = 10
        setStage 00expanding 15
    if getStage 00expanding = 15
        setStage 00expanding 20
  endif

end

 

any ideas?

Link to comment
Share on other sites

First off, stop using editor ids with numeric beginnings. Scripts get confused trying read editor ids and references with "000" at the beginning.

 

At least, that's from my experience. I may be wrong here.

Link to comment
Share on other sites

Second, Use if/elseif/endif

or if/endif if/endif

you have if/if/endif thats not gonna work.

 

Also, Don't do:

 

if (x == 0)

set x to 10

elseif (x == 10)

set x to 20

endif

 

Because geck seems so stupid as to execute both. (Could be wrong but seems many of my scripts have been broken by that), X will go from 0 to 20 in one execution of the script. (Elseif seems to be equivilent of endif, if)

 

if (x == 10)

set x to 20

elseif (x == 0)

set x to 10

endif

 

Works, as X will never be set to a value that has not yet been tested for. (its 'backwards')

Edited by Cyberlazy
Link to comment
Share on other sites

my coding knowledge is limited so sorry if I get this wrong. so it should look like so?

 

EDIT: else if doesn't seem to want to save so I changed it to endif.

 

scn 00DeathSCRIPT

begin onDeath
if getStage expanding00 == 20
  setStage expanding00 30


endif

if getStage expanding00 == 10
  setStage expanding00 20
endif
end

Edited by CarnivalOfFear
Link to comment
Share on other sites

does the "return" function still work for GECK scripting? It did for Oblivion....because if so, that might make your if statements simplistic as you could just terminate the entire script process once one value is true. But that might now apply here, dunno.
Link to comment
Share on other sites

my coding knowledge is limited so sorry if I get this wrong. so it should look like so?

 

EDIT: else if doesn't seem to want to save so I changed it to endif.

 

scn 00DeathSCRIPT

begin onDeath
...
end

 

Well, I copied and pasted your script into the Geck and it didn't save. Then I remembered I didn't create a quest called expanding00, so I went and did that. Then I copied and pasted your script again and it saved. Having the script name start with 00 is still, as Jeux mentioned, a bad idea. Also try using Geck PowerUp which can show script errors.

 

In summary:

 

1. Create your references (e.g. expanding00) before you use them in your scripts.

2. Don't use numbers at the beginning of any names of things you create.

3. (Optional) Use add ons like Geck PowerUp or Cipsis's Script Validator.

Link to comment
Share on other sites

my coding knowledge is limited so sorry if I get this wrong. so it should look like so?

 

EDIT: else if doesn't seem to want to save so I changed it to endif.

 

scn 00DeathSCRIPT

begin onDeath
...
end

 

Well, I copied and pasted your script into the Geck and it didn't save. Then I remembered I didn't create a quest called expanding00, so I went and did that. Then I copied and pasted your script again and it saved. Having the script name start with 00 is still, as Jeux mentioned, a bad idea. Also try using Geck PowerUp which can show script errors.

 

In summary:

 

1. Create your references (e.g. expanding00) before you use them in your scripts.

2. Don't use numbers at the beginning of any names of things you create.

3. (Optional) Use add ons like Geck PowerUp or Cipsis's Script Validator.

 

I got the script working and ill keep the 00 thing in mind. every tutorial i've watched they always use 00 to place it at the top of the list for east access but AA should also work.

Link to comment
Share on other sites

Instead of prefixing forms with "00" or "aaa" as most do, just expand the Form ID column (to the right of the Editor ID column) so that it is visible and click it to sort by Form ID. In descending order, all of your forms will be on the top of the list because they have the highest Form ID.
Link to comment
Share on other sites

  • Recently Browsing   0 members

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