View Issue Details

IDProjectCategoryView StatusLast Update
0004825Spring engineUnit Scriptingpublic2015-06-20 12:43
ReporterGoogle_Frog Assigned Tohokomoko  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version98.0.1+git 
Summary0004825: 98.0.1-841 Weapons fire from the wrong gun
DescriptionThere are units which have two guns which fire alternately. These guns are implemented by a single weapon with alternating return value in QueryWeapon. These guns also tend to have animation (mostly recoil or muzzle effects) implemented in their script. The bug is that in the latest engine versions the animation and projectile spawn occur at different barrels.

This is not technically an engine bug. But I want to know whether the behaviour change is accidentally/unnecessary before I change several scripts. Also many other game devs would have to do similar work if the change in behaviour is required.

The spiderassault script is a simple example which works with the old behaviour:
https://github.com/ZeroK-RTS/Zero-K/blob/master/scripts/spiderassault.lua

The old behaviour seemed to call FireWeapon before calling QueryWeapon to get the piece which should emit the projectile. For example in the spiderassault script the barrel shoot from is swapped when FireWeapon is called and the recoil is done with the new barrel. Then (I assume) the engine calls QueryWeapon because QueryWeapon would only return the correct flare if FireWeapon was called first.
Steps To ReproduceStart ZK and spawn spiderassault. Tell the unit to attack ground and watch the muzzle effect and recoil.
TagsNo tags attached.
Checked infolog.txt for Errors

Activities

Google_Frog

2015-06-20 09:04

reporter   ~0014649

Cob scripts appear to be unaffected. I tested this with corflak from ZK.

hokomoko

2015-06-20 12:43

developer   ~0014651

Fix 820fefa9765f1d8360895f72c921f0079ab1268e committed to develop branch: Fix 0004825, repo: spring changeset id: 5175

Issue History

Date Modified Username Field Change
2015-06-20 06:35 Google_Frog New Issue
2015-06-20 09:04 Google_Frog Note Added: 0014649
2015-06-20 12:43 hokomoko Changeset attached => spring develop 820fefa9
2015-06-20 12:43 hokomoko Note Added: 0014651
2015-06-20 12:43 hokomoko Assigned To => hokomoko
2015-06-20 12:43 hokomoko Status new => resolved
2015-06-20 12:43 hokomoko Resolution open => fixed