Jump to content

Spawning mob on trigger?


GermainZ

Recommended Posts

Sinderion, tried your script, here's what I got:

IsDead is not a property on script objectreference or one of its parents

Enable is not a property on script objectreference or one of its parents

 

I've also tried defining it first, didn't work:

ObjectReference linkedRef1 = self.GetNthLinkedRef(1)

if linkedRef1.IsDead

self.GetNthLinkedRef(4).Enable

endif

Link to comment
Share on other sites

Ah, that would probably work.

 

Can I do something like this instead (I'm using Enc actors, so I suppose it's fine to place this script on each one of them)

 

Event OnDeath(Actor akKiller)
      IncrementDeathCount()
      ;3 is the number of enemies in this wave
      if DeathCount > 3
            DeathCount = 0
            Debug.Trace("Next wave in 20 seconds; it will not begin until you re-enter")
            Utility.Wait(20)
            ;this will keep checking until the player is positioned in the room (i used random values, but you get the point)
            while not(50<Game.GetPlayer().GetPositionY()<60) and not(50<Game.GetPlayer().GetPositionX()<60)
            endwhile
            XMarker2.Enable
      endif
endEvent

 

 

I probably got the variables wrong, as well as some syntax errors inspired by basic. I'd be grateful for anyone who could fix the script, if it's actually a reasonable way.

Edited by GermainZ
Link to comment
Share on other sites

I decided to just F it and do it up right. I've been working with encounters a lot for my thieves mod I'm gonna be putting out here shortly anyways. I've got a great script going, it works flawlessly to two phases and threw me a curveball for the third. Could be that I set up the objects wrong, I have a feeling it's in my basic math logic though lol. It's probably obvious right in the script we'll see. I've been messing with it longer than I should have already lol I've gotta go for now, here it is if there's something obvious wierd. For some reason my current phase variable ends up 4, when it should be 3 for phase 3, and after the three adds from phase 2 are dead, the phase two portcullis is activated for some reason, as if it's trying to activate phase 2 again. Maybe this is what happens when you call GetNthLinkedRef(4) when there are only three? oooh crap.. I just realized it's cause i was marking phases starting at 1, but the nthlinkedref function starts at 0. Ok I'm a dumbass, but I don't have time to retest it just now, here's the unmodified version. Follow instructions at the top if you want to test it out, I was commenting on the go, hope it's not to vague. Adds are initially disabled as well of course, In step 1 "point to" means set the script property of the helper script attached to an add to point to:

 

 

  Reveal hidden contents

 

 

Nice and generic and widely usable. Not a quest involved at all. So long as it ends up working I think I like it :D

Link to comment
Share on other sites

Not updating it just now, will later today quite possibly. Will add:

 

- Optional delay, since you seemed to want that

- Error checking.

- Maybe or maybe not, automatically counting adds (so you don't have to set it on the phasemarkers, less chance for configuring to go wrong.)

 

... and unless there's anything else I can think of that should do it for this type of encounter. You can do your next room thing... in the next room...

 

If you wanted the fourth door to close on trigger, just set the 4th door to open by default, and set the main start trigger to it's activate parent too. Obviously set this fourth door as the VictoryActivator of the first PhaseMarker (the one activated by the trigger) since that's what that properties for, the door to leave. Since you're using a nice bethesda defaultactivateself trigger, it will only activate once if you don't change that setting. no worries about it opening and closing the door and stuff.

 

This is making me want to work towards a .esm encounter pack modders resource lol, between this and my pickpockets world encounters thing I'm finishing up. I've got a few things to do before that though lol. This is just a nice exercise/distraction :D

Link to comment
Share on other sites

        if iCurrentPhase <= iNumberofPhases
               iCurrentPhase += iCurrentPhase
               Debug.Notification("Phase " + iCurrentPhase + " incomming!")
               ;update current phase marker    

 

What the hell? just what the hell? Why did I make iCurrentPhase += iCurrentPhase... wth lol. Yeah i was very tired. It's supposed to be iCurrentPhase += 1.

 

That was the entire problem... It may work if you fix that part, or I may need to move that line back out of the if statement where it was. If the debuf notification is to display the correct phase, it needs to have (iCurrentPhase -1) instead of just iCurrentPhase in it, that is how I had it before I started having problems.

Link to comment
Share on other sites

I can't thank you enough.

I've read the script and managed to understand most of it. I will read it again ASAP, although I probably won't be able to test it till Friday.

Thanks again, will reply (either by normal reply or PM, if this post is too deep to bump) once I test it.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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