Reztea

Members
  • Content Count

    58
  • Joined

  • Last visited

  • Days Won

    6

Posts posted by Reztea


  1. Here's both scripts

    Script 1:

    // -------------------------------------------------------
    // Support function: Assign a puppet to a party member
    // -------------------------------------------------------
    void ST_GivePuppet(int nNPC, int nPUP, string sTemplate) {
        string sTag = "";
        switch (nNPC) {
            case NPC_ATTON:         sTag = "atton";         break;
            case NPC_BAO_DUR:       sTag = "baodur";        break;
            case NPC_CANDEROUS:     sTag = "mand";          break;
            case NPC_G0T0:          sTag = "g0t0";          break;
            case NPC_HANDMAIDEN:    sTag = "handmaiden";    break;
            case NPC_HK_47:         sTag = "hk47";          break;
            case NPC_KREIA:         sTag = "kreia";         break;
            case NPC_MIRA:          sTag = "mira";          break;
            case NPC_T3_M4:         sTag = "t3m4";          break;
            case NPC_VISAS:         sTag = "visasmarr";     break;
            case NPC_HANHARR:       sTag = "hanharr";       break;
            case NPC_DISCIPLE:      sTag = "disciple";      break;
        }
        
        object oOwner = GetObjectByTag(sTag);
        if (GetIsObjectValid(oOwner) && IsObjectPartyMember(oOwner)) {
            location lLoc = (GetPosition(oOwner) + AngleToVector(GetFacing(oOwner)) * 2.0, GetFacing(oOwner)-180.0);        
            
            AddAvailablePUPByTemplate(nPUP, sTemplate);
            AssignPUP(nPUP, nNPC);
            object oPUP = SpawnAvailablePUP(nPUP, lLoc);
            AddPartyPuppet(nPUP, oPUP);
            
            SetNPCAIStyle(oPUP, NPC_AISTYLE_PARTY_SUPPORT);
        }
    }
    
    
    // -------------------------------------------------------
    // Main function: Example, call above function to assign
    // a puppet in st_puppet1.utc to Kreia.
    // -------------------------------------------------------
    void main() {
        // Spawn the "st_puppet1" UTC as a puppet, assign it to Kreia
        ST_GivePuppet(NPC_MIRA, PUP_OTHER1, "mira_puppet");
    }

     

    Script 2

    // ST: st_ai_puppethb.nss
    #include "k_inc_generic"
    
    void main() {
        object oEnemy = GetNearestCreature( 
            CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN, 
            OBJECT_SELF, 1, 
            CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, 
            CREATURE_TYPE_IS_ALIVE, TRUE
        );
        
        if (!GN_GetSpawnInCondition(SW_FLAG_AI_OFF)) {
            if (GetIsPuppet()
               && (GetIsObjectValid(GetPUPOwner())
               && (GetCurrentAction(OBJECT_SELF) != ACTION_MOVETOPOINT)
               && (GetCurrentAction(OBJECT_SELF) != ACTION_FOLLOWOWNER)
               && !GetIsConversationActive()
               && !GN_GetSpawnInCondition(SW_FLAG_SPECTATOR_STATE)
               && GetCommandable() 
               && (GetDistanceBetween2D(OBJECT_SELF, GetPUPOwner()) > 3.0)
    
               && (!GetIsObjectValid(oEnemy) || (GetDistanceBetween(oEnemy, OBJECT_SELF) > 20.0))))
            {
                ClearAllActions();
                ActionFollowOwner(2.0);
            }
        }
        
        if (GN_GetSpawnInCondition( SW_FLAG_EVENT_ON_HEARTBEAT ))
            SignalEvent(OBJECT_SELF, EventUserDefined(1001));
    }

    Neither compiles though they're source scripts straight from the modder themselves.


  2. Hi, I've been trying to make a puppet script for the longest now and when it's time to compile, I'm getting a syntax error at the location line. Not sure whats wrong with it. I even went as far as to get the source scripts for JediArchivist's "[K2] Droid Companion for Mira 1.0.0" mod and try a test compiling and I'm getting the same error. The current script is: 

    // -------------------------------------------------------
    // Support function: Assign a puppet to a party member
    // -------------------------------------------------------
    void ST_GivePuppet(int nNPC, int nPUP, string sTemplate) {
        string sTag = "";
        switch (nNPC) {
            case NPC_ATTON:         sTag = "atton";         break;
            case NPC_BAO_DUR:       sTag = "baodur";        break;
            case NPC_CANDEROUS:     sTag = "mand";          break;
            case NPC_G0T0:          sTag = "g0t0";          break;
            case NPC_HANDMAIDEN:    sTag = "handmaiden";    break;
            case NPC_HK_47:         sTag = "hk47";          break;
            case NPC_KREIA:         sTag = "kreia";         break;
            case NPC_MIRA:          sTag = "mira";          break;
            case NPC_T3_M4:         sTag = "t3m4";          break;
            case NPC_VISAS:         sTag = "visasmarr";     break;
            case NPC_HANHARR:       sTag = "hanharr";       break;
            case NPC_DISCIPLE:      sTag = "disciple";      break;
        }
        
        object oOwner = GetObjectByTag(sTag);
        if (GetIsObjectValid(oOwner) && IsObjectPartyMember(oOwner)) {
            location lLoc = Location(GetPosition(oOwner) + AngleToVector(GetFacing(oOwner)) * 2.0, GetFacing(oOwner)-180.0);        
            
            AddAvailablePUPByTemplate(nPUP, sTemplate);
            AssignPUP(nPUP, nNPC);
            object oPUP = SpawnAvailablePUP(nPUP, lLoc);
            AddPartyPuppet(nPUP, oPUP);
            
            SetNPCAIStyle(oPUP, NPC_AISTYLE_PARTY_SUPPORT);
        }
    }
    
    
    // -------------------------------------------------------
    // Main function: Example, call above function to assign
    // a puppet in st_puppet1.utc to Kreia.
    // -------------------------------------------------------
    void main() {
        // Spawn the "st_puppet1" UTC as a puppet, assign it to Kreia
        ST_GivePuppet(NPC_MIRA, PUP_OTHER1, "mira_puppet");
    }

    I'm SUPER rusty at modding at the moment so go easy on me LOL. But yeah for some reason "lLoc" is not allowing the script to compile. 

    Comp1.png


  3. 2 hours ago, DarthParametric said:

    That would be a combination of scripting and plot flags I assume. The dialogue fires a script that sets the flag in one module, then the onload script in the other module checks the flag and spawns the item when it reads the proper value.

    And suddenly, I'll just use a key! One more thing though, (I'm full of complications today.) What script would I have to use to spawn an existing party member? Like if I wanted to spawn mission, for example (again, decompiled and all, no such luck)


  4. I'm back with my infamous/annoying mod questions! Does anybody know a way to spawn another item or creature in another module?? Kinda like when you speak Luzre in KotOR 1 and the mysterious box appears in the ebon hawk?? I decompiled multiple scrips but I got no specific direction as to how to create a script for this one. Can anyone help me out? Thank you!


  5. You can use SetNPCSelectability to lock a party member. 

    void main() {
    SetNPCSelectability(<Party Members Integer Value>, FALSE);
    }
    

    think the values for party members are as follows:

    0 - Bastila

    1 - Canderous

    2 - Carth

    3 - HK-47

    4 - Jolee

    5 - Juhani

    6 - Mission

    7 - T3-M4

    8 - Zaalbar

     

    But I'm not totally sure (that's just the order it goes on the party select screen). Alternatively you can use SetAreaUnescapable() which stops you from being able to change your party entirely.

    I thought that shuts down availability to be selected at all, Perhaps I should've given an example.

     

    Like when you took the basilisk to Onderon and Kreia was required to come with you. Like that, sorry for any confusing I'm causing.


  6. I don't know how the conversation in this scene is started, but you could use the creature's OnDeath script. If it's more than one creature, have the script check if any of the others are still alive (i.e. valid objects) and if they aren't, then start the conversation. That's what I would do at least.

    An example would be as if:

     

    Jedi: Let us duel!

    Sith: You've sealed your fate!

     

    *You're the Jedi, and the Sith bought backup, you need to kill every Sith there, once they all are killed, another Sith who had nothing to do with the battle but was in the module will then speak to you*

     

    You know how terrible I am with scripting, an example script would be useful. :)

     

    And what do you mean by changing the lighting? Do you want to change it with a script or just generally change it?

     

    I want to just generally change the lighting.


  7. How would I go about starting a conversation after killing a group of people? Like when Canderous and his mercenaries along with Revan and his party killed the Rakghouls in the Undercity before Canderous joined them.


     


    (K1 Script).


     


    Another thing, how can I "lock" a party member and make them required to be in your party for the time being?


     


    And one last thing. (If this simply isn't possible, I get it) Is it possible to change the lighting of a module? Im trying to get a reddish type of feel for Dantooine,


     


  8. How would I go about starting a conversation after killing a group of people? Like when Canderous and his mercenaries along with Revan and his party killed the Rakghouls in the Undercity before Canderous joined them.

     

    (K1 Script).

     

    Another thing, how can I "lock" a party member and make them required to be in your party for the time being?


  9. Hey guys! It's Reztea here, once again with a small, hopefully turned big mod, I'm currently making a mod as to where you have the opportunity to take down the Sith Quarantine on Taris, onto doing that, you will have a choice to make and that choice will affect whether Taris is destroyed or not (We'll see). This mod will include a new recruit (replacing Juhani of course). A new storyline for the recruit (Again, I don't know about that, possibly in another version.)

     

    Let me know what you guys think!

     

    A couple things! Please list any mods that you need ensured compatibility with, and answer the polls! Thank you!

     

    EDIT: Can a moderator please transfer this over to the work in progress section? I'm sorry to be a burden

    • Like 1

  10. I have played through your mod and I have found a number of bugs.

     

    1* I didn't get to go to the HK Factory even though I completed the HK Factory sidequest (Immediately after the Atris duel it went straight to Citadel Station and it worked as normal)

    2* After the Nihilus fight Atris doesn't do anything she just stays on the bridge

    3* During the Traya/Sion confrontation Traya doesn't choke sion and say her restored line Sion instead says "You were a fool to return here" then says "Why have you returned"

    4* The same confrontation played twice this time there were no Sith assassins at the start then it warped back outside the hawk as Atris with -1 health and when I healed her with heal she died

    1. I'll fix that.

    2. The script definitely removes Atris, if she doesn't run, she fades... quick question, which Atris did you recruit? Light or Dark?

    3. I didn't edit anything involving that confrontation... that's strange, I'll check the data.

    4. That's weird.. I don't think I encountered that problem.

     

    What version did you use? 3.0?


  11. I plan on getting around to trying this soon. It seems pretty interesting, but I gotta ask - why a custom party portrait for Atris when a dummied one in the style of the others' exists in game?

    I wanted transitions. They're optional, anyway. Also, Atris' in game portrait wouldn't fit her restored Traya outfit. :)

    • Like 2

  12. Oh, so no restored DS outfit for Atris? That's pretty sad. I liked the idea.

     

    Also, are you planning a compatibility patch with SLM 2.0? I mean, like, Atris comes with your old lightsaber of the color you determined by talking with Atton after Peragus. I would be grateful if you do so, this would add a bit to immersion, as this seemed to be Atris' latest weapon of choice.

    Atris does have her restored outfit. You just need to play through because I really don't want to reveal the plot only 2 hours after release. Strangely, I don't think I've ever heard of SLM. PM me more about it, I'm interested.

    • Like 1

  13. lol I almost didn't mention that because I was like "what are the odds of that!" :lol:  Anyway, glad it's working now! :D

    You saved an entire project, LOL! One final script and the entire project is COMPLETE. How would I go about delaying a conversation from happening in a script? I tried using the DelayCommand but I'm getting parameter mismatches. ( I can never make a script myself  :turned:  :turned:, here's my script.

     

    void main(){

        object oNPC = GetObjectByTag("KreiaEvil");
        DelayCommand(2.0, AssignCommand(ActionStartConversation(oNPC, OBJECT_SELF, "FinalKreia"));
    }

    A total mess! anyway, any help is appreciated, I'm gonna work on the TSLPatcher now and hopefully I'll have an answer by the time I come back (Because I take long to do everything  :mad2: )


  14. Make sure that your files are uncompressed stereo mp3 files. That's what TSL needs AFAIK.

     

    Also, have a look at these two threads. Maybe they can provide further information on the specifics of TSL soundfiles.

    Took a look at them. Tried these methods several times and it wouldn't work.. strange. If I can't get it to work then I'll find my way around the dialog. I tried decompressing them and saving them as either .WAV or .MP3. Isn't working. I'm so terrible XD. I'll see what else I can do... Sorry for troubling you.


  15. OKAY! I PROMISE! This will be the LAST thing I need help on *let's hope*. I have  custom audio files used as a voice in dialogue, I put them in my StreamVoice folder, they're .mp3 files. They won't play at all for some weird reason. Could anyone help? I have the audio files here if anyone wants check what's up with them... They won't play for the dialogue at all, I ticked the sound exists for all of them. I have no idea what to do. Any help is appreciated.

    907ARTEND03.mp3

    907ATR01.mp3

    907ATREND02.mp3

    ArtMod1.mp3


  16. Yeah, so then the setting of the global is failing, make sure that the globals are named EXACTLY as in globalcat.2da, and that the global variable type is set to Boolean. Also make sure you don't have another globalcat.2da lying around somewhere in an override subfolder or something.

    THAT was the problem! There was a globalcat.2da file in my movies folder O_O, I don't know how that got there! Permission to beat me up is all the way granted! thank you!


  17.  

    I think then you need to use a_glob_bool_set or something like that, check it out in kotor tool.

     

    When and how do the scripts to set the booleans fire? Maybe the problem is that those scripts never fire. To diagnose, you could include this in your setting scripts, then check your feedback screen after they're supposed to have run.

     

    void main(){
        SetGlobalBoolean("Recruit_Atris_E", TRUE);
    
        string sMessage = "Recruit_Atris_E setting script fired! Current value: ";
        if(GetGlobalBoolean("Recruit_Atris_E")) sMessage += "TRUE";
        else sMessage += "FALSE";
    
        SendMessageToPC(GetFirstPC(), sMessage);
    }
    

    The setting scripts fire just before the dialog that says "Atris has joined your party" dialog. I got a message! It says "Recruit_Atris_E setting script fired! Current Value: FALSE" I guess I need that to be true. It's one thing on top of another


  18. Okay, so then we need to make sure the globals are set correctly in the first place.

     

    I'm not sure whether the globals are case-sensitive, but they could be, and you're setting them in all caps, while you're getting them with only the first letter of the word capitalized. Try fixing that.

    Tried it, didn't work... I'm curious though.... Can I use a_global_set, and c_global_set, and use the string parameter??? Let me try that and I'll be back.

     

    Edit: That didn't work either. I'm about to scrap this entire project.


  19. I just checked both your posts, it seems like you never mentioned what actually goes wrong, ie. what actually happens with your current setup :lol:

     

    Anyway, I think I've had trouble in the past with using replies for directing cutscene flow like that, I don't remember the details, but you could try putting the scripts onto entry nodes instead.

    Oh sorry, Well the game chooses the dialog with no conditional, I don't know why! I put both my booleans in the Globalcat file.

    Row 999 = Recruit_Atris_E

    Row 1000 = Recruit_Atris_G.

    I made sure I used the correct set scripts, and conditions! I'm super confused. I'll attempt using entries, Let's hope it works.

     

    EDIT: No dice, seems like me and Booleans just aren't friends.