Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

Some issues in my mod


BadCompany
 Share

Recommended Posts

okay, 1st:

I have my triggerzone set up like this. Under the "Enable Parent" tab i have an "initially disabled" creature as the linked reference.

The triggerzone has the following script on it:

scn VmpTrigZoneSpook02SCRIPT

; Activates linked Parent object once


short triggered

ref target


begin onTrigger player

        if triggered == 0

                set triggered to 1

                set target to getParentRef

                target.enable

        endif

end
Unfortunately the trigger doesn't seem to work. I walk past the trigger and the creature isn't enabled. Any ideas as to why? Should the "Dangerous" box be checked in the activator menu-box of triggerzone? Should the triggerzone lay horizontal rather than vertical? 2ndly: I have the following script on a custom zombie:
scn GoreFakeDeathScript


short Trg

short Spl

short Ply

short Fee

short Dist


begin onLoad


     if Spl != 57

           kill

           set Spl to 57

     endif


end


begin gameMode


     if Trg != 30

          set Fee to getRandomPercent

               set Dist to ((Fee *9)+50)

          set Trg to 30

     endif

     if (Ply != 57 && getDistance Player < Dist) || (getAttacked == 1)

               PlaySound NPCZombieAware

               resurrect 1

               forceav aggression 100

               startCombat Player

           set Ply to 57

     endif


end

how do i make it so that the player has to be right next to the zombie for it to rise? Currently the zombie seems to rise even if it's like 20ft away. I want it to only rise if the player is like a foot away or less.

And on a side note:

how do i make a custom climate always be nighttime? Do i just set all sunrise/sunset time to default?

Link to comment
Share on other sites

For the trigger zone:

Since you made a disabled object a parent reference it could cause some problems. Try removing the creature from the parent object on the trig zone, and instead make the creature a persistent reference with a reference ID. Now instead of:

set target to getParentRef

target.enable

Try this instead:

[referenceID].enable

I never really trusted getParentRef, I always just used the reference ID and just enabled it in my scripts.

For the zombie:

You put the code for determining how close the player has to be for the zombie to rise as:

set Fee to getRandomPercent

set Dist to ((Fee *9)+50)

Well, with this it is possible to have Dist have a value of 941, which is much more than a foot in-game. So try setting Dist to a static value instead of doing random percents. A foot in game units is roughly 20.3.

Not sure about your climate question.

Link to comment
Share on other sites

1. Since the trigger zones parent is disabled, the trigger zone will be disabled as well. So, effectively it does not exist in the game. You can code it like Critterman said.

2. Some notes: Just my musings on trying to read other peoples scripts.

Does '57' have some special meaning? I know for me, 0 means not executed, 1 means it has executed. It looks like you are using 0 and 57. XD The same is true with '30' for Trg.

The varible names are short, but difficult to understand and follow.

Since you set the distance they 'resurrect' once per creature, the distance will be anywhere between 59 and 941 units. That would be about 3 feet all the way out to 47 feet distance. If you want a set distance, then remove the randomness and use a hard coded value.

3. The climate question might get a better answer in the world building forum. but, you basically set the 'daylight' hours to about a minute in time. Something like that, I am not sure since I never did it.

Link to comment
Share on other sites

  • 2 weeks later...

okay, i have another issue :dizzy:

i'm want my npc to transform on knockout and disintegrate on death. The 1st part works, but some reason she wont burst into flames upon death:

scn VmpGoreNPCVampTransformScript


ref Self

short dooncefient

short doonceDeath

float timer

short stage

float disablecounter


Begin OnLoad


    set self to GetSelf

    set dooncefient to 0

    set DoonceDeath to 0

    set timer to 3

    set stage to 0


End


Begin GameMode


Set Self to GetSelf


    if dooncefient == 1

        if timer > 0

            set timer to timer - GetSecondsPassed

        else

; Tweak DisableCounter and its checks to adjust effect lengths....


            if Stage == 0

                PlayMagicShaderVisuals effectDrain

                playsound VmpGoreVampireHiss

			additem GoreCrimsonQueenChest 1

          	additem GoreCrimsonQueenFeet 1

			additem GoreCrimsonQueenHands 1

			additem GoreCrimsonQueenHead 1

			additem GoreCrimsonQueenLegs 1

			additem GoreWeapEbonyLongsword 1

               Set Stage to 1

               Set DisableCounter to 11

            elseif Stage != -1

                Set DisableCounter to ( DisableCounter - GetSecondsPassed )

                if ( Stage == 1 )

                    if ( DisableCounter <= 10 )

                        set stage to 2

                        equipitem GoreCrimsonQueenChest 1

                        equipitem GoreCrimsonQueenFeet 1

				    equipitem GoreCrimsonQueenLegs 1

				    equipitem GoreCrimsonQueenHead 1

				    equipitem GoreCrimsonQueenHands 1

				    equipitem GoreWeapEbonyLongsword 1

                        PlayMagicShaderVisuals effectSummonMythicDawn

                    endif

                elseif ( stage == 2 )

                    if ( DisableCounter <= 9 )

                        StopMagicShaderVisuals effectDrain

                        set stage to 3

                    endif

; This shuts off the effects so they don't last forever

                elseif ( stage == 3 )

                    if ( DisableCounter <= 4 )

                        StopMagicShaderVisuals effectSummonMythicDawn

			RemoveSpell VmpGoreRessurect

			SetEssential GoreTzimitzeVamp 0

                        Set Stage to -1

                        set dooncefient to 0


    elseif dooncedeath == 1

        if timer > 0

            set timer to timer - GetSecondsPassed

        else

; Tweak DisableCounter and its checks to adjust effect lengths....


            if Stage == 0

                PlayMagicShaderVisuals effectAtronachFlame

                playsound VmpGoreVampireDeadSound

                playsound VmpGoreVampireHiss

			 additem VmpGoreDeadVampireSkeleton 1

                additem VmpGoreDeadVampireSkull 1

                Set Stage to 1

                set DisableCounter to 11

            elseif Stage != -1

                Set DisableCounter to ( DisableCounter - GetSecondsPassed )

                if ( Stage == 1 )

                    if ( DisableCounter <= 10 )

; Burning effect gets replaced by the "Blade" effect

                        set stage to 2

                        equipitem VmpGoreDeadVampireSkeleton 1

                        equipitem VmpGoreDeadVampireSkull 1

                        StopMagicShaderVisuals effectAtronachFlame

                        PlayMagicShaderVisuals VmpGoreDeadShaderFire

                    endif

                elseif ( stage == 2 )

; This determines when the "Blade" effect gets replaced by the smoldering effect....

                    if ( DisableCounter <= 9 )

                        StopMagicShaderVisuals VmpGoreDeadShaderFire

                        PlayMagicShaderVisuals VmpGoreDeadShaderSmoke

                        set stage to 3

                    endif

; This shuts off the smoking effect... ( So they don't smoke forever... )

                elseif ( stage == 3 )

                    if ( DisableCounter <= 0 )

                        StopMagicShaderVisuals VmpGoreDeadShaderSmoke

                        Set Stage to -1

                        set dooncedeath to 0

                    					endif

                					endif

            					endif

       	 				endif

    					endif

                    endif

                endif

            endif

        endif

    endif


End


Begin OnKnockout


	set dooncefient to 1

	AddSpell VmpGoreRessurect

	AddSpell VmpGoreVampDeath

	AddSpell VmpGoreBuff


End


Begin OnDeath


	Setstage VmpGoreCrimsonQueen 10

        set DoonceDeath to 1


End

any ideas?

Link to comment
Share on other sites

I see a few things that might be the problem here:

1. You are missing a lot of endifs in the "if dooncefient == 1" part of your script. You need an endif for the "if timer > 0", "if Stage == 0", and "if DisableCounter <= 4" conditions. Having endifs in the wrong place can really screw code up.

2. Your script may not work if the npc is knocked out first and then killed. You use the same timer variable in the "if dooncedeath == 1" part as the "if dooncefient == 1" part. Either use a different variable in the second part (like timer2) or set timer to 3 again once your done with "if dooncefient == 1" . You also need to reset the Stage variable after the "if dooncefient == 1" part or once you get to "if dooncedeath == 1" you will skip over everything since Stage is still -1. Note: your onLoad block resets all the variables correctly, so if you have a load happen after you knock the npc out and before you kill him then everything will be okay.

3. Are you sure the "if dooncedeath == 1" part is even running? To make sure, I always use PrintC (or message with vanilla scripting) to see whether it is running when I'm playtesting. I suggest you do the same to see exactly where the code goes wrong. I've never used the effectAtronachFlame shader so I'm not sure if that is why you don't see any flames. I usually use effectFireDamage, so if all the sounds are playing but not the flames try that.

Just get used to using debug messages in your script to help you understand what is running and what is not. For complex scripts its really hard to spot mistakes simply by looking at the code. Debug messages (PrintC and Message in certain if blocks and begin blocks) really help you when the script is not working :dizzy:

Link to comment
Share on other sites

well i tried to fix it up like so :

scn VmpGoreNPCVampTransformScript


ref Self

short dooncefient

short doonceDeath

float timer

short stage

float disablecounter


Begin OnLoad


    set self to GetSelf

    set dooncefient to 0

    set DoonceDeath to 0

    set timer to 3

    set stage to 0


End


Begin GameMode


Set Self to GetSelf


	if dooncefient == 1

        	if timer > 0

            	set timer to timer - GetSecondsPassed

		endif

        else

; Tweak DisableCounter and its checks to adjust effect lengths....


		if Stage == 0

                	PlayMagicShaderVisuals effectDrain

                	playsound VmpGoreVampireHiss

			additem GoreCrimsonQueenChest 1

          		additem GoreCrimsonQueenFeet 1

			additem GoreCrimsonQueenHands 1

			additem GoreCrimsonQueenHead 1

			additem GoreCrimsonQueenLegs 1

			additem GoreWeapEbonyLongsword 1

			Set Stage to 1

                	Set DisableCounter to 11

		endif

	elseif Stage != -1

                Set DisableCounter to ( DisableCounter - GetSecondsPassed )

                if ( Stage == 1 )

                    if ( DisableCounter <= 10 )

                        set stage to 2

                        equipitem GoreCrimsonQueenChest 1

                        equipitem GoreCrimsonQueenFeet 1

			equipitem GoreCrimsonQueenLegs 1

			equipitem GoreCrimsonQueenHead 1

			equipitem GoreCrimsonQueenHands 1

			equipitem GoreWeapEbonyLongsword 1

                        PlayMagicShaderVisuals effectSummonMythicDawn

                    endif

                elseif ( stage == 2 )

                    if ( DisableCounter <= 9 )

                        StopMagicShaderVisuals effectDrain

                        set stage to 3

                    endif

; This shuts off the effects so they don't last forever

                elseif ( stage == 3 )

                    if ( DisableCounter <= 4 )

                        StopMagicShaderVisuals effectSummonMythicDawn

			RemoveSpell VmpGoreRessurect

			SetEssential GoreTzimitzeVamp 0

                        Set Stage to -1

                        set dooncefient to 0

		    endif

		endif


	elseif dooncedeath == 1

        	if timer > 0

            	set timer to timer - GetSecondsPassed

        else

; Tweak DisableCounter and its checks to adjust effect lengths....


		if Stage == 0

                	PlayMagicShaderVisuals effectAtronachFlame

                	playsound VmpGoreVampireDeadSound

                	playsound VmpGoreVampireHiss

			additem VmpGoreDeadVampireSkeleton 1

                	additem VmpGoreDeadVampireSkull 1

                	Set Stage to 1

                	set DisableCounter to 11

		endif

	elseif Stage != -1

                Set DisableCounter to ( DisableCounter - GetSecondsPassed )

                if ( Stage == 1 )

                    if ( DisableCounter <= 10 )

; Burning effect gets replaced by the "Blade" effect

                        set stage to 2

                        equipitem VmpGoreDeadVampireSkeleton 1

                        equipitem VmpGoreDeadVampireSkull 1

                        StopMagicShaderVisuals effectAtronachFlame

                        PlayMagicShaderVisuals VmpGoreDeadShaderFire

                    endif

                elseif ( stage == 2 )

; This determines when the "Blade" effect gets replaced by the smoldering effect....

                    if ( DisableCounter <= 9 )

                        StopMagicShaderVisuals VmpGoreDeadShaderFire

                        PlayMagicShaderVisuals VmpGoreDeadShaderSmoke

                        set stage to 3

                    endif

; This shuts off the smoking effect... ( So they don't smoke forever... )

                elseif ( stage == 3 )

                    if ( DisableCounter <= 0 )

                        StopMagicShaderVisuals VmpGoreDeadShaderSmoke

                        Set Stage to -1

                        set dooncedeath to 0

                    endif

                endif

            endif

       	 endif


End


Begin OnKnockout


	set dooncefient to 1

	AddSpell VmpGoreRessurect

	AddSpell VmpGoreVampDeath

	AddSpell VmpGoreBuff


End


Begin OnDeath

	set stage to 0

	set timer to 3

	Setstage VmpGoreCrimsonQueen 10

	set DoonceDeath to 1


End

but now when i get in the room she's already wearing her armor...

Link to comment
Share on other sites

I would help but since I don't know what you are trying to accomplish, and your script is in such bad shape logically that I could not follow it.

You might want to look at the IF/ELSEIF/ELSE/ENDIF class. XD

Just a note though, you cannot have an IF/ELSE/ELSEIF code. The first 'else' assumes there are no other conditions, but you then have ELSEIF coded for the existing IF/ELSE combination.

So, that is why I cannot follow what you are trying to do 'logically'.

You can have the conditions in this order only:

IF/ENDIF

IF/ELSE/ENDIF

IF/ELSEIF/ELSEIF/ect/ENDIF

IF/ELSEIF/ELSEIF/ect/ELSE/ENDIF

But you can have a new IF/ENDIF inside other IF/ENDIF commands.

Link to comment
Share on other sites

okay, tried fixing it up more but it still aint workin.

scn VmpGoreNPCVampTransformScript


ref Self

short dooncefient

short doonceDeath

float timer

short stage

float disablecounter


Begin onload


	set self to GetSelf

	set dooncefient to 0

	set DoonceDeath to 0

	set timer to 3

	set stage to 0


End


Begin GameMode


	Set Self to GetSelf


	if dooncefient == 1

		if timer > 0

			set timer to timer - GetSecondsPassed

		endif

	elseif Stage == 0

		PlayMagicShaderVisuals effectDrain

		playsound VmpGoreVampireHiss

		additem GoreCrimsonQueenChest 1

		additem GoreCrimsonQueenFeet 1

		additem GoreCrimsonQueenHands 1

		additem GoreCrimsonQueenHead 1

		additem GoreCrimsonQueenLegs 1

		additem GoreWeapEbonyLongsword 1

		Set Stage to 1

		Set DisableCounter to 11

	elseif Stage != -1

		Set DisableCounter to ( DisableCounter - GetSecondsPassed )

		if ( Stage == 1 )

			if ( DisableCounter <= 10 )

				set stage to 2

				equipitem GoreCrimsonQueenChest 1

				equipitem GoreCrimsonQueenFeet 1

				equipitem GoreCrimsonQueenLegs 1

				equipitem GoreCrimsonQueenHead 1

				equipitem GoreCrimsonQueenHands 1

				equipitem GoreWeapEbonyLongsword 1

				PlayMagicShaderVisuals effectSummonMythicDawn

			endif

		elseif ( stage == 2 )

			if ( DisableCounter <= 9 )

				StopMagicShaderVisuals effectDrain

				set stage to 3

			endif

; This shuts off the effects so they don't last forever

		elseif ( stage == 3 )

			if ( DisableCounter <= 4 )

				StopMagicShaderVisuals effectSummonMythicDawn

				RemoveSpell VmpGoreRessurect

				SetEssential GoreTzimitzeVamp 0

				Set Stage to -1

				set dooncefient to 0

			endif

		endif


	elseif dooncedeath == 1

		if timer > 0

			set timer to timer - GetSecondsPassed

		endif

	elseif Stage == 0

		PlayMagicShaderVisuals effectAtronachFlame

		playsound VmpGoreVampireDeadSound

		playsound VmpGoreVampireHiss

		additem VmpGoreDeadVampireSkeleton 1

		additem VmpGoreDeadVampireSkull 1

		Set Stage to 1

		set DisableCounter to 11

	elseif Stage != -1

		Set DisableCounter to ( DisableCounter - GetSecondsPassed )

		if ( Stage == 1 )

			if ( DisableCounter <= 10 )

; Burning effect gets replaced by the "Blade" effect

				set stage to 2

				equipitem VmpGoreDeadVampireSkeleton 1

				equipitem VmpGoreDeadVampireSkull 1

				StopMagicShaderVisuals effectAtronachFlame

				PlayMagicShaderVisuals VmpGoreDeadShaderFire

			endif

		elseif ( stage == 2 )

; This determines when the "Blade" effect gets replaced by the smoldering effect....

			if ( DisableCounter <= 9 )

				StopMagicShaderVisuals VmpGoreDeadShaderFire

				PlayMagicShaderVisuals VmpGoreDeadShaderSmoke

				set stage to 3

			endif

; This shuts off the smoking effect... ( So they don't smoke forever... )

		elseif ( stage == 3 )

			if ( DisableCounter <= 0 )

				StopMagicShaderVisuals VmpGoreDeadShaderSmoke

				Set Stage to -1

				set dooncedeath to 0

			endif

		endif

	endif


End


Begin OnKnockout


	set dooncefient to 1

	AddSpell VmpGoreRessurect

	AddSpell VmpGoreBuff

	SetCombatStyle DefaultCombatRejectPCYield


End


Begin OnDeath

	set stage to 0

	set timer to 3

	Setstage VmpGoreCrimsonQueen 10

	set DoonceDeath to 1


End

she is still dressed in armor when i walk in but at least she can be killed now. However, she doesn't get knocked out 1st and when she dies she plays the "effectMythicDawnSummon" shader XD

all i want is for her to be armor-less and unkillable, so that when the player tries to kill her she is merely knocked unconscious. And when she is knocked out, i want her to equip armor and weapon and become killable, so that when the player attacks again and her health drops to zero she that disintegrates leaving only a skeleton.

Link to comment
Share on other sites

If I follow what you are trying to do, this fixed script might work.

You only need the 'one' timer function. A 'return' in the timer will cause it to not run any of the other script until the timer is finished.

You only have two (2) conditions, so that is what you need in your 'IF' commands. You see I only have two IF calls, one for when the NPC is unconsious, and one for when its dead. Then, in each of those, I look for the current 'stage' the effects are in.

I placed a commented out 'ResetHealth' in the unconsious part of the script. If you want to use it, just remove the ';' to uncomment it.

scn VmpGoreNPCVampTransformScript

ref Self
short npcUnconc
short npcDead
float timer
short stage
float disablecounter

Begin onload
set self to GetSelf
set npcUnconc to 0
set npcDead to 0
set timer to 3
set stage to 0
End

Begin GameMode
if npcUnconc == 1
if timer > 0
set timer to timer - GetSecondsPassed
return
endif

if Stage == 0
PlayMagicShaderVisuals effectDrain
playsound VmpGoreVampireHiss
additem GoreCrimsonQueenChest 1
additem GoreCrimsonQueenFeet 1
additem GoreCrimsonQueenHands 1
additem GoreCrimsonQueenHead 1
additem GoreCrimsonQueenLegs 1
additem GoreWeapEbonyLongsword 1
Set Stage to 1
Set timer to 1
elseif Stage == 1
equipitem GoreCrimsonQueenChest 1
equipitem GoreCrimsonQueenFeet 1
equipitem GoreCrimsonQueenLegs 1
equipitem GoreCrimsonQueenHead 1
equipitem GoreCrimsonQueenHands 1
equipitem GoreWeapEbonyLongsword 1
PlayMagicShaderVisuals effectSummonMythicDawn
set stage to 2
set timer to 1
elseif stage == 2
StopMagicShaderVisuals effectDrain
set stage to 3
set timer to 5
elseif stage == 3
;* shuts off the effects *
StopMagicShaderVisuals effectSummonMythicDawn
RemoveSpell VmpGoreRessurect
SetEssential GoreTzimitzeVamp 0
Set Stage to -1
set npcUnconc to 0
endif
endif
if npcDead == 1
if timer > 0
set timer to timer - GetSecondsPassed
return
endif
if Stage == 0
PlayMagicShaderVisuals effectAtronachFlame
playsound VmpGoreVampireDeadSound
playsound VmpGoreVampireHiss
additem VmpGoreDeadVampireSkeleton 1
additem VmpGoreDeadVampireSkull 1
Set Stage to 1
set timer to 1
elseif Stage == 1
;* Burning effect gets replaced by the Blade effect *
equipitem VmpGoreDeadVampireSkeleton 1
equipitem VmpGoreDeadVampireSkull 1
StopMagicShaderVisuals effectAtronachFlame
PlayMagicShaderVisuals VmpGoreDeadShaderFire
set stage to 2
set timer to 1
elseif stage == 2
;* Blade effect gets replaced by the smoldering effect *
StopMagicShaderVisuals VmpGoreDeadShaderFire
PlayMagicShaderVisuals VmpGoreDeadShaderSmoke
set stage to 3
set timer to 5
elseif stage == 3
;* shuts off the smoking effect *
StopMagicShaderVisuals VmpGoreDeadShaderSmoke
Set Stage to -1
set npcDead to 0
endif
endif
End

Begin OnKnockout
set npcUnconc to 1
set stage to 0
set timer to 3
AddSpell VmpGoreRessurect
AddSpell VmpGoreBuff
SetCombatStyle DefaultCombatRejectPCYield
; ResetHealth
End

Begin OnDeath
set npcDead to 1
set stage to 0
set timer to 3
Setstage VmpGoreCrimsonQueen 10
End[/code]

Link to comment
Share on other sites

thnx Will, it works XD

..the only thing that didn't was the equipping of VmpGoreDeadVampireSkeleton, so i added some removeitem commands right before the "equipitem VmpGoreDeadVampireSkeleton 1" so that the armor is removed and replace with the skeleton...

anyway, thnx again XD you have been a major help to me and i'm pretty sure i wouldn't be able to releaseit with out your help...or at least not in this month :P

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...