Help dispose of the bodies!

Post » Fri May 04, 2012 5:10 am

I always seem to have some sort of problem going, but this one is breaking my... mind.

I have a large mobile object on which a battle takes place, leaving a few dead bodies behind. the platfor the battle occurred on leaves the area, but then I have all these bodies floating in the air thirty feet above the surface.

I have tried a script to disable them attached to them (done several ways, and with timers and setdelete, and some that are simple if statements none work.), I have tried global scripts to disable them, or just move them out of sight with MoveWorld z, and no matter what I do the bodies don't budge an inch. Do we have any wise guys who can tell me how to get rid of the evidence?

On the bright side, I have learned how to create CTDs with astounding regularity.
User avatar
Lyndsey Bird
 
Posts: 3539
Joined: Sun Oct 22, 2006 2:57 am

Post » Fri May 04, 2012 9:33 am

Normally those methods should work if done properly. If you post the scripts you tried to do it with, somebody may be able to tell what's wrong with them.
User avatar
Joey Bel
 
Posts: 3487
Joined: Sun Jan 07, 2007 9:44 am

Post » Fri May 04, 2012 10:19 am

I haven't saved all of the different things I have tried. This is the last global attempt, started by a cue in a different script. This one resulted in a consistent CTD.

Begin NDDeadSailorScriptshort statefloat deadTimerIf ( menuMode == 1 )		ReturnendIfIf ( state == 0 )			set deadTimer to ( deadTimer + GetSecondsPassed )		If ( deadTimer >=20 ) ;All shoul be dead by this time			"ND_MagCapn"->disable			"ND_Sailor_01"->disable			"ND_Sailor_02"->disable			"ND_DeadSailor_01"->disable			"ND_DeadSailor_02"->disable		endIf		If ( deadTimer >=30 ) ;give ten second delay before deleting			"ND_MagCapn"->setdelete 1			"ND_Sailor_01"->setdelete 1			"ND_Sailor_02"->setdelete 1			"ND_DeadSailor_01"->setdelete 1			"ND_DeadSailor_02"->setdelete 1			set state to 1			stopscript NDDeadSailorScript		endIf	endIfendIfend NDDeadSailorScript

The others were simple attempts to move them like:

Begin NDDeadScriptshort stateIf ( menuMode == 1 )		ReturnendIfIf ( state == 0 )	If ( GetHealth <= 1 )		If ( GetPos z, >= -1000 )			MoveWorld z, -270		Else			set state to -1		endIf	endIfendIfend NDDeadScript
User avatar
Matt Terry
 
Posts: 3453
Joined: Sun May 13, 2007 10:58 am

Post » Fri May 04, 2012 3:27 pm

some proposed changes/debugging messages to (hopefully) help find where the problem is
Begin NDDeadSailorScriptfloat deadTimerIf ( menuMode == 1 )	ReturnendIfset deadTimer to ( deadTimer + GetSecondsPassed )If ( deadTimer >= 30 ) ;give ten second delay before deleting	"ND_MagCapn"->setdelete 1	"ND_Sailor_01"->setdelete 1	"ND_Sailor_02"->setdelete 1	"ND_DeadSailor_01"->setdelete 1	"ND_DeadSailor_02"->setdelete 1	set deadTimer to 0	stopscript NDDeadSailorScript	returnendIfIf ( deadTimer >= 20 ) ; All shoul be dead by this time	"ND_MagCapn"->disable	"ND_Sailor_01"->disable	messagebox "ND_MagCapn, ND_Sailor_01 disabled"	"ND_Sailor_02"->disable	messagebox "ND_MagCapn disabled"	"ND_DeadSailor_01"->disable	"ND_DeadSailor_02"->disable	messagebox "ND_DeadSailor_01, ND_DeadSailor_02 disabled"endIfend
[EDIT]how exactly do you start this global script?
User avatar
Etta Hargrave
 
Posts: 3452
Joined: Fri Sep 01, 2006 1:27 am

Post » Fri May 04, 2012 7:32 pm

Another script sets a global variable to a new value and starts the script, and in the if block is well...

;startcombatsIf ( ControlVar == 1 )             "NDHasell"->AIFollow, "NDBlackSalm" 0, 0, 0, 0    If ( BattleTimer >= 2 )        if ( "ND_MagCapn"->GetHealth >= 2 )                "NDBlackSalm"->StartCombat "ND_MagCapn"                set Battletimer to 0        Elseif ( "ND_Sailor_01"->GetHealth >= 2 )                     "NDBlackSalm"->StartCombat "ND_Sailor_01"                set Battletimer to 0        Elseif ( "ND_Sailor_02"->GetHealth >= 2 )                "NDBlackSalm"->StartCombat "ND_Sailor_02"                set Battletimer to 0        Else                set controlVar to 2                set Battletimer to 0        endIf        if ( "ND_MagCapn"->GetHealth >= 2 )                "NDHasell"->StartCombat "ND_Sailor_02"                set Battletimer to 0        Elseif ( "ND_Sailor_01"->GetHealth >= 2 )                     "NDHasell"->StartCombat "ND_Sailor_01"                set Battletimer to 0        Elseif ( "ND_Sailor_02"->GetHealth >= 2 )                "NDHasell"->StartCombat "ND_MagCapn"                set Battletimer to 0        Else                set controlVar to 2                set Battletimer to 0 ;reset timer        endIf    endIfendIfIf ( ControlVar == 2 )    If ( BattleTimer >= 25 )        Playsound "hullSink2"        set NDBattleControl to 2        set controlVar to 3        startscript NDDeadSailorScript    endIfendIf
User avatar
Penny Flame
 
Posts: 3336
Joined: Sat Aug 12, 2006 1:53 am

Post » Fri May 04, 2012 6:37 pm

Problem solved, thanks Abot. That was dumb of me not to realize that i had the order backwards on the global... Apparently trying to disable every frame is not a good idea... :blink:

There was also an issue other than the script itself. It seems that somehow a couple of those NPCs had duplicate references. I had two versions of the mod in data files, and I had apparently set the older version as active (compounded by having both checked in data files) without realizing my error and made some changes. then when I loaded the one I was actually working on, the changes weren't there and I screwed things up trying to get the changes to work.

The moral: Never keep old versions of a mod in data files with the current version.

thanks again, abot.
User avatar
Stephanie Valentine
 
Posts: 3281
Joined: Wed Jun 28, 2006 2:09 pm


Return to III - Morrowind