Apolyton Archive  |  Preserved copy of the Apolyton Civilization Site and its forums as they stood in September 2005. Read-only; nothing here can be posted to or replied to.  |  Forum index |  About this archive |  The 1998–2001 UBB forums
Today on Apolyton WARDELL INTERVIEW PROMO A.C.S. HISTORY CHAPTER 4 GET CIV4 /w FREE PLUS! A.C.S. PHOTO GALLERY GET A.O.M. V1.1
Apolyton Civilization Forums
main| civ2| civ3| civ4| smac| ctp2| ron| moo3| galciv| galciv2| alt| about|
ApolytonPLUS | register | search | faq | new posts | pm (-/-) | upload | members
hall of fame new! | civgroups | civgroups news | interviews | the column | radio | chat | directory | news | store | PLUS
Apolyton Civilization Forums : Powered by vBulletin version 2.0.3 Apolyton Civilization Forums > Miscellaneous > Archive > Other Games-Archive > NWN Scripting Question
Show a Printable Version | Email This Page to Someone! | Receive updates to this thread | Report this to Apolyton news!

bottom of page
  
Author
Thread   
Pages (2): [ 1   2   ]
< Last Thread     Next Thread > Post New Thread     Post A Reply
Jamski is offline Jamski
Deity
lol ED&D is officially full PvP LOL
May 2002
time: 05:32
  Old Post 08-01-2004 15:30
Edit/Delete Message Reply w/Quote
#31 Report this post to a moderator
Support Apolyton, buy Civilization 2

code:
//Created by Jamski //Put this OnUsed for each lever //(leverone, levertwo leverthree, leverfour) //Make four copies, one for each lever //Change the text in bold for each lever //Call the door to be opened DOOR_TO_OPEN void main() object oTarget; { object oPC = GetLastUsedBy(); if (!GetIsPC(oPC)) return; int nInt; nInt=GetLocalInt(oPC, "leverone"); if (nInt == 1) { nInt=GetLocalInt(oPC, "levertwo"); if (nInt == 1) { nInt=GetLocalInt(oPC, "leverthree"); if (nInt == 1) { nInt=GetLocalInt(oPC, "leverfour"); if (nInt == 1) { oTarget = GetObjectByTag("DOOR_TO_OPEN"); SetLocked(oTarget, FALSE); AssignCommand(oTarget, ActionOpenDoor(oTarget)); } } } } } { object oPC = GetLastUsedBy(); if (!GetIsPC(oPC)) return; SetLocalString(oPC, "leverone", "1"); }


This checks each time you pull a lever if all 4 have been pulled, and if so opens and unlocks the door called DOOR_To_OPEN. If not, it sets that lever to "pulled".

Clear?

-Jam

Jamski is offline Jamski
Deity
lol ED&D is officially full PvP LOL
May 2002
time: 05:32
  Old Post 08-01-2004 15:34
Edit/Delete Message Reply w/Quote
#32 Report this post to a moderator
Support Apolyton, buy Alpha Centauri

Whoops. Change the last block to :

code:
object oPC = GetLastUsedBy(); if (!GetIsPC(oPC)) return; SetLocalInt(oPC, "leverone", 1);


Its an Int, not a sString

Jamski is offline Jamski
Deity
lol ED&D is officially full PvP LOL
May 2002
time: 05:32
  Old Post 08-01-2004 15:40
Edit/Delete Message Reply w/Quote
#33 Report this post to a moderator
Got spare money?

Bleh, sorry, forget all that. This one is better :

code:
//Created by Jamski //Put this OnUsed for each lever //(leverone, levertwo leverthree, leverfour) //Make four copies, one for each lever //Change the text in bold for each lever //Call the door to be opened DOOR_TO_OPEN //Best Version void main() { object oPC = GetLastUsedBy(); if (!GetIsPC(oPC)) return; SetLocalInt(oPC, "leverone", 1); if (!GetIsPC(oPC)) return; int nInt; nInt=GetLocalInt(oPC, "leverone"); if (nInt == 1) { nInt=GetLocalInt(oPC, "levertwo"); if (nInt == 1) { nInt=GetLocalInt(oPC, "leverthree"); if (nInt == 1) { nInt=GetLocalInt(oPC, "leverfour"); if (nInt == 1) { object oTarget = GetObjectByTag("DOOR_TO_OPEN"); SetLocked(oTarget, FALSE); AssignCommand(oTarget, ActionOpenDoor(oTarget)); } } } } }


-Jam

Jamski is offline Jamski
Deity
lol ED&D is officially full PvP LOL
May 2002
time: 05:32
  Old Post 08-01-2004 16:09
Edit/Delete Message Reply w/Quote
#34 Report this post to a moderator
Get a bigger avatar today!

Just tested this last one - it works PERFECTLY. Ok, the levers don't animate, but that's not my problem. Use buttons instead or add an animation

-Jam

DaShi is offline DaShi
Prince
The Taste of Japan
Sep 2000
time: 05:32
  Old Post 09-01-2004 09:45
Edit/Delete Message Reply w/Quote
#35 Report this post to a moderator
Remove this text

I couldn't get that one to work either.

Here is the script I've been using:

code:
void main() { object oPC=GetLastUsedBy(); int nUsed1 = GetLocalInt(OBJECT_SELF, "LEVER_STATE"); int nUsed2; int nUsed3; int nUsed4; // // nUsed1 and nUsed2 are used to temporarily hold the states of the two levers. // 0 is off, 1 is on // LEVER_STATE is the permanent holding spot for the variables. // Each lever stores its own LEVER_STATE // if(nUsed1 == 0) { ActionPlayAnimation(ANIMATION_PLACEABLE_ACTIVATE); SetLocalInt(OBJECT_SELF, "LEVER_STATE", 1); ActionSpeakString("You hear the sound of a metal pin being released."); PlaySound("as_sw_metalop1"); nUsed1 = 1; } else { PlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE); SetLocalInt(OBJECT_SELF, "LEVER_STATE", 0); ActionSpeakString("You hear the sound of a metal pin being reset."); PlaySound("as_sw_metalcl1"); nUsed1 = 0; } object oLever1=GetNearestObjectByTag("DLEVER1"); object oLever2=GetNearestObjectByTag("DLEVER2"); object oLever3=GetNearestObjectByTag("DLEVER3"); object oLever4=GetNearestObjectByTag("DLEVER4"); nUsed1 = GetLocalInt(oLever1, "LEVER_STATE"); nUsed2 = GetLocalInt(oLever2, "LEVER_STATE"); nUsed3 = GetLocalInt(oLever3, "LEVER_STATE"); nUsed4 = GetLocalInt(oLever4, "LEVER_STATE"); string sUsed1=IntToString(nUsed1); string sUsed2=IntToString(nUsed2); string sUsed3=IntToString(nUsed3); string sUsed4=IntToString(nUsed4); SendMessageToPC(oPC, "Use1 is "+sUsed1); SendMessageToPC(oPC, "Use2 is "+sUsed2); SendMessageToPC(oPC, "Use3 is "+sUsed3); SendMessageToPC(oPC, "Use4 is "+sUsed4); if ((nUsed1 == 1) && (nUsed2 == 1) && (nUsed3 == 1) && (nUsed4 == 1)) // Are all levers on? { AssignCommand(oPC, ActionSpeakString("That should be all of them.")); object oDoor=GetNearestObjectByTag("VCD_DOOR2"); SetLocked(oDoor, FALSE); } }


When I pull lever 1, all the numbers read 0. When I pull lever 2; lever 1 reads 1, but lever 2 reads 0. If I then pull lever 1 again; lever 1 reads 0, and lever 2 reads 1. So each lever activates the previous lever pulled at the same time reseting itself to 0. Pulling the same lever twice does nothing.

DaShi is offline DaShi
Prince
The Taste of Japan
Sep 2000
time: 05:32
  Old Post 09-01-2004 11:16
Edit/Delete Message Reply w/Quote
#36 Report this post to a moderator
Put an end to popups!

I got help from the Bioware boards. It seems that you can't use GetNearestObjectByTag() to refer to the object running the script. By just changing them all to GetObjectByTag(), it worked.

Jamski is offline Jamski
Deity
lol ED&D is officially full PvP LOL
May 2002
time: 05:32
  Old Post 09-01-2004 13:25
Edit/Delete Message Reply w/Quote
#37 Report this post to a moderator
Increase the size of your Attachments

Mine works for me. I've used it in the DoA with you wondering how the door opens Perhaps you mixed up the renaming when you made your four copies?

I see you wanted each lever to have an on-off state. Mine are off until used and then stay used forever. When the fourth one is used, the door opens. Yours is more of a puzzle. I may steal it, if that's ok

-Jam

Jamski is offline Jamski
Deity
lol ED&D is officially full PvP LOL
May 2002
time: 05:32
  Old Post 09-01-2004 14:16
Edit/Delete Message Reply w/Quote
#38 Report this post to a moderator
Support Apolyton, buy Civilization: The Boardgame

Heh, just saw you on the bioware boards

-Jam

 
Pages (2): [ 1   2   ]
< Last Thread     Next Thread > Post New Thread     Post A Reply
All times are GMT. The time now is 05:32.
Apolyton Time is 00:32.
    top of page
Rate This Thread:
archivepost
Forum Jump:
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is ON
vB code is ON
Smilies are ON
[IMG] code is ON
 




Contact Us - Apolyton Civilization Site - Support Us!

Building a better Apolyton through better information. Click here and take our poll!
Non-US visitors, click here!

Powered by: vBulletin Version 2.0.3
Copyright ©2000, 2001, Jelsoft Enterprises Limited.

Page generated in 0.0441 seconds (87.45% PHP - 12.55% MySQL) with 31 queries
Page Loading Time:

Support Apolyton: Amazon USA | Amazon UK | Amazon DE | Amazon FR |
Support Apolyton and get FREE PLUS, Buy from Chips&Bits: Galactic Civilizations | Galactic Civilizations: Deluxe Edition | Call to Power 2 | Civilization: The Boardgame | GURPS/ Alpha Centauri | Alpha Centauri | Civilization IV | Civilization III: Complete |


Front Page | Civilization IV | Civilization III | Civilization II | Call to Power II | Alpha Centauri | Master of Orion III
Rise of Nations | Galactic Civilizations | Galactic Civilizations II | Misc
Alt.Civs | Civ I | C:CtP I | About | News | Directory | Apolyton Store | Forums | Chat | Columns | Interviews | Newsletter
Scenario League | CSC | Clash of Civs | Spanish Site | CtP Maps | Cradle of Civ | WesW's Ctp1/2 Site | Civ3 Haven

apolyton.net | apolyton.com | civilization2.net | civilization3.net | civilization4.net | civilizationiv.info | calltopower.net | galciv.net | galciv2.net | moo3.net