darkneon Posted August 19, 2010 Share Posted August 19, 2010 The spell basicly moves the actor to a cell leaving a rat marker in it's placeUsing modded wrist irons (called aaSlaveToken) it reads if the actor is already a slave(-Fixed-)if the actor is wearing the wrist irons, the rat returns to its cage and the actor to it's former place.(still going wrong)The player can only hold one slave at the time so when he casts the spell on someone else, his former slave returns, the rat takes the place of the new slave and the new slave takes the place of the former slave. The new problem is that when the player casts the spell on a actor, while having a slave, the former slave doesn't return to it's place, and the spell only affects one of the enslaved actors New code! scn aaEnslaveScript short Slaves ref SlaveRef begin ScriptEffectStart if (getItemCount aaSlaveToken != 1) if (Slaves == 0) set Slaves to 1 set SlaveRef to GetSelf RemoveAllItems aaLoveChestRef AddItem aaSlaveToken 1 EquipItem aaSlaveToken TPRatRef.MoveTo SlaveRef MoveTo BottleExit SetRestrained 1 Else SlaveRef.SetRestrained 0 aaLoveChestRef.RemoveAllItems SlaveRef SlaveRef.RemoveItem aaSlaveToken 1 SlaveRef.MoveTo TPRatRef SlaveRef.EvaluatePackage set SlaveRef to GetSelf RemoveAllItems aaLoveChestRef AddItem aaSlaveToken 1 EquipItem aaSlaveToken TPRatRef.MoveTo SlaveRef MoveTo BottleExit SetRestrained 1 EndIf Else SlaveRef.SetRestrained 0 aaLoveChestRef.RemoveAllItems SlaveRef SlaveRef.RemoveItem aaSlaveToken 1 SlaveRef.MoveTo TPRatRef SlaveRef.EvaluatePackage TPRatRef.MoveTo aaRatCageRef 0 0 10 EndIf End Link to comment Share on other sites More sharing options...
darkneon Posted August 22, 2010 Author Share Posted August 22, 2010 Anyone? Link to comment Share on other sites More sharing options...
darkneon Posted August 27, 2010 Author Share Posted August 27, 2010 please?i need this fixed!(srry for triple post) Link to comment Share on other sites More sharing options...
slygothmog Posted August 27, 2010 Share Posted August 27, 2010 if (Slaves == 0) set Slaves to 1 where's the command to set Slaves back to 0?After the first cast it will remain at 1 Link to comment Share on other sites More sharing options...
darkneon Posted August 29, 2010 Author Share Posted August 29, 2010 if (Slaves == 0) set Slaves to 1 where's the command to set Slaves back to 0?After the first cast it will remain at 1 oops, my bad, fixed that.but i think the problem should be here somewhere: Else SlaveRef.SetRestrained 0 aaLoveChestRef.RemoveAllItems SlaveRef SlaveRef.RemoveItem aaSlaveToken 1 SlaveRef.MoveTo TPRatRef SlaveRef.EvaluatePackage set SlaveRef to GetSelf RemoveAllItems aaLoveChestRef AddItem aaSlaveToken 1 EquipItem aaSlaveToken TPRatRef.MoveTo SlaveRef MoveTo BottleExit SetRestrained 1 Link to comment Share on other sites More sharing options...
DavidBudreck Posted August 29, 2010 Share Posted August 29, 2010 Before moving anything it is always best to disable it first. You also need to add references to some of your other commands. SlaveRef.RemoveAllItems aaLoveChestRef SlaveRef.AddItem aaSlaveToken 1 SlaveRef.EquipItem aaSlaveToken TPRatRef.DisableTPRatRef.MoveTo SlaveRef ; TPRatRef.Enable ;------------- DO not Enable the Marker RAT!!!!!!! (I always leave this remarked out line there as a reminder) SlaveRef.DisableSlaveRef.MoveTo BottleExitSlaveRef.Enable Link to comment Share on other sites More sharing options...
Argomirr Posted August 29, 2010 Share Posted August 29, 2010 [EDIT]Oh, double post. Blame the lag. :P Link to comment Share on other sites More sharing options...
Argomirr Posted August 29, 2010 Share Posted August 29, 2010 The problem is probably that MoveTo acts as a return call, causing script processing to jump back to the top of the script. To illustrate: If SomeCondition == 1 Set Ref to GetSelf Self.MoveTo MarkerRef Set SomeCondition to 1 ;<- This line would never run, causing the if statement to never become false, the ref being move over and over etc. EndIf Link to comment Share on other sites More sharing options...
DavidBudreck Posted August 29, 2010 Share Posted August 29, 2010 I believe MoveTo only acts as a Return when used on the Player, so I don't think that is the problem, but it is certainly worth checking out just to be sure. Link to comment Share on other sites More sharing options...
slygothmog Posted August 29, 2010 Share Posted August 29, 2010 I believe MoveTo only acts as a Return when used on the Player, so I don't think that is the problem, but it is certainly worth checking out just to be sure. Yep, that's correct, it only acts as a return when called on the player. Link to comment Share on other sites More sharing options...
Recommended Posts