Hello. I am looking for a reliable way to change a unit's graphic during a match, hopefully through plugins. As of this moment, the only method I can think of is giving the unit an order that causes it to run a specific iscript animation, and during that animation, hide the current overlay and replace it with another one.
However, this method requires a bit of extra overhead (such as the use of an orders.dat entry, which I find to be extremely involved in hardcoded processes and I feel that I only have so few controllable orders to use). Also, the order might run the risk of being cancelled by the player, which I would also not want.
I hope that someone can help me to use the render, draw, and update functions present in the image classes that I found in BWAPI's source, as they look fairly relevant.
Unit Image Changing
- Hydrolisk
- Posts: 39
- Joined: Mon Sep 15, 2008 8:39 pm [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
Unit Image Changing
Thank you for your time.
- Hydrolisk
- Posts: 39
- Joined: Mon Sep 15, 2008 8:39 pm [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
I have solved the previous issue, but I am now confronted with a new (but minor) one.
Apparently, iscript's "followmaingraphic" doesn't allow an image that uses it to follow the parent's frames besides the first frameset.
Anyone know a way around this or solution?
(What I have is a Zealot unit and a Zealot with wings GRP. Upon casting a spell, the Zealot unit spawns a Zealot with wings image, which uses followmaingraphic. The Zealot with Wings makes the unit look a bit awkward though, since it doesn't follow attack and walk animations. How to fix?)
Apparently, iscript's "followmaingraphic" doesn't allow an image that uses it to follow the parent's frames besides the first frameset.
Anyone know a way around this or solution?
(What I have is a Zealot unit and a Zealot with wings GRP. Upon casting a spell, the Zealot unit spawns a Zealot with wings image, which uses followmaingraphic. The Zealot with Wings makes the unit look a bit awkward though, since it doesn't follow attack and walk animations. How to fix?)
Thank you for your time.
-
- Posts: 45
- Joined: Sat Jun 25, 2011 1:03 am [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
Does your zealot with wings image have the same ammount of frames as the zealot?
followmaingraphic works well for shadows, may be its because its created in the cast spell animation instead in the init animation.
Another solution can be create a new iscrip for the zealot with wings. This will be an exact copy of the zealot iscrip except that you should remove the attack command and the overlay image in the castspell animation (you can also remove the sounds). The problem is that you will need 2 iscrip for each unit that will have this type of morph.
followmaingraphic works well for shadows, may be its because its created in the cast spell animation instead in the init animation.
Another solution can be create a new iscrip for the zealot with wings. This will be an exact copy of the zealot iscrip except that you should remove the attack command and the overlay image in the castspell animation (you can also remove the sounds). The problem is that you will need 2 iscrip for each unit that will have this type of morph.
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
Who is online
Users browsing this forum: No registered users and 1 guest