The World of Layonara  Forums

Author Topic: Toolset Scripting *looks angry and confused*  (Read 44 times)

Dominæter

  • Newbie
  • *
    • Posts: 15
      • View Profile
    Toolset Scripting *looks angry and confused*
    « on: December 30, 2005, 09:09:00 pm »
    Well i have been starting some toolset scripting but i just cant figure it out. I know some basic C++ which has proven invaluable but i can figure out how to make it work. If there is anyone here who might know how to do this please help me. Since the people at Layo seemed to do such i fine job i was hoping for some help. I checked other sites and their search is HORRIBLE. Well here is the problem.

    I cant figure out how to use Module variables. I dont even know what they are. Are they like a variable every PC gets when he joins the server? That was what i assumed. So i set a module int with name "Status" to 10. Then i made a trigger. on the "OnEnter" this is the code i put in.

    void main()
    {
    object oPC = GetEnteringObject();
    string sBla = IntToString(GetLocalInt(oPC,"Status"));
    AssignCommand(oPC,SpeakString(sBla));
    }
    Why does my person say ""
    That makes no sense! Its returning nothing. Shouldnt it be returning "hello"? Im near the end of my tolerance, please someone out there help me
    Hopelessly Stressed
    Dom
     

    Dorganath

    RE: Toolset Scripting *looks angry and confused*
    « Reply #1 on: December 30, 2005, 10:04:00 pm »
    Based on your description and your code...
      You set a module int to 10, but then tried to read that int off the PC, not the module.  So when it reads from the PC, that variable doesn't exist.  Any variables you set on the module reside on the module object.  You'd have to set a variable on the PC explicitly for it to have one to read. 
      To get your code to work, you need something like:
      object oPC = GetEnteringObject(); object oMod = GetModule(); string sBla = IntToString(oMod, "Status" ); AssignCommand(oPC, ActionSpeakString(sBla));
      Oh and try this site: http://www.nwnlexicon.com/
      Good luck!
     

    Dominæter

    • Newbie
    • *
      • Posts: 15
        • View Profile
      RE: Toolset Scripting *looks angry and confused*
      « Reply #2 on: December 31, 2005, 12:49:00 pm »
      thanks a bunch, i have that site bookmarked already :), it doesnt give many examples though. i was thinking about GetModule(), say a person talks to a NPC and gets an item ONLY once, and i set a module int to 1 or 2. 1 meaning he gets one 2 meaning he already has one. if one person walked up and i used GetLocalInt(GetModule(),"bla");
      wouldnt the next person that tries to get the item not get it?
      And can i make new variables in code? Like when a PC joins the server, make a copy of all the module variables and assign them to him?
      Would i use OnClientEnter?

      and then

      void main()
      {
      object oPC = GetEnteringObject();
      object oModule = GetModule();

      SetLocalInt(oPC,"ModInt1",GetLocalInt(oModule,"ModInt1"));
      SetLocalInt(oPC,"ModInt2",GetLocalInt(oModule,"ModInt2"));
      SetLocalString(oPC,"ModString1",GetLocalString(oModule,"ModString1"));
      SetLocalString(oPC,"ModString2",GetLocalString(oModule,"ModString2"));
      SetLocalFloat(oPC,"ModFloat1",GetLocalFloat(oModule,"ModFloat1"));
      SetLocalFloat(oPC,"ModFloat2",GetLocalFloat(oModule,"ModFloat2"));
      }

      wouldn that create new local variables on the pc i can use? Thanks for your help Dorganath i really appreciate it :)
      oh and is there any way i can make the code wait besides ActionWait, and DelayCommand?
      Dom
       

      Dominæter

      • Newbie
      • *
        • Posts: 15
          • View Profile
        RE: Toolset Scripting *looks angry and confused*
        « Reply #3 on: December 31, 2005, 07:01:00 pm »
        forget that one above, i figured it out. It works. So now i have another little problem. New death script. I want my dude to just respawn. Why do i have to use SignalEvent? Why not just and effect like EffectResurrection? or EffectREsurrect (cant remember which one.) thats really odd.
        Dom
         

         

        anything