HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Starting new threads with input parameters - Help Needed!

05-04-2005, 06:15 PM#1
Tommi
I've come across the following problem:

I need to start to simultaneous threads that call the same function with different parameters. Normally the function is called by triggers, which run concurrently. But now I need to run the function for all players with different input parameters, a call which is started in one trigger. Here is what I have thought of:

1. I use ExecuteFunc but I need to input parameters
Q: Is there a way to input parameters to the function run by ExecuteFunc?

2. I start several triggers using TriggerExecute (or TriggerExecuteWait, what's the difference?)
Q: How do I pass reliably data to these concurrent triggers?

3. I reprogram the function somehow to take force instead of player as an input parameter (not easy, but could be possible)

I need your help. How this should be done?

Thanks in advance,

Tommi
05-04-2005, 09:48 PM#2
Vexorian
There is no way to pass parameters to triggerexecute or executefunc.

The only thing we can do is ab(using) global variables for that, or may be gamecache (but that's slower)

I don't understand 3.
05-05-2005, 09:04 AM#3
Tommi
Ok, thanks. I managed to solve the problem by creating several intermediate functions, which called the function with different parameters. I called these intermediate function depending on the PlayerId by using ExecuteFunc. This was possible, because there were a finite number of players.

(3) was an idea that I would code the multiple player case to the called function itself, but actually it would have been hard and clumsy to implement.