HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

In Need of JASS Script

02-21-2004, 02:11 AM#1
DoctorDoom
What I need is the Action

Run Trigger(convert string to trigger name)

In other words I have a String variable that changes and the string is the exact name of the trigger. Your selecting a unit(left click) and it takes the unit type and saves it to a string. Then runs the corresponding trigger for it. There are many, many units and a simple JASS script will work much better than alot of If/Then/Else.

Any ideas? Thanks.
02-21-2004, 02:14 AM#2
LegolasArcher
From my experiance, this is impossible. I dont think you can convert a string to a trigger.:bgrun:
02-21-2004, 02:33 AM#3
DoctorDoom
That was my fear. I looked through but couldnt find a String2Trigger code. But I thought the possibility might exist.

In UMSWE there is run trigger JASS code. What point has this? I mean if my trigger was called MyTrigger the the Jass code to run the trigger is gg_trg_MyTrigger. But can I do anything else with this? Or does anyone have any method for accomplishing this?
02-21-2004, 03:04 AM#4
LegolasArcher
Those JASS code GUI functions for using locals and custom function calls within the GUI.

For example

Custom Script: local texttag foo
Floating Text - Change the color of (JASS: foo) to 100% 20% 10% 0%
Floating Text - Destroy (JASS: foo)

It adds JASS to all the GUI types from what Ive seen. I personally perfer WEU, the new version is great.
02-21-2004, 03:05 AM#5
weaaddar
There is the cryptic ExecFunc I don't actually know what it does it may execute a function name but how can that possibly work if jass can't do a conversion of Function to string (legally anyway)
02-21-2004, 12:39 PM#6
AIAndy
ExecFunc with lots of function names works.
Another way would be to store all the triggers under their name in the gamecache. Then you can access them by name.
02-21-2004, 06:43 PM#7
DoctorDoom
Quote:
Originally posted by AIAndy
ExecFunc with lots of function names works.
Another way would be to store all the triggers under their name in the gamecache. Then you can access them by name.


Appreciate it, I'll try the game cache idea, it seems the most reasonable. It'll make life a bit easier. Thanks all for your replies.