Hello,
Is it possible to assign commands to more than one object at a time ?
object oNPCa
object oNPCb
AssignCommand(oNPCa and oNPCb, ActionSpeakString(sString,nVolume));
Ed
Hello,
Is it possible to assign commands to more than one object at a time ?
object oNPCa
object oNPCb
AssignCommand(oNPCa and oNPCb, ActionSpeakString(sString,nVolume));
Ed
Hello,
Is it possible to assign commands to more than one object at a time ?
object oNPCa
object oNPCb
AssignCommand(oNPCa and oNPCb, ActionSpeakString(sString,nVolume));
Ed
AssignCommand(oNPCa, ActionSpeakString(sString,nVolume));
AssignCommand(oNPCb, ActionSpeakString(sString,nVolume));
void doStuff(object oNPC)
{
}
void main()
{
object oNPCa;
object oNPCb;
doStuff(oNPCa);
doStuff(oNPCb);
}
Modifié par WhiteTiger, 01 août 2014 - 10:04 .
No point in clearing the action queue for speaking strings. If you want to have higher priority than the actions use SpeakString(), if you wish for the actions to resolve themselves, use ActionSpeakString().
Okay,
I want to apologize to you all. I was trying to be brief( Up early trying to get some work done before rushing to work).
I'll abreviate where I can.
Here is the set up. I placed 4 NPCs in an area. A trigger spawns 24 more NPCs. The 24 are divided into 3 factions(groups).
When the 24 are spawned, they are assigned 24 new tags. The script is set on HB of a placeable. It uses Set and GetLocalInt to controll the pace of actions in the area I know that before it's finished it's going to get big.
This is the chopped down version that I have so far.
object oPC
object oArea Tag
objects Tags of the placed NPCs
object Placeable OBJECT_SELF
if(GetArea(oPC) == oArea)//List of Variables only if PC is in Area &
{
if(GetIsNight())// if it is night.
{
24 objects Tags
Various ints, strings,ect
// BEGIN SCRIPT//
if(GetLocalInt(oCase,"Brawl") == 4)
{
AssignCommand(oShA,ActionSpeakString("When Her Boyfriend's Gone Away!",nVolS));
SetLocalInt(oCase,"Brawl",5);
}
else
{
if(GetLocalInt(oCase,"Brawl") == 3)
{
AssignCommand(oShA,ActionSpeakString("3rd line?",nVolS));
SetLocalInt(oCase,"Brawl",4);
}
else
{
if(GetLocalInt(oCase,"Brawl") == 2)
{
AssignCommand(oShA,ActionSpeakString("2nd line",nVolS));
SetLocalInt(oCase,"Brawl",3);
}
else
{
if(GetLocalInt(oCase,"Brawl") == 1)
{
AssignCommand(oShA,ActionSpeakString("1st line of dirty song!",nVolS));
SetLocalInt(oCase,"Brawl",2);
}
else
{
SetLocalInt(oCase,"Brawl",1);
} // int 1
} // int 2
} // int 3
} // int 4
} //IsNight
} //oArea
}
This is the first verse of the song(2 more to go). As it is currently writen, the first NPC sings all 4 lines and then starts from the beginning.
What I am trying to do is to have some of the group of 8 singing, some drinking, some laughing and so on. The same for the other 16. It is eventualy going to turn into a barroom brawl.
And here is where being a noob sucks. I am not such a noob that I didn't know I could assign the commands individualy, but I am enough of a noob to scratch my head and look confused when I read White Tiger's post. From what I've read on the lexicon, it's called a wrapper function ? Don't get it.
So,if any of you could give me some help(small words and an ocassional slap on the back of the head), I would be most grateful.
Ed.
void doStuff()
{
ActionSpeakString("Line 1",nVolS));
ActionWait(5);
ActionSpeakString("Line 2",nVolS));
// ... and so on
}
void main()
{
AssignCommand(oNPC1, doStuff());
AssignCommand(oNPC2, doStuff());
}
To vary which set of actions each actor is doing, you might choose their action using random().