Weird Script Result

Post » Tue May 17, 2011 9:05 am

Alright, this is the script:

scn solarscorchercrittest2ref rContainerref myselfBegin GameMode	rContainer.SetCriticalStage DisintegrateStart	rContainer.PlaceAtMe WJSflameburst	set mySelf to GetSelf	if myself.GetIsCreature == 0 ;is human?		if myself.GetPCIssix Male ;is male?			rContainer.PlaceAtMe Skeleton50sCasualMale		elseif myself.GetPCIssix Female ;is feamle?			rContainer.PlaceAtMe Skeleton50sCasualFemale		endif	elseif myself.GetIsCreatureType 4 == 1 ;is supermutant?		rContainer.PlaceAtMe SkeletonWholeBodyRags	elseif myself.GetIsCreatureType 5 == 1 ;is ghoul?		rContainer.PlaceAtMe SkeletonWholeBodyRags		endif	myself.ResurrectActor 1	player.PushActorAway myself 35	myself.KillActor myselfEnd


Now, for some reason, this part (or the ones similar to it):

rContainer.PlaceAtMe Skeleton50sCasualMale


spawns 4 of the item I was calling. Any idea why that happens?
User avatar
Yvonne Gruening
 
Posts: 3503
Joined: Mon Apr 23, 2007 7:31 pm

Post » Tue May 17, 2011 5:13 am

Try adding a switch into the script after the placeAtMe call. ie:

set doOnce to 1


and have a check on the switch near the start of your code ie:

if doOnce     returnendif


( Don't forget to declare it at the start, of course. )

Also, you do realize that the function GetPCIssix only checks the gender of the player, right? So you're telling "myself" to check what the player's six is. If you want to get the gender of "myself" then you need to use http://cs.elderscrolls.com/constwiki/index.php/GetIssix:
myself.getIssix Male

User avatar
Darren
 
Posts: 3354
Joined: Wed Jun 06, 2007 2:33 pm

Post » Tue May 17, 2011 10:58 am

Try adding a switch into the script after the placeAtMe call. ie:

set doOnce to 1


and have a check on the switch near the start of your code ie:

if doOnce     returnendif


( Don't forget to declare it at the start, of course. )

Also, you do realize that the function GetPCIssix only checks the gender of the player, right? So you're telling "myself" to check what the player's six is. If you want to get the gender of "myself" then you need to use http://cs.elderscrolls.com/constwiki/index.php/GetIssix:
myself.getIssix Male



Agreed, set a doOnce in there to stop it looping.
User avatar
carley moss
 
Posts: 3331
Joined: Tue Jun 20, 2006 5:05 pm

Post » Tue May 17, 2011 4:58 am

Is this a token object script, like WJS' EVE tokens kinda? If so, try:

ref rContainerBegin OnAdd	Set rContainer to GetContainer	If rContainer.IsActor		rContainer.SetCriticalStage DisintegrateStart		PlaceAtMe WJSFlameBurst	Else		RemoveMe	EndIfEnd;=======================================Begin GameMode	If rContainer.GetDead		rContainer.SetCriticalStage DisintegrateEnd		RemoveMe	ElseIf rContainer.GetIsCreature		If rContainer.GetIsCreatureType 4 ; supermutant?			PlaceAtMe SkeletonWholeBodyRags		ElseIf rContainer.GetIsCreatureType 5 ; ghoul?			PlaceAtMe SkeletonWholeBodyRags		EndIf	Else ; Human		If rContainer.GetIssix Male			rContainer.PlaceAtMe Skeleton50sCasualMale		Else;if rContainer.GetIssix Female			rContainer.PlaceAtMe Skeleton50sCasualFemale		EndIf	Else	rContainer.ResurrectActor 1 ; ???	Player.PushActorAway rContainer 35	rContainer.Kill rContainerEnd

User avatar
He got the
 
Posts: 3399
Joined: Sat Nov 17, 2007 12:19 pm


Return to Fallout 3