Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

Three scripting questions

Page: 1 of 1
 Fallen Guardian
12-12-2010, 10:48 PM
#1
All right guys my first question is if you have two NPCs a and b. B isn't in the module when you first enter. Can you still set a conversation node to only become availabe for NPC A if NPC B is dead?

If the answer is yes my second question would be What is the script that only allows you to enter a conversation node if an NPC is dead.

Third question *whew* all right there is again two NPC's. This time neither of them are spawned when you get in the module. NPC A is spawned by a conversation. Is there a script that would spawn NPC B as soon as NPC A was dead?

Thanks and I'm sorry for the really confusing explanation. Couldn't think of a better way to put.
 TimBob12
12-13-2010, 2:28 AM
#2
1st question = Yes

2nd question = try using global variables. e.g. SetGlobalBoolean() (There is a tutorial in the general tutorials section)

you'd have to use a starting conditional script such as


int StartingConditional()
{
int iResult;

iResult = ((GetGlobalBoolean("BM_COLLECT") == TRUE) );

return iResult;
}


To set that global use a script such as


void main()
{
SetGlobalBoolean("BM_COLLECT", TRUE);
}


3rd question = Put a spawn script in your NPCs onDie script section e.g.


void main()
{
CreateObject(OBJECT_TYPE_CREATURE, "NPCA", Location(Vector(0.41,-7.05,1.39), 90.0));

}

}


Make sure if you use this code that is spawning from a conversation that the conversation can only be spoken once.

Hope I helped

TimBob12
 Fallen Guardian
12-13-2010, 10:29 AM
#3
Thanks TimBob12 you helped me a lot.
Page: 1 of 1