CaptainRC Posted December 28, 2011 Share Posted December 28, 2011 I'm working on a way to improve on my tweaked version of theRoadstroker's Zelda Remake mod, but I'm having a little difficulty. Specifically, I want to add the ability to return the Master Sword to its pedestal. However, I'm having a small problem. My knowledge of scripts is limited and I want the mod to work right. I basically made a reference activator of the sword and one of the pedestal. And, naturally, I had to make scripts for each in order to take and return the sword. But I don't want the sword reference object to reappear just because I dropped the sword or because a certain amount of time has elapsed. I just want it to stay disabled until the sword is returned to the pedestal and to be able to take it again with the same results. I've tried several variations with what I know, but I've had some weird effects... such as the sword reference reenabling just because I dropped the sword; the sword reference not disabling after taking the sword a second time after returning it, resulting in being able to take an unlimited amount of the same sword; returning the sword and the reference reenabling, but unable to be activated again; and taking the sword, but after some time, I return to find the sword refrence enabled again when it shouldn't be. So I went back to basics. Here are the scripts I have so far: scn MasterSwordPlaceholderSCRIPT Begin OnActivate if (GetActionRef != Player) Return elseif (GetPCInfamy == 0) && (player.getitemcount ROADMODZeldaSword01 < 1) MasterSwordREF1.disable player.additem 01000ED5 1 MessageBox "You are true of heart, and the Blade of Evil's Bane has chosen you to be its new Master." elseif (GetPCInfamy > 0) PlaySound SPLShockHit Cast StandardShockDamageTouch3Journeyman Player Player.PushActorAway Player 1 endif End scn PedestalOfTimeSCRIPT Begin OnActivate if (player.getitemcount ROADMODZeldaSword01 >= 1) MasterSwordREF1.enable player.removeitem 01000ED5 1 PlaySound WPNBlade1HandUnequip MessageBox "You have returned the Master Sword to the Pedestal of Time." elseif (player.getitemcount ROADMODZeldaSword01 < 1) Message "You do not have the Master Sword." endif endif End Could anyone help me improve these so that I may achieve the desired effect? Any help would be appreciated. Link to comment Share on other sites More sharing options...
David Brasher Posted December 28, 2011 Share Posted December 28, 2011 (edited) I do not understand how you have two scripts. I would think you would need to combine them into one script attached to the pedestal. So I would think that the script should look more like this: scn PedestalOfTimeSCRIPT ; Object script attached to pedestal. Short Sword ; Variable recording where the sword is. 0 == At home on pedestal 1 == Taken from pedestal ; Variable starts at 0. Begin OnActivate if (GetActionRef != Player) Return Endif If player.getitemcount ROADMODZeldaSword01 == 0 && Sword == 0 If GetPCInfamy == 0 MasterSwordREF1.disable player.additem 01000ED5 1 Set Sword to 1 MessageBox "You are true of heart, and the Blade of Evil's Bane has chosen you to be its new Master." elseif (GetPCInfamy > 0) PlaySound SPLShockHit Cast StandardShockDamageTouch3Journeyman Player Player.PushActorAway Player 1 MessageBox "You are not true of heart, and the Blade of Evil's Bane will not serve you." elseif Player.getitemcount ROADMODZeldaSword01 == 0 && Sword == 1 Message "You do not have the Master Sword." endif EndIf if (player.getitemcount ROADMODZeldaSword01 >= 1) MasterSwordREF1.enable player.removeitem 01000ED5 1 PlaySound WPNBlade1HandUnequip Set Sword to 0 MessageBox "You have returned the Master Sword to the Pedestal of Time." endif End Edited December 28, 2011 by David Brasher Link to comment Share on other sites More sharing options...
DrakeTheDragon Posted December 28, 2011 Share Posted December 28, 2011 (edited) Couldn't yet figure out why the things before were happening, but I'd put the last "if"-block in David's script into an "elseif" (or even an "else") instead, as the way it is right now it will give you the sword, then immediately take it away again, as the second condition will always be fulfilled after you fulfilled the first one. Oh, and I'm asking myself since I first read this, is there a cause for why it's called "ROADMODZeldaSword01" at one point and "01000ED5" at another? The "01000ED5" is totally dependent on your load order and will no longer work after critical positions have changed! So if it is indeed the same item, just keep using the EditorID ("ROADMODZeldaSword01") everywhere and don't use the FormID ("01000ED5") at all. There's nothing in your initial scripts which would react to you dropping the sword or picking it up, so to cause the issues you're describing there must be something else going on, in scripts we don't know of, yet. Edited December 28, 2011 by DrakeTheDragon Link to comment Share on other sites More sharing options...
CaptainRC Posted December 29, 2011 Author Share Posted December 29, 2011 (edited) I do not understand how you have two scripts. I would think you would need to combine them into one script attached to the pedestal. So I would think that the script should look more like this: scn PedestalOfTimeSCRIPT ; Object script attached to pedestal. Short Sword ; Variable recording where the sword is. 0 == At home on pedestal 1 == Taken from pedestal ; Variable starts at 0. Begin OnActivate if (GetActionRef != Player) Return Endif If player.getitemcount ROADMODZeldaSword01 == 0 && Sword == 0 If GetPCInfamy == 0 MasterSwordREF1.disable player.additem 01000ED5 1 Set Sword to 1 MessageBox "You are true of heart, and the Blade of Evil's Bane has chosen you to be its new Master." elseif (GetPCInfamy > 0) PlaySound SPLShockHit Cast StandardShockDamageTouch3Journeyman Player Player.PushActorAway Player 1 MessageBox "You are not true of heart, and the Blade of Evil's Bane will not serve you." elseif Player.getitemcount ROADMODZeldaSword01 == 0 && Sword == 1 Message "You do not have the Master Sword." endif EndIf if (player.getitemcount ROADMODZeldaSword01 >= 1) MasterSwordREF1.enable player.removeitem 01000ED5 1 PlaySound WPNBlade1HandUnequip Set Sword to 0 MessageBox "You have returned the Master Sword to the Pedestal of Time." endif End The reason I have two scripts is that most people when they see the sword in the pedestal will usually click on the sword to take it, and not think to click the pedestal. So I figured that having a seperate script for the sword would cover that. Besides, I figured that that's how it would work when I looked at the scripts to Anduril Reforged, which its sword and altar have similar functions. So I figured, "Click the sword to take the sword, click the pedestal to return it." Edited December 29, 2011 by CaptainRC Link to comment Share on other sites More sharing options...
CaptainRC Posted December 29, 2011 Author Share Posted December 29, 2011 (edited) Couldn't yet figure out why the things before were happening, but I'd put the last "if"-block in David's script into an "elseif" (or even an "else") instead, as the way it is right now it will give you the sword, then immediately take it away again, as the second condition will always be fulfilled after you fulfilled the first one. Oh, and I'm asking myself since I first read this, is there a cause for why it's called "ROADMODZeldaSword01" at one point and "01000ED5" at another? The "01000ED5" is totally dependent on your load order and will no longer work after critical positions have changed! So if it is indeed the same item, just keep using the EditorID ("ROADMODZeldaSword01") everywhere and don't use the FormID ("01000ED5") at all. There's nothing in your initial scripts which would react to you dropping the sword or picking it up, so to cause the issues you're describing there must be something else going on, in scripts we don't know of, yet. I'll have to try that. Thanks. As for the differences, I based these scripts off of previous scripts I made for the earlier versions. I didn't realize that the FormID and the Editor IDs were interchangable. Like I said, my experience in scripts is severely limited. As for the effects I mentioned, those were the results of variables I tried to put in to avoid what I said, earlier. As you can tell, they failed. The scripts I showed you are the "basics" I went back to after I deleted those variables. However, maybe I should try just changing the FormIDs to the Editor IDs, like you said. Maybe that'll make all the difference. I should also try David's suggestion, too. BTW, I tried it with just these basics, I would reenter the cell where I got the sword to find the sword reference enabled again. However, this was on a game save where I had gotten the sword before I made the changes. If I was to start all over again from the beginning on a clean save, do you think it would work properly? Edited December 29, 2011 by CaptainRC Link to comment Share on other sites More sharing options...
Recommended Posts