Jump to content


Photo

Fair Strides' Script Shack


  • Please log in to reply
112 replies to this topic

#41 Fair Strides

Fair Strides

    Aurora Engine Operator

  • Administrators
  • 2,214 posts
  • LocationOregon, USA

Posted 09 April 2017 - 09:30 PM

This tends to be more of a dialog thing, but it could be that the one-liner dialog (I don't know what you have for text in the one-liner, if anything) could be playing too fast and skipping the audio file. For that, you can try setting the Delay of the one-liner entry in the .dlg file to 6 or so when you click on the line.

 

It's not an issue of audio format, since you are able to get it to play. Hmm... As for playing the audio through script from the streamwaves folder, maybe not. However, from what I've seen, you should be able to put the file in streamsounds and use the PlaySound function with the name of the audio file.


(By the way, if you ever want to ask about one of the quotes, feel free to send me a PM)

 

My personal, made-up quote: "To know is good, but to act is better."

"Words are just words, thoughts thoughts, but actions...actions are progress." - Fair Strides

"Intelligence and respect are all it takes to get along fine. Not a bad trade off, huh?" - EwigD from GameFaqs

"And regarding butchering the language, I have been to the internet. The language is well butchered regularly." - Malkior

 

"You can either live with the lies or die with the truth. Who would rather lie to live than die for telling the truth?" - Fair Strides


#42 jc2

jc2

    Kyramud

  • Members
  • PipPipPipPip
  • 310 posts
  • LocationAlderaan 19 BBY

Posted 09 April 2017 - 11:54 PM

It's not an issue of audio format, since you are able to get it to play. Hmm... As for playing the audio through script from the streamwaves folder, maybe not. However, from what I've seen, you should be able to put the file in streamsounds and use the PlaySound function with the name of the audio file.

You're a bloody genius, this works. (second option with PlaySound script function) Thanks! 


KOTOR FOR LIFE

"To ponder and find relevance, one must seek out a quote," because his own words lack the credibility to endeavor to explain his rather odd disposition.

 

Grey Jedi "Shanilia" > http://deadlystream..../1044-shanilia/

 

Thank you FS for past and current modding help! 


#43 jc2

jc2

    Kyramud

  • Members
  • PipPipPipPip
  • 310 posts
  • LocationAlderaan 19 BBY

Posted 19 April 2017 - 04:59 PM

Hey FS, 

 

I've been using the GetObjectByTag and the ChangeToStandardFaction, but I cannot seem to change the faction of copies of the UTC. 

 

For instance, I have three "tat_thug1" but only one of them changes faction. 

It reads, "// - nNth: the nth object with this tag may be requested" so I'm thinking I might have to do GetObjectByTag("tat_thug1", 1);

then GetObjectByTag("tat_thug1", 2)  ?

 

Or would it be the total GetObjectByTag("tat_thug1", 3);  instead?  

Thanks in advance! 


KOTOR FOR LIFE

"To ponder and find relevance, one must seek out a quote," because his own words lack the credibility to endeavor to explain his rather odd disposition.

 

Grey Jedi "Shanilia" > http://deadlystream..../1044-shanilia/

 

Thank you FS for past and current modding help! 


#44 bead-v

bead-v

    Evil Malachor Overlord

  • Premium Member
  • 374 posts
  • LocationSlovenia

Posted 19 April 2017 - 05:08 PM

The nNth should be a 0-based index. So the first tat_thug1 would be GetObjectByTag("tat_thug1", 0). And then 1 and 2 for the other two.


  • jc2 likes this

#45 VarsityPuppet

VarsityPuppet

    Jedi Master

  • Premium Member
  • 2,010 posts

Posted 19 April 2017 - 07:38 PM

The nNth should be a 0-based index. So the first tat_thug1 would be GetObjectByTag("tat_thug1", 0). And then 1 and 2 for the other two.

 

I can give you 2 good reasons to always start at 0

 

0) It's common practice

1) It takes care of off by one errors


Be careful how you think; your life is shaped by your thoughts. - Proverbs 4:23


#46 Fair Strides

Fair Strides

    Aurora Engine Operator

  • Administrators
  • 2,214 posts
  • LocationOregon, USA

Posted 20 April 2017 - 04:49 AM

@jc2: You guessed correctly the first time and would need to add 1 every time. If you know for sure all the copies need to be changed, you can usually get away with this:

void main()
{
    string sTag = "tat_thug1";
    int iIndex  = 0;

    while(GetIsObjectValid(GetOjbectByTag(sTag, iIndex)) == TRUE)
    {
        ChangeToStandardFaction(oTarget, STANDARD_FACTION_HOSTILE_1);
        iIndex++;
    }
}

@bead-v and VP: Thanks for adding that bit of info. I've been busy all day. Though I will point out the obvious: most non-computer systems start counting from 1, not 0. So the 0-index system isn't exactly an intuitive thing for someone to pick up on. :)


(By the way, if you ever want to ask about one of the quotes, feel free to send me a PM)

 

My personal, made-up quote: "To know is good, but to act is better."

"Words are just words, thoughts thoughts, but actions...actions are progress." - Fair Strides

"Intelligence and respect are all it takes to get along fine. Not a bad trade off, huh?" - EwigD from GameFaqs

"And regarding butchering the language, I have been to the internet. The language is well butchered regularly." - Malkior

 

"You can either live with the lies or die with the truth. Who would rather lie to live than die for telling the truth?" - Fair Strides


#47 jc2

jc2

    Kyramud

  • Members
  • PipPipPipPip
  • 310 posts
  • LocationAlderaan 19 BBY

Posted 20 April 2017 - 08:14 PM

So I've been trying to apply stealth to units, but I'm not sure how to do it. 

I can't seem to either find the correct 2da file with the effects, and/or my script is flawed. 

 

Edit: I used the visualeffects.2da to come up with the number 8002.

 

void main () {
 
object oC =GetObjectByTag("g_mandalor02", 0);
SetCommandable(TRUE, oC);
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectInvisibility(8002), oC, 100.00);
}

KOTOR FOR LIFE

"To ponder and find relevance, one must seek out a quote," because his own words lack the credibility to endeavor to explain his rather odd disposition.

 

Grey Jedi "Shanilia" > http://deadlystream..../1044-shanilia/

 

Thank you FS for past and current modding help! 


#48 Fair Strides

Fair Strides

    Aurora Engine Operator

  • Administrators
  • 2,214 posts
  • LocationOregon, USA

Posted 20 April 2017 - 09:05 PM

I've never actually done this myself, but you should be able to do the following:

void main()
{
    object oTarget    = GetObjectByTag("g_mandalor02");

    effect eInvisible = EffectInvisibility(INVISIBILITY_TYPE_NORMAL);
    eInvisible        = EffectLinkEffects(EffectVisualEffect(VFX_DUR_INVISIBILITY), eInvisible);
    eInvisible        = EffectLinkEffects(EffectVisualEffect(VFX_DUR_STEALTH_PULSE), eInvisible);

    ApplyEffectToObject(DURATION_TYPE_PERMANENT, eInvisible, oTarget);
}

You can and probably should play around with it to see if there's a difference with the second two Effect lines commented out. Same thing with a difference between "DURATION_TYPE_PERMANENT" and "DURATION_TYPE_INSTANT".


  • jc2 likes this

(By the way, if you ever want to ask about one of the quotes, feel free to send me a PM)

 

My personal, made-up quote: "To know is good, but to act is better."

"Words are just words, thoughts thoughts, but actions...actions are progress." - Fair Strides

"Intelligence and respect are all it takes to get along fine. Not a bad trade off, huh?" - EwigD from GameFaqs

"And regarding butchering the language, I have been to the internet. The language is well butchered regularly." - Malkior

 

"You can either live with the lies or die with the truth. Who would rather lie to live than die for telling the truth?" - Fair Strides


#49 jonathan7

jonathan7

    Exiled Jedi

  • Reviewer
  • 13 posts
  • LocationIvory Tower

Posted 29 April 2017 - 02:06 AM

Forgive a total noob question, Scripting never was my strong point. Is there a way to fire a script which adds a custom robe to Atton or Disciple when they become a Jedi? Currently this is implemented in their .dlg which is what is causing the incompatibility with TSL:RCM and Force Fashion

"Love is the only reality and it is not a mere sentiment. It is the ultimate truth that lies at the heart of creation." - Rabindranath Tagore

"Many a doctrine is like a window pane. We see truth through it but it divides us from truth." - Kahlil Gibran


#50 JCarter426

JCarter426

    Jedi Knight

  • M478_Staff
  • 282 posts

Posted 29 April 2017 - 02:43 AM

All party members are made Jedi with the same script, a_makejedi, and it's already divided into different trees for each party member. So all you'd have to do is attach the item spawning to the appropriate trees and recompile. Of course, that will cause incompatibility with any other mods that alter that script, but it's the most minimally intrusive way I can think of.



#51 Kexikus

Kexikus

    Jedi Master

  • Members
  • PipPipPipPipPip
  • 1,405 posts

Posted 29 April 2017 - 08:54 AM

Or you could use TSLPatcher to apply the changes to the .dlg during the installation, thus not overwriting previous changes to the same file.

#52 jonathan7

jonathan7

    Exiled Jedi

  • Reviewer
  • 13 posts
  • LocationIvory Tower

Posted 30 April 2017 - 03:10 PM

Cool, thanks for your help guys, think I'll probably go with Kexikus method, as it seems the easier for me. Good to still see you around JC :)


"Love is the only reality and it is not a mere sentiment. It is the ultimate truth that lies at the heart of creation." - Rabindranath Tagore

"Many a doctrine is like a window pane. We see truth through it but it divides us from truth." - Kahlil Gibran


#53 Qyzen_Hunter

Qyzen_Hunter

    Jedi Apprentice

  • Members
  • PipPip
  • 58 posts
  • LocationOdessen

Posted 22 May 2017 - 06:12 AM

I'm not good at scripting... But how do I trigger a conversation when the PC approaches a certain area? 


Currently working on TSL: Crisis on Corellia


#54 Fair Strides

Fair Strides

    Aurora Engine Operator

  • Administrators
  • 2,214 posts
  • LocationOregon, USA

Posted 22 May 2017 - 06:28 AM

I would need to know the context of this "certain area" to be able to help more. Primarily, you'd set up a Trigger in the area's .git file or hijack one that already exists if it's in the right spot.

 

A Trigger is a .utt file that has several events that fire scripts, one of which is an On-enter event that activates whenever something enters the area. In this case, you'd do something like this (all < > marks are ignored; you want to pay attention to what's between them):

void main()
{
    // Get the object that triggered the event
    object oTarget = GetEnteringObject();
    object oTalker = GetObjectByTag("<tag of the object/person initiating the conversation>");

    if(oTarget == GetFirstPC()) // If the triggering object is the current player-controlled character
    {
        // Have oTalker start a conversation with the PC. The code looks long because we need the last three pieces to make the
        // game ignore the distance between oTalker and oTarget. Otherwise, the player would move to oTalker first...
        AssignCommand(oTalker, ActionStartConversation(oTarget, "<name of .dlg file, minus the extension>", FALSE, CONVERSATION_TYPE_CINEMATIC, FALSE));
    }
}

(By the way, if you ever want to ask about one of the quotes, feel free to send me a PM)

 

My personal, made-up quote: "To know is good, but to act is better."

"Words are just words, thoughts thoughts, but actions...actions are progress." - Fair Strides

"Intelligence and respect are all it takes to get along fine. Not a bad trade off, huh?" - EwigD from GameFaqs

"And regarding butchering the language, I have been to the internet. The language is well butchered regularly." - Malkior

 

"You can either live with the lies or die with the truth. Who would rather lie to live than die for telling the truth?" - Fair Strides


#55 Qyzen_Hunter

Qyzen_Hunter

    Jedi Apprentice

  • Members
  • PipPip
  • 58 posts
  • LocationOdessen

Posted 22 May 2017 - 02:07 PM

 

I would need to know the context of this "certain area" to be able to help more. Primarily, you'd set up a Trigger in the area's .git file or hijack one that already exists if it's in the right spot.

 

A Trigger is a .utt file that has several events that fire scripts, one of which is an On-enter event that activates whenever something enters the area. In this case, you'd do something like this (all < > marks are ignored; you want to pay attention to what's between them):

void main()
{
    // Get the object that triggered the event
    object oTarget = GetEnteringObject();
    object oTalker = GetObjectByTag("<tag of the object/person initiating the conversation>");

    if(oTarget == GetFirstPC()) // If the triggering object is the current player-controlled character
    {
        // Have oTalker start a conversation with the PC. The code looks long because we need the last three pieces to make the
        // game ignore the distance between oTalker and oTarget. Otherwise, the player would move to oTalker first...
        AssignCommand(oTalker, ActionStartConversation(oTarget, "<name of .dlg file, minus the extension>", FALSE, CONVERSATION_TYPE_CINEMATIC, FALSE));
    }
}

Near both of the entrances of the Nar Shaddaa Landing Pad restored cantina. And if triggers once, that's it.


Currently working on TSL: Crisis on Corellia


#56 bead-v

bead-v

    Evil Malachor Overlord

  • Premium Member
  • 374 posts
  • LocationSlovenia

Posted 22 May 2017 - 02:16 PM

Near both of the entrances of the Nar Shaddaa Landing Pad restored cantina. And if triggers once, that's it.

 

You could also tie the script to the door opening instead, if it's supposed to fire the first time you go there :)



#57 Qyzen_Hunter

Qyzen_Hunter

    Jedi Apprentice

  • Members
  • PipPip
  • 58 posts
  • LocationOdessen

Posted 22 May 2017 - 04:41 PM

You could also tie the script to the door opening instead, if it's supposed to fire the first time you go there :D

Thanks! I'll keep that in mind.


Currently working on TSL: Crisis on Corellia


#58 Effix

Effix

    Jedi Padawan

  • Members
  • PipPipPip
  • 106 posts
  • LocationThe Netherlands

Posted 31 May 2017 - 05:28 PM

I have an item a_robe_47 and I'm trying to trigger my script to add it to the inventory. I tried with OnOpen and OnClosed on a corpse and a container, no luck. I can add the item with the cheats so that part should be fine.
 

void main()
{
   object oItem = GetItemPossessedBy (GetPartyLeader(),"a_robe_47");
   if (GetIsObjectValid(oItem)) {
      int nStackSize = GetItemStackSize(oItem);
      if (nStackSize < 1) 
        CreateItemOnObject("a_robe_47", GetFirstPC());
   }
}

It includes a check if the object is already owned, but it also doesn't work without that, what am I doing wrong?


zBtNZ4u.png


#59 Kexikus

Kexikus

    Jedi Master

  • Members
  • PipPipPipPipPip
  • 1,405 posts

Posted 31 May 2017 - 05:53 PM

The problem in your script is that GetIsObjectValid(oItem) will return FALSE if the player doesn't have the item, thus the CreateItemOnObject is never called. If the player does have the item, then nStackSize < 1 returns FALSE and once again, the CreateItemOnObject is not called. Basically, all you need is a condition if(!(GetIsObjectValid(oItem))). That will return TRUE only if the player doesn't have the item, so it basically does what your second condition does, only that it works^^



#60 Effix

Effix

    Jedi Padawan

  • Members
  • PipPipPip
  • 106 posts
  • LocationThe Netherlands

Posted 31 May 2017 - 06:04 PM

Ok, cool, I thought GetIsObjectValid was to test if it was an existing object. That's even shorter than I thought was needed. I'll try that, many thanks!

Edit: Worked, thanks again.
Here's a cool puppet (like Bao-Dur's remote) script by Hangout Hermit:
http://z6.invisionfr...6965/ar/t61.htm
It never led to a mod but I played around with similar scripts that were included in Cati by Princess Artemis, I gave T3 a protocol droid that followed him :D



 


zBtNZ4u.png





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users