Unit Image Changing

Help - Resources - AI Scripting - Grafting - Plugins - Modding Projects
[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
User avatar
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

Postby Hydrolisk » Sat Aug 18, 2012 12:07 pm

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.
Thank you for your time.
User avatar
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

Postby Hydrolisk » Fri Aug 24, 2012 12:39 pm

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?)
Thank you for your time.
RavenWolf
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

Postby RavenWolf » Fri Aug 24, 2012 1:14 pm

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.
User avatar
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

Postby Hydrolisk » Fri Aug 24, 2012 1:29 pm

I examined the iscript of the shadows just now and found that followmaingraphic needs to be called every frame in order to update.

I have implemented the fix and it is working fine now.
Thank you for your time.

[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
[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
[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

Return to “StarCraft Modding”

Who is online

Users browsing this forum: Bing [Bot] and 1 guest