Skajaquada
Crazy Engineer
- Joined
- Mar 4, 2007
- Messages
- 134
I've been playing around with this a little and though it really seem like one of the most important events it's behavior is very strange. I'm just doing something very simple where I want to change a part of the name based on what Civilization built the unit. In the FireTuner all the prints show that it's working with print-outs for the civilization-type, original name and new name. However in-game, with all the units that a civilization started with the part of the unit-name always seem to correspond with one of the civilization's special name.
I've tried doing some things like assigning an array with every built unit's ID and true or fase if it've already been built so it doesn't fire again for the same unit, however this problem really seem to go beyond all reason... Is there anything I'm missing? It really feels like variables I use to build the new unit-name are pointers or something that later gets updated but they're just normal "local namePart"-variables in LUA inside the function for the event.
One work-around I tried that failed was to check if player is human with the "isHuman"-function but then it never ran, or rather it was never true. I tried that as the event doesn't seem to run for the computer-player anyway. If there's something there I'm missing as well I'd appreciate the help as that seem like the most reasonable way.
I've tried doing some things like assigning an array with every built unit's ID and true or fase if it've already been built so it doesn't fire again for the same unit, however this problem really seem to go beyond all reason... Is there anything I'm missing? It really feels like variables I use to build the new unit-name are pointers or something that later gets updated but they're just normal "local namePart"-variables in LUA inside the function for the event.
One work-around I tried that failed was to check if player is human with the "isHuman"-function but then it never ran, or rather it was never true. I tried that as the event doesn't seem to run for the computer-player anyway. If there's something there I'm missing as well I'd appreciate the help as that seem like the most reasonable way.