Jump to content

More Scripting Questions


Recommended Posts

I am making a mod that relies on the 'getdead', and that command works perfectly fine, except that i want to then move the creature that is dead, respawn it, and leave it there with the same id as it had before i killed it the first time

 

so basically (this is not my actual script(No Previews except for my BETA testers))

 

scn script

 

short var1

short var2

 

 

Begin Gamemode

(TAB)if var1 == 1 && creature1.getdead == 1

(TAB) (TAB) set var2 to 1

(TAB) (TAB) Creature2.moveto TargetRat1

(TAB) (TAB) Creature3.moveto TargetRat2

(TAB) (TAB) Creature4.moveto TargetRat3

(TAB) endif

end

What the problem is, that i have this script that works perfectly the first time, but when i go and try to redo the quest(it is a repeatable quest), all of the creatures are allready dead, and located in the place where the TargetRats are located

 

so, problems to address

 

1) Move the dead creatures back to where they came from

2) Revive the dead creatures when they get back where they came from

3) Keep their original Id's(not sure if this is an issue or not, just want to address it now, so that i don't run into problems later)

 

Thanks in Advance for your help

 

Nevermind, it works, albeit kinda messed up, i forgot to put a doonce in there, so when i killed it, it disappeared just long enough for the script to run, then... it was back, no big deal, i fixed that problem too

Edited by GODSBANE123456
Link to comment
Share on other sites

The repeatable stages flag doesn't work, and the cell where this all happens may need to be respawned before you see anything differently. I'm not quite sure what you're wanting to do, but your script looks wrong in that you have two variables, one as a condition and another as something which is not being used within this script.
Link to comment
Share on other sites

I'm not completely sure what you're wanting, either, but this will resurrect your creature and move it to the location you want:

 

ScriptName Script

 

short Revive

short Start

 

if Revive == 0 && Start == 1 && GetStage (yourquest) == 100 && creature1.GetDead == 1

creature1.Resurrect

creature1Ref.MoveTo TargetRef

Set Revive to 1

Set Start 0

 

else

if Start == 0 && GetStage (yourquest) == 10

Set Revive to 0

Set Start to 1

 

End

 

Adjust it according to your quest, though.

 

Edited the code.

Edited by ijarofjami
Link to comment
Share on other sites

essentially, i have will have 40 stages to this script (i know, but it won't slow down the fps too noticably becuase there is nothing else to slow down fps in the cells that the script occurs)

 

stage 2 cannot happen unless stage 1 is complete, every stage includes timers, so i end up with 5 different variables for each stage each of which i will have to set back to 0 at the end of the quest so that it can be repeated, so that is how i got around the repeatable quest deal

 

the only problem that i have now, is that i had set in a new variable in each stage to keep the stage from repeating, and now they won't appear at all, although it kinda worked before, except that when one died, it got moved back to the creaturehouse, then got moved back to the targetrat, in a never ending process... ill just post 2 stages of my script, and change around the refid's a bit

 

 

The new varialbe would be Onetime#

 

Begin gamemode

(TAB)if level1 == 1 && onetime1 == 0

(TAB)(TAB) if doonce1 == 0

(TAB)(TAB)(TAB) set timer1 to 5

(TAB)(TAB)(TAB) set doonce1 to 1

(TAB)(TAB) endif

(TAB)(TAB) if timer1 > 0

(TAB)(TAB)(TAB) set timer1 to timer1 - getsecondspassed

(TAB)(TAB) else

(TAB)(TAB)(TAB) setstage Quest 11

(TAB)(TAB)(TAB) set level2 to 1

(TAB)(TAB)(TAB) ACLevel1Creature.moveto ACTargetRatBlue

(TAB)(TAB) endif

(TAB)(TAB) set onetime1 to 1

(TAB) endif

end

 

Begin gamemode

(TAB) if level2 == 1 && ACLevel1Creature.getdead == 1 && onetime2 == 0

(TAB)(TAB) ACLevel1Creature.resurrect

(TAB)(TAB) if doonce2 == 0

(TAB)(TAB)(TAB) set timer2 to 5

(TAB)(TAB)(TAB) set doonce2 to 1

(TAB)(TAB) endif

(TAB)(TAB) if timer2 > 0

(TAB)(TAB)(TAB) set timer2 to timer2 - getsecondspassed

(TAB)(TAB) else

(TAB)(TAB)(TAB) setstage Quest 12

(TAB)(TAB)(TAB) set level3 to 1

(TAB)(TAB)(TAB) ACCreatureLevel2a.moveto ACTargetRatBones

(TAB)(TAB)(TAB) ACCreatureLevel2b.moveto ACTargetRatYellow

(TAB)(TAB)(TAB) ACCreatureLevel2c.moveto ACTargetRatGate

(TAB)(TAB) endif

(TAB)(TAB) ACLevel1Creature.moveto ACCreatureHouseRat

(TAB)(TAB) set onetime2 to 1

(TAB) endif

end

 

I posted stages 1 and 2, all other stages are a copy of stage 2, just with the refid's and the variables changed.

Link to comment
Share on other sites

I think that i have found my problem, but i cannot test it while at work, i will have to wait until i get back to a more suitable computer, but i do believe that the problem lies in where i have the set onetime1 in the wrong location, I THINK that it should be llocated in the else, not after the endif after the else.
Link to comment
Share on other sites

  • Recently Browsing   0 members

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