inggrish Posted February 8, 2009 Share Posted February 8, 2009 Hi, on my mod I am trying to put a portcuillis controlled by two levers on the front gate of my castle. I have tried a lot of jiggling around with scripts, but for some reason, the closing animation does not ever work properly on the "KvatchCastlePortcullis02" portcullis model. Is this a mproblem with the scripts or a problem with the mesh??? I have tried this wioth only one lever and it still dosent like closing. The opening animation works fine; but when I pull the lever again to close the gate, it starts closiong but when it is almost fully closed the p[ortcullis jumps back to the open position and plays the closing animation again and again and again; and the only way to stop it from doing this repeatedly is just to load a previous save game!!! Please help anyone Thanks for your time Matt (Inggrish) :wallbash: Link to comment Share on other sites More sharing options...
Vagrant0 Posted February 8, 2009 Share Posted February 8, 2009 Hi, on my mod I am trying to put a portcuillis controlled by two levers on the front gate of my castle. I have tried a lot of jiggling around with scripts, but for some reason, the closing animation does not ever work properly on the "KvatchCastlePortcullis02" portcullis model. Is this a mproblem with the scripts or a problem with the mesh??? I have tried this wioth only one lever and it still dosent like closing. The opening animation works fine; but when I pull the lever again to close the gate, it starts closiong but when it is almost fully closed the p[ortcullis jumps back to the open position and plays the closing animation again and again and again; and the only way to stop it from doing this repeatedly is just to load a previous save game!!! Please help anyone Thanks for your time Matt (Inggrish) :wallbash:Check the scripting, it should be using playgroup backward to close the gate, and this portion of the script should become invalid as soon as it is triggered by condition. Link to comment Share on other sites More sharing options...
inggrish Posted February 9, 2009 Author Share Posted February 9, 2009 Check the scripting, it should be using playgroup backward to close the gate, and this portion of the script should become invalid as soon as it is triggered by condition. Erm, sorry, could you rephrase that? I don't fully understand (I am still a bit of a noob with scripting!!!) Cheers Matt ps: Sorry to moderators for double posting this post; I was sure that it didn't work at first! Link to comment Share on other sites More sharing options...
Vagrant0 Posted February 9, 2009 Share Posted February 9, 2009 Essentially, use something like;scn IngTypicalGateSwitchScript0231 ref gate ref self short triggered begin onactivate set gate to getparentref set self to getself if triggered != 1 self.playgroup forward gate.playgroup forward set triggered to 1 elseif triggered == 1 self.playgroup backward gate.playgroup backward set triggered to 0 endif endin the case of one switch and one gate. Just set the gate to be the parent of the switch. If you want another switch to share the same animations, you'll need to make both switches persistent and named references. And do something likescn IngTypicalGateSwitchScript0231 ref gate short triggered begin onactivate set gate to getparentref set self to getself if triggered != 1 <switch1ref>.playgroup forward <switch2ref>.playgroup forward gate.playgroup forward set triggered to 1 <switch2ref>.set triggered to 1 elseif triggered == 1 <switch1ref>.playgroup backward <switch2ref>.playgroup backward gate.playgroup backward set triggered to 0 <switch2ref>.set triggered to 0 endif endIn both cases assuming that the switch being used is one which has those animations. An onactivate block will only run when the switch is activated. The animations played by both the gate and the switch are controlled by use of a condition which becomes invalid after the switch has been pressed, meaning that the alternate animation will always get used once the first one has played. Link to comment Share on other sites More sharing options...
inggrish Posted February 9, 2009 Author Share Posted February 9, 2009 You absolute legend. Thanks so much. I will have a proper look at this tonight at home. :thanks: Link to comment Share on other sites More sharing options...
inggrish Posted February 9, 2009 Author Share Posted February 9, 2009 OK, I tried using it and adapting it, but I got an error message: "missing parameter flags" what does that mean??? this was the error message: ---------------------------Script Error---------------------------Script 'edencastleportcullishandlescript', line 11:Missing parameter Flags. Compiled script not saved!---------------------------OK --------------------------- The final script was: scn edencastleportcullishandlescript ref gateref selfshort triggered begin onactivateset gate to getparentrefset self to getselfif triggered != 1edencastlegatehandle1.playgroup forwardedencastlegatehandle2.playgroup forwardgate.playgroup forwardset triggered to 1edencastlegatehandle2.set triggered to 1elseif triggered == 1edencastlegatehandle1.playgroup backwardedencastlegatehandle2.playgroup backwardgate.playgroup backwardset triggered to 0edencastlegatehandle2.set triggered to 0endif end cheers Matt Link to comment Share on other sites More sharing options...
Vagrant0 Posted February 9, 2009 Share Posted February 9, 2009 OK, I tried using it and adapting it, but I got an error message: "missing parameter flags" what does that mean??? this was the error message: ---------------------------Script Error---------------------------Script 'edencastleportcullishandlescript', line 11:Missing parameter Flags. Compiled script not saved!---------------------------OK ---------------------------That means that there's a problem starting at line 11, probably with the function. The function on line 11 is playgroup, so check the wiki to see if anything else is needed.http://cs.elderscrolls.com/constwiki/index.php/PlayGroup Link to comment Share on other sites More sharing options...
inggrish Posted February 11, 2009 Author Share Posted February 11, 2009 This isn't fair. It just REFUSES to work properly. Itys not just me working on it now, I have a few mates at it and we are tryiong every combination, but it always seems to be thatthe closing animation always loops. No matter what. grrr please help!!! Link to comment Share on other sites More sharing options...
Vagrant0 Posted February 12, 2009 Share Posted February 12, 2009 This isn't fair. It just REFUSES to work properly. Itys not just me working on it now, I have a few mates at it and we are tryiong every combination, but it always seems to be thatthe closing animation always loops. No matter what. grrr please help!!!Can you post your scripts? Off hand, looking at the mesh, there doesn't seem to be anything which might cause this, however it is possible that the mesh, or the scripted object is designed to always be open simply because that's all it had to do in the game. This could still be fixed, but it may require some re-working of resources. Link to comment Share on other sites More sharing options...
inggrish Posted February 13, 2009 Author Share Posted February 13, 2009 scn edencastleportcullishandlescript ref gateref selfshort triggered begin onactivate set gate to getparentref set self to getself if triggered != 1 edencastlegatehandle1.playgroup forward 1 edencastlegatehandle2.playgroup forward 1 gate.playgroup forward 1 set triggered to 1 edencastlegatehandle2.set triggered to 1 elseif triggered == 1 edencastlegatehandle1.playgroup backward 1 edencastlegatehandle2.playgroup backward 1 gate.playgroup backward 1 set triggered to 0 edencastlegatehandle2.set triggered to 0 endif end As i said, there has been a few combinations revolving around this script. Hmm, :(, can you see the problerm or what would make it work? Link to comment Share on other sites More sharing options...
Recommended Posts