travnape Posted March 9, 2004 Share Posted March 9, 2004 ok so after awhile of trying I finally made progress, instead of the script causing a crash now the script.... does nothing. I try and activate the needed item and nothing, I pick up the required item for using the activator and nothing. I equip the item and nothing, what's the next step...? here's the code I have on the "doorway" I want to use begin WAYGATE short waystone if ( menumode == 1 ) returnendif if ( OnActivate == 1 ) if ( waystone == 1 ) PlaySound "Thunder2" Player->PositionCell, 302, 504, -368, 270, "Falasmaryon, Propylon Chamber" if ( waystone == 0 ) MessageBox "You must have a waystone equipped." else MessageBox "You must have a waystone equipped." endif endif endif End ok.... I then have this script attached to an object which is used sorta as the key, but I want it to to work only when equipped... Begin falaswaystone short OnPCEquipshort waystone if ( OnPCEquip == 1 ) set waystone to 1else set waystone to 0endif End am i doing this right? I want to make the above code for several identicle objects which take you to differant places (i.e. set the variable to 2, 3 , 4 etc and depending on which variable is set it sends you to differant places. One loose end after it is workable is how to reset the variable to 0 when the item is removed, will this happen automatically since the OnPCEquip value is no longer 1? also bear in mind that the formatting of the script SHOULD be ok, just not in the forum. I've posted summaries of this thred twice before and had no response, please help :bye: Link to comment Share on other sites More sharing options...
Wookiee Posted March 9, 2004 Share Posted March 9, 2004 make waystone a global variable locals dont comunicate between scripts very well also good luck making the wheel of time ;) Link to comment Share on other sites More sharing options...
travnape Posted March 9, 2004 Author Share Posted March 9, 2004 how do i set it as global? would it be long, floating or what? and is there a waygate in wheel of time? I've never read it Link to comment Share on other sites More sharing options...
Wookiee Posted March 9, 2004 Share Posted March 9, 2004 lol ok yes there is a waygate in the wheel of time and here is how to set it as a global go to the "gameplay" tab in the TESCS and select global then press new and type in the name of your global then select it and change its type to the type you want (eg short long float) and set its starting value (i suspect this will be 0) then remove the folowing line from all your scripts (short waystone) as it is now declared for all scripts and does not need to be declaird localy any more :) the thing with globals is if you change this variable with ANY script it will change it for ALL scripts that access this variable. hope this helps. Da Wookiee Link to comment Share on other sites More sharing options...
travnape Posted March 11, 2004 Author Share Posted March 11, 2004 Yeah thanks so much I think that's the ticket right there, i'll test it out and let you know Link to comment Share on other sites More sharing options...
travnape Posted March 11, 2004 Author Share Posted March 11, 2004 THAT WAS IT! your suggestion helped a ton, thanks man, also my IF ELSEIF was screwed up so it wasn't showing the message, but I fixed that, works just great, now I can get down to business of where I want these stones to send people :) Link to comment Share on other sites More sharing options...
travnape Posted March 11, 2004 Author Share Posted March 11, 2004 ok this is really bizzare everything is working, I set the global script and when I wear the item it sends me and when I take it off it won't which is right. I can put down the item and pick up another one and equip it and it sends me to it's specified location. Great right? well it seems to only work when I'm only holding on of the objects, which baffles me because I have no refrences to Getitemcount in the inventory, this whole things is being run through the "waystone" global variable, WTH is going on with it? activator script: begin WAYGATE ;if ( menumode == 1 ); return;endif if ( OnActivate ) if ( waystone == 1 ) PlaySound "Thunder2" Player->PositionCell, 4099, 4287, 15643, 180, "Balmora, Protector Keep upper tower" endif if ( waystone == 2 ) PlaySound "Thunder2" Player->PositionCell, 4103, 2870, 13206, 360, "Addadshashanammu, Shrine" endif if ( waystone == 0 ) MessageBox "You must have a waystone equipped." endif endif End ****** balmora protector keep script (on equipable item) Begin protectorscript short OnPCEquip ;if ( menumode == 1 ); return;endif if ( OnPCEquip == 1 ) set waystone to 1endif if ( OnPCEquip == 0 ) set waystone to 0endif End *********** Shrine script also on like equipable item) Begin Addadshashanammuscript short OnPCEquip ;if ( menumode == 1 ); return;endif if ( OnPCEquip == 1 ) set waystone to 2endif if ( OnPCEquip == 0 ) set waystone to 0endif End ************************* any ideas? this is really starting to bug me Link to comment Share on other sites More sharing options...
travnape Posted March 11, 2004 Author Share Posted March 11, 2004 Nevermind I figured it out, the object scripts needed a specification that the global script had to be equal to the number it sets it to in order to reset the value to 0, so when one was equippe dover the other the value continually changed back to 0 not allowing use of either as long as both were being held. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.