Aller au contenu

Photo

PartyPicker, script help


  • Veuillez vous connecter pour répondre
20 réponses à ce sujet

#1
jsd313

jsd313
  • Members
  • 184 messages
I have the party picker opening from a conversation, then when closed I do an area transition. I would like to know what I need to add to make the party picker only allow 1, or 2 party members. Basically grey a slot or 2 out or lock them blank.


Thanks


[dascript]
void main()
{
    ShowPartyPickerGUI();
    DoAreaTransition("cod_2v2", "cod_2v2");
}
[/dascript]

Modifié par jsd313, 16 janvier 2010 - 03:20 .


#2
Craig Graff

Craig Graff
  • Members
  • 608 messages
Sadly, I don't think this functionality exists.

#3
jsd313

jsd313
  • Members
  • 184 messages
In the proving doesn't it do this?

#4
Craig Graff

Craig Graff
  • Members
  • 608 messages
I don't believe it does. But come to think of it you could simulate this functionality by locking a couple of party members active and then removing them from the party once the party picker is closed (module event).

#5
jsd313

jsd313
  • Members
  • 184 messages
Yeah I played around with the different follower states to get over the 4+1 problems. Only issue I see with that work around is I have 2 variables that are not standard, allow 1, and allow 2.

#6
jsd313

jsd313
  • Members
  • 184 messages
Maybe I would be better off having my area scripts spawn equal number of creatures to party size.  Can I setup something for the last 2 creatures to do a check before they spawn to see if oFollower2 or 3 is Valid? And if so what other variables might I need to get it to fire?
[dascript]
case EVENT_TYPE_AREALOAD_PRELOADEXIT:
     {
    object oWaypoint = GetObjectByTag("tot4v4_team1");
    Safe_Destroy_Object( UT_GetNearestObjectByTag( oWaypoint, "paladin02" ), 0 );
         SetTag( CreateObject( OBJECT_TYPE_CREATURE, R"paladin02.utc", GetSafeLocation( GetLocation( oWaypoint )) ), "paladin02" );
      }
        {
    object oWaypoint = GetObjectByTag("tot4v4_team2");
    Safe_Destroy_Object( UT_GetNearestObjectByTag( oWaypoint, "rogue01" ), 0 );
         SetTag( CreateObject( OBJECT_TYPE_CREATURE, R"rogue01.utc", GetSafeLocation( GetLocation( oWaypoint )) ), "rogue01" );
        }
        {   
    object oWaypoint = GetObjectByTag("tot4v4_team3");
    Safe_Destroy_Object( UT_GetNearestObjectByTag( oWaypoint, "mage01" ), 0 );
     SetTag( CreateObject( OBJECT_TYPE_CREATURE, R"mage01.utc", GetSafeLocation( GetLocation( oWaypoint )) ), "mage01" );
        }
        {     
    object oWaypoint = GetObjectByTag("tot4v4_team4");
    Safe_Destroy_Object( UT_GetNearestObjectByTag( oWaypoint, "healer01" ), 0 );
     SetTag( CreateObject( OBJECT_TYPE_CREATURE, R"healer01.utc", GetSafeLocation( GetLocation( oWaypoint )) ), "healer01" );
        }
    break;
    }
[/dascript]

Modifié par jsd313, 16 janvier 2010 - 04:58 .


#7
Craig Graff

Craig Graff
  • Members
  • 608 messages
Use this bit of code:
[dascript]
object[] arParty = GetPartyList();
int n;
int nPartyMembers;
int nPartySize = GetArraySize(arParty);

for (n = 0; n < nPartySize; n++)
{
    if (!IsSummoned(arParty[n]))
    {
        nPartyMembers++;  
    }
}
[/dascript]
and combine it with a conditional like
if (nPartyMembers >= 3)
// summon 3rd team member
if (nPartyMembers >= )
// summon 4th team member

#8
Sunjammer

Sunjammer
  • Members
  • 925 messages
If memory serves the Provings uses a conversation rather than the party picker for team selection and is exactly the sort of thing we need an optional NWN1 style conversation-in-a-box GUI for.

Modifié par Sunjammer, 16 janvier 2010 - 06:17 .


#9
Craig Graff

Craig Graff
  • Members
  • 608 messages
I think the popup GUI generally works fine for things like that.

Modifié par Craig Graff, 16 janvier 2010 - 07:33 .


#10
jsd313

jsd313
  • Members
  • 184 messages
Works great, now I can delete 18 areas and 36 scripts lol.

Either of you have an idea for my last major problem.. Reseting all cooldowns on areaload?

Thanks guys

#11
Craig Graff

Craig Graff
  • Members
  • 608 messages
This might work:
[dascript]
object[] arParty = GetPartyList();
object oPartyMember;
int n, m;
int nPartySize = GetArraySize(arParty);

for (n = 0; n < nPartySize; n++)
{     
    oPartyMember = arParty[n];
    for (m = 0; m < 50; m++)
    {
        Ability_SetCooldown(oPartyMember, GetQuickslot(oPartyMember, m));
    }
}    
[/dascript]

#12
Sunjammer

Sunjammer
  • Members
  • 925 messages

Craig Graff wrote...

I think the popup GUI generally works fine for things like that.

Okay lets say you've got potentially eight companions you can select (though you may not have found them all) and (depending on the round) you are allowed to select either 1, 2 or 3 companions.  How would you do that using just the popup GUI?

I considered displaying all the options in the popup's message text and have the player use the input field to enter either a name (error prone) or a number (less error prone).  Also has the custom token been implemented and does it work in the popup GUI? If not then you have to use pre-defined static text rather than a dynamic list so it can display companions already picked and potentially companions that haven't been unlocked yet.

Alternatively I considered displaying all the options on the popup's buttons which allows it to be more dynamic but would require up to three "pages" (you only get 3 names plus "next" on the first "page"; two names plus "next" and "previous" on the (optional) second page; and three names plus "previous" on the last page).

Now add the option to remove any of the companions you've selected and a confirmation/cancel option ...

Then you contrast that with using an NWN1 style conversation-in-a-box where all eight options (sixteen if you include the remove options) can be conditionally displayed on a single "page" based on wether or not they are a) in the party pool and B) in the active party.  Comfirmation is conditioned on the active party size and the cancel options is simply a static node.

#13
jsd313

jsd313
  • Members
  • 184 messages
It looks like this work around is going to work, it's not what I had intended but I have it set that now in my main conversation you are given 22 followers :) And then when you go to enter an arena you no longer select a bracket you just go and it will set the team size based on the party size.

This took away a lot of my flexability but I am ok with that if I can avoid people going into 3v3 matches with a full party.



But if we could do something to the code to lock those slots, that would be huge. I'm going to go pop Craigs code in see if we have a cooldown fix :)




#14
jsd313

jsd313
  • Members
  • 184 messages
Craig, that script is doing something, its calling everything onto cooldown heh. So looks like we're close!

#15
jsd313

jsd313
  • Members
  • 184 messages
Ok I got it working for the abilities, but potion cooldowns are not resetting.



I have the potion CD's of the same type linked and set to 45 seconds. I'm doing this through 2da and ability_core. How would I call in my area script to do a rest on those quickitems?




#16
Craig Graff

Craig Graff
  • Members
  • 608 messages

Sunjammer wrote...

Craig Graff wrote...

I think the popup GUI generally works fine for things like that.

Okay lets say you've got potentially eight companions you can select (though you may not have found them all) and (depending on the round) you are allowed to select either 1, 2 or 3 companions.  How would you do that using just the popup GUI?

I considered displaying all the options in the popup's message text and have the player use the input field to enter either a name (error prone) or a number (less error prone).  Also has the custom token been implemented and does it work in the popup GUI? If not then you have to use pre-defined static text rather than a dynamic list so it can display companions already picked and potentially companions that haven't been unlocked yet.

Alternatively I considered displaying all the options on the popup's buttons which allows it to be more dynamic but would require up to three "pages" (you only get 3 names plus "next" on the first "page"; two names plus "next" and "previous" on the (optional) second page; and three names plus "previous" on the last page).

Now add the option to remove any of the companions you've selected and a confirmation/cancel option ...

Then you contrast that with using an NWN1 style conversation-in-a-box where all eight options (sixteen if you include the remove options) can be conditionally displayed on a single "page" based on wether or not they are a) in the party pool and B) in the active party.  Comfirmation is conditioned on the active party size and the cancel options is simply a static node.

Ah, you meant something different than I thought you did. I misinterpreted conversation in a box to be the chat window.

#17
jsd313

jsd313
  • Members
  • 184 messages
This isn't working it is initiating all ability cooldowns instead of clearing any already active. I thought I had it working but I didn't test it good enough lol.

Anyone know what would reverse this?

[dascript]
object[] arParty = GetPartyList();
object oPartyMember;
int n, m;
int nPartySize = GetArraySize(arParty);

for (n = 0; n < nPartySize; n++)
{     
    oPartyMember = arParty[n];
    for (m = 0; m < 50; m++)
    {
        Ability_SetCooldown(oPartyMember, GetQuickslot(oPartyMember, m));
    }
}  
[/dascript]
 

Also I'm trying to use Gore_RemoveAllGore and Effects_RemoveAllEffects when I enter to clean up the blood and any buffs/debuffs the party might have. I don't know enough scripting to get the variables to work right.

Modifié par jsd313, 17 janvier 2010 - 02:54 .


#18
Craig Graff

Craig Graff
  • Members
  • 608 messages
Try this line instead
[dascript]
Ability_SetCooldown(oPartyMember, GetQuickslot(oPartyMember, m), OBJECT_INVALID, 0.1);
[/dascript]

You most likely don't want to remove all effects, but only the combat related ones.

I would suggest using
[dascript]
                Effects_RemoveUpkeepEffect(oPartyMember, 0);
                RemoveEffectsDueToPlotEvent(oPartyMember);
[/dascript]

Modifié par Craig Graff, 17 janvier 2010 - 04:07 .


#19
jsd313

jsd313
  • Members
  • 184 messages
For some reason that code breaks several parts of my game heh. No rezz for hero or party after area transition, and party picker gets bugged and is unusable. If I block the code out it goes back to working as normal.

[dascript]
#include "utility_h"
void main()
{
   int nEventHandled = FALSE;
   switch( GetEventType( GetCurrentEvent() ))
    {
      case EVENT_TYPE_AREALOAD_PRELOADEXIT:
       HealPartyMembers(FALSE, TRUE);
       Injury_RemoveAllInjuriesFromParty();
       Disease_RemoveAllDiseasesFromParty();
       SetLocalInt(GetModule(), AI_DISABLE_TABLES, 0);
      
       //object[] arParty = GetPartyList();
       //object oPartyMember;
       //int n, m;
       //int nPartySize = GetArraySize(arParty);
       //for (n = 0; n < nPartySize; n++)
       //{
       //oPartyMember = arParty[n];
       //for (m = 0; m < 50; m++)
       //{
       //Ability_SetCooldown(oPartyMember, GetQuickslot(oPartyMember, m), OBJECT_INVALID, 0.1);
       //}
       //Effects_RemoveUpkeepEffect(oPartyMember, 0);
       //RemoveEffectsDueToPlotEvent(oPartyMember);
   break;
    }
    {
   if ( !nEventHandled ) HandleEvent( GetCurrentEvent(), RESOURCE_SCRIPT_AREA_CORE );
    }
}
[/dascript]

Modifié par jsd313, 17 janvier 2010 - 06:48 .


#20
jsd313

jsd313
  • Members
  • 184 messages
Any more ideas on that script Craig? I'm going to release my first public beta today regardless but I was hoping to solve this first :)

#21
jsd313

jsd313
  • Members
  • 184 messages
Can't post my mod on this site it still won't accept my uploads. I have it on this site though if any of you have been curious about it.



http://www.dragonage...file.php?id=590