Jump to content

icecreamassassin

Premium Member
  • Posts

    1114
  • Joined

  • Last visited

Everything posted by icecreamassassin

  1. So I am setting up a simple blacksmithing script. When the anvil is activated it asks if you want to make weapons or armor, then asks you what material you'd like to use and finally what type of weapon or armor you want to make. I have a message box block set up for the first menu, and one for the weapon material, one for armor material, one for weapon selection and one for armor selection. The problem is that The first menu executes no problem, I click the option desired (weapon/armor/cancel all work fine) they bring up the proper second menu but when I select any option it just refreshes that menu. Cancel also does not work on the second menu and I can't get it to progress to the third menu. Here's the code ScriptName CRAnvilscript short button short controlvar short material begin onactivate Messagebox "What do you wish to make?" "Weapon" "Armor" "Cancel" set controlvar to 1 end Begin GameMode if (controlvar == 1) ; crafting choice set button to getbuttonpressed if button == 0 ; weapon set controlvar to 10 ; weapon materials elseif button == 1 ; armor set controlvar to 20 ; armor materials elseif button == 2 ; cancel set controlvar to 0 ; restart endif elseif controlvar == 10 ; weapon material choice messagebox "What material would you like to use?" "Iron" "Steel" "Cancel" set button to getbuttonpressed if button == 0 ; iron set controlvar to 11 ; weapon menu set material to 1 elseif button == 1 ; steel set controlvar to 11 ; weapon menu set material to 2 elseif button == 2 ; cancel set controlvar to 0 return endif elseif controlvar == 11 ; weapon choice messagebox "What weapon would you like to make?" "Dagger" "Short sword" "Cancel" set button to getbuttonpressed if button == 0 ; dagger set controlvar to 0 if material == 1 player.additem WeapIronDagger 1 elseif material == 2 player.additem WeapSteelDagger 1 endif elseif button == 1 ; short sword set controlvar to 0 if material == 1 player.additem WeapIronShortsword 1 elseif material == 2 player.additem WeapSteelShortsword 1 endif elseif button == 2 ; cancel set controlvar to 0 set button to -1 set material to 0 return endif elseif controlvar == 20 ; armor material messagebox "What material would you like to use?" "Iron" "Steel" "Cancel" set button to getbuttonpressed if button == 0 ; iron set controlvar to 21 ; armor menu set material to 1 elseif button == 1 ; steel set controlvar to 21 ; armor menu set material to 2 elseif button == 2 ; cancel set controlvar to 0 return endif elseif controlvar == 21 ; armor choice messagebox "What armor would you like to make?" "Helm" "Gauntlets" "Cancel" set button to getbuttonpressed if button == 0 ; Helm set controlvar to 0 if material == 1 player.additem Ironhelmet 1 elseif material == 2 player.additem Steelhelmet 1 endif elseif button == 1 ; gauntlets set controlvar to 0 if material == 1 player.additem Irongauntlets 1 elseif material == 2 player.additem Steelgauntlets 1 endif elseif button == 2 ; cancel set controlvar to 0 set button to -1 set material to 0 return endif endif end
  2. So I'm trying to create a day timer that will trigger a quest stage after 30 days. So far this is what I have, and it all appears to function properly from a script error stance, but it doesn't seem to trigger after the desired number of days pass. Basically you get a loan from a banker, it sets a script variable at the same value as the current gameday and then has another variable which is the same value +30 (indicating the 30 days later) and when the gameday timer is equal or more than this second timer, it triggers the next stage of a quest. Scriptname CRbankloanscript short repayday short loanstart Begin GameMode if CRbankloanamount > 1 ; this passes as true when the loan is opened and the global variable is set to the loan amount if loanstart == 0 ; passes if this section hasn't run yet set loanstart to gameday ; sets the variable to the current gameday value (hence making the previous step fail in the future) set repayday to loanstart +30 ; variable is set as the current gameday value +30 (the day that the loan must be repaid by) endif endif if loanstart > 0 ;passes if the above section executes if gameday >= repayday ;when the game's built in gameday timer meets or exceeds the variable set in the last block setstage CRbankaccount 20 ;sets the stage of the quest which puts the global variable at -1 and sets a bounty for the loan amount endif endif if CRbankloanamount == 0 ;if the loan is repaid properly or no loan has ever been opened the two variables for the above blocks will remain at 0 set loanstart to 0 set repayday to 0 endif end So any insight? what am I missing here?
  3. I figured it out. I don't know WHY it was doing what it was doing but I realized the only issue I was having was because of the IF check for the current conjuration level of the player that I added and I just wasn't blocking each segment of the code with the conditional. Anything that was coded improperly would cause the effects to default to the player. I ended up even causing myself to teleport to the storage cell in troubleshooting. I did just end up making the creatures leveled using the PC offset feature instead and it works perfectly. Basically I have 6 scripts tied to a spell which at conjuration 0-25 summons a skeleton warrior and a skeleton archer, at 50 you get an additional warrior, at 75 you get one more archer and 1 more warrior, and at 100 you get a lich as well. So yay, all is well :)
  4. I'm actually not currently using the OBSE and there should be a simple fix for this using the core code but I can't seem to figure out where the glitch is. I've stripped the code down to the original script and now I have even more troubles :P now the leveled creature (only 1) which I summon does not reset when I cast the spell again, and if it's killed it cannot be resummoned. Plus I still have my original problem of dying at the spell's expiration Ok So I went back to square 1 and used the script as it was provided on the TESCS wiki site. It seems that the player death bug happens when the creature is a leveled monster for some reason. Also the only other remaining bug is that the spell timer remains even after all the creatures are killed, which is a minor concern since I no longer seem to DIE after it does go away :) Anyways any insight as to why a summoned creature reference would cause this? I think I may just mod the base creature to level with the player instead of using a leveled creature marker and see if that solves it. I think it has something to do with randomly generating instances of a leveled creature, it must loose the refID somehow and default to the player which causes the death (my guess at this point at least)
  5. I'm actually not currently using the OBSE and there should be a simple fix for this using the core code but I can't seem to figure out where the glitch is. I've stripped the code down to the original script and now I have even more troubles :P now the leveled creature (only 1) which I summon does not reset when I cast the spell again, and if it's killed it cannot be resummoned. Plus I still have my original problem of dying at the spell's expiration
  6. Follow this tutorial from the CS Wiki. Granted, this only tells you how to summon one creature, but if you make five creatures and five summon scripts (one for each creature), you can put all five summon scripts into one spell. I've tried this and it works. Maigrets used the same technique for her Vampire Bats mod. I am trying something similar using the summoned creature tutorial and basically expounded upon it by making the script summon multiple creatures instead (just doubling up on each section, adding extra short variables, etc) All seems to work ok, but when the spell wears off (which continues past their death for some reason) the script kills me rather than the reference of the creature. Here is what I have: ScriptName CRmasterofskullsscript float timer float fade short playonce short playonce2 short playonce3 ref SUMN ref SUMN2 ref SUMN3 Begin ScriptEffectStart ;Set temp reference for scripting. ;Allows faster transition of script as template. Also allows for leveled summon. set SUMN to CRskeleton003 set SUMN2 to CRskeleton004 set SUMN2 to CRskeleton005 ;Reset our creature if re-summoned before time runs out on spell SUMN.disable SUMN2.disable SUMN3.disable ;Now we move our creature to the Player ;Move the creature reference to the worldspace of the Player SUMN.moveto Player 30 30 10 SUMN2.moveto Player 0 30 10 SUMN3.moveto Player 30 0 10 ;Make our creature visible and active SUMN.enable SUMN2.enable SUMN3.enable set fade to 1 ;Resets the alpha fade variable to 1 End Begin ScriptEffectUpdate if ( timer > 30 ) ;Creature is dead and fade timer passed ;Move our creature back to it's holding cell SUMN.kill SUMN2.kill SUMN3.kill SUMN.moveto CRskeletonroomcenter 0 0 10 SUMN2.moveto CRskeletonroomcenter 0 10 10 SUMN3.moveto CRskeletonroomcenter 10 0 10 ;Reset our creature if dead SUMN.resurrect SUMN2.resurrect SUMN3.resurrect ;Set our creature to an unprocessed state SUMN.disable SUMN2.disable SUMN3.disable endif ;Adjust timer state for early fade/disable upon death if ( SUMN.getdead == 1 ) && ( timer < 28 ) set timer to 28 endif if ( SUMN2.getdead == 1 ) && ( timer < 28 ) set timer to 28 endif if ( SUMN3.getdead == 1 ) && ( timer < 28 ) set timer to 28 endif if ( timer > 0.1 ) && ( playonce == 0 ) ;Play effect for creature entrance SUMN.pms effectSummonMythicDawn 1 set playonce to 1 endif if ( timer > 0.1 ) && ( playonce2 == 0 ) ;Play effect for creature entrance SUMN2.pms effectSummonMythicDawn 1 set playonce2 to 1 endif if ( timer > 0.1 ) && ( playonce3 == 0 ) ;Play effect for creature entrance SUMN3.pms effectSummonMythicDawn 1 set playonce3 to 1 endif ;Increment timer set timer to timer + GetSecondsPassed if ( timer > 28 ) && ( playonce == 1 ) ;Play effect for creature exit/death SUMN.kill set playonce to 2 endif if ( timer > 28 ) && ( playonce2 == 1 ) ;Play effect for creature exit/death SUMN2.kill set playonce2 to 2 endif if ( timer > 28 ) && ( playonce3 == 1 ) ;Play effect for creature exit/death SUMN3.kill set playonce3 to 2 endif if ( playonce == 2 ) ;Fade creature for exit/death set fade to fade - 0.03 SUMN.saa fade endif if ( playonce2 == 2 ) ;Fade creature for exit/death set fade to fade - 0.03 SUMN2.saa fade endif if ( playonce3 == 2 ) ;Fade creature for exit/death set fade to fade - 0.03 SUMN3.saa fade endif End Begin ScriptEffectFinish ;Move our creature back to it's holding cell SUMN.moveto CRskeletonroomcenter 0 0 10 SUMN2.moveto CRskeletonroomcenter 0 10 10 SUMN3.moveto CRskeletonroomcenter 10 0 10 ;Reset our creature if dead SUMN.resurrect SUMN2.resurrect SUMN3.resurrect ;Set our creature to an unprocessed state SUMN.disable SUMN2.disable SUMN3.disable End Any ideas what the script is killing me? On a side note, only one or the other of CRskeleton004 or CRskeleton005 is summoned, and not both, but CRskeleton003 summons just fine. I am thinking that somehow the script tags the player as CRskeleton004 for instance (or 005 maybe) and when the script runs out, it kills that reference (i.e. the player) I would expect though that maybe it should warp me to the holding cell but I guess that gamemode instantly stops upon the player death and hence the script comes to a screeching halt. I'm gonna play with it a bit and see what's what
×
×
  • Create New...