I like to change firebat dmg type with upgrade from concussive into normal
can someone correct my green line?
//Firebat if upgrade 57 normal damage
if(unit->id == UnitId::TerranFirebat &&
scbw::getUpgradeLevel(unit->playerId, UpgradeId::UnusedUpgrade57) > 0){
unit->status = DamageType::Normal;
}//Firebat if upgrade 57 normal damage
i also try with
weapons_dat::DamageType[DamageType::Normal]
but its either not working or "freezing" firebat.
Post has been edited 1 time(s), last time on Aug 26 2019, 7:22 am by Lagi.
None.
The status of an unit is made of constantly evolving flags.Doing "unit->status = value" is definitely wrong, unless you did "value = unit->status" before then set or unset some flags on "value" with & or | and using the "UnitStatus" enum.
SOLVED
in file
weapon_damage.cpp, search for
purple txt below //Firebat if upgrade 57 normal damage
if(weaponId == WeaponId::FlameThrower &&
scbw::getUpgradeLevel(attacker->playerId, UpgradeId::UnusedUpgrade57)){
damageType = 3; //"3" its normal damage type
}//Firebat if upgrade 57 normal damage
else{
damageType = weapons_dat::DamageType[weaponId];
}
you need also to uncomment the
hooks::injectWeaponDamageHook(); in initialize.cpp
if you activating the hook, it will overwrite the data you changed in Firegraft or datEdit.
for unused upgrade57 (in above example) you need to add cost in .dat (in datEdit or PyDat), add the button and set the requirements in Firegraft.
=======================
now, how to change the flame GRP from orange into blue?
None.

Responsible for my own happiness? I can't even be responsible for my own breakfast
Charon Boosters change the color of missile smoke from orange to blue once researched in some hardcoded way, but I don't think anyone has actually looked at how they accomplish that.
Without writing a new hook, I think the best option would be to remove the sprol call that generates the flames from the Firebat iscript, and instead put in a sigorder call (use something that it isn't already used for some purpose - I believe 64 will work). Then have your plugin detect when the Firebat's order state is 64, and create the flame overlay. Then it will be simple enough to spawn a different sprite depending on what the upgrade status is.
thanks voyager, will try iscript - sounds easier
(now i have vague clue, what you talking about

)
there is enum ColorRemapping
flamer use Ofire
and i check that Bfire is actually making them blue (with black inside but whatever)
I look into it,after I get bored with Diablo 1 Thernobog and Ancestor Legacy, i will do something, "somewhere" like this (write here to not forget or have easier time to recall):
if upg(unused57>0) (
Flamer = CImage::setRemaping(ColorRemapping::Bfire).
this would not work, but its a step in my investigation.
None.

Responsible for my own happiness? I can't even be responsible for my own breakfast
Mapping to Bexpl have the flames appear blue, without the black/transparent weirdness in the center.
I'll write an example plugin after work and show you what I'm talking about in my previous post. Keep in mind that you wouldn't necessarily want to change the mapping of the flamer image when you research the upgrade, because that would change the image for all players.
Charon Boosters change the color of missile smoke from orange to blue once researched in some hardcoded way, but I don't think anyone has actually looked at how they accomplish that.
While it's not really relevant to the topic... Hardcoded in the SPROL iscript opcode is a check if the current object is a bullet fired from a hero goliath or a goliath owned by a player with the upgrade, and if it is then it creates an overlay with an ID of 505, otherwise it creates an overlay with whatever ID was passed in the opcode's argument.
TinyMap2 - Latest in map compression! ( 7/09/14 - New build! )
EUD Action Enabler - Lightweight EUD/EPD support! (ChaosLauncher/MPQDraft support!)
EUDDB -
topic - Help out by adding your EUDs! Or Submit reference files in the References tab!
MapSketch - New image->map generator!
EUDTrig -
topic - Quickly and easily convert offsets to EUDs! (extended players supported)
SC2 Map Texture Mask Importer/Exporter - Edit texture placement in an image editor!
This page has been viewed [img]http://farty1billion.dyndns.org/Clicky.php?img.gif[/img] times!
using this plugin and playing with firebat. When i send FB to combat and they start dying, I encounter almost always error:
instruction under 0x0...0###93E5 is refering to the memory 0x0...04C. Memory can not be read.in gtpt 0x04c is playerId in CUntiLayout
it doesnt matter if i have or not upgrade - error occur.
if I comment the damagetype modification, game is stable
any idea?
None.

Responsible for my own happiness? I can't even be responsible for my own breakfast
//Firebat if upgrade 57 normal damage
if(attacker &&
weaponId == WeaponId::FlameThrower &&
scbw::getUpgradeLevel(attacker->playerId, UpgradeId::UnusedUpgrade57)){
damageType = 3; //"3" its normal damage type
}//Firebat if upgrade 57 normal damage
else{
damageType = weapons_dat::DamageType[weaponId];
}
Sounds like the Firebat is dying while its projectile was still on the map. Add a check to make sure the attacker pointer isn't NULL to avoid a null pointer dereference, like this.

Responsible for my own happiness? I can't even be responsible for my own breakfast
Here's the plugin I was describing for changing the flame color:
for (CUnit *unit = *firstVisibleUnit; unit; unit = unit->link.next) {
...
if(unit->id == UnitId::firebat && unit->orderSignal & 0x20
&& (unit->sprite->mainGraphic->animation == IscriptAnimation::GndAttkRpt
|| unit->sprite->mainGraphic->animation == IscriptAnimation::GndAttkInit)) {
unit->orderSignal &= ~(0x20);
u32 frameAngle = (unit->currentDirection1) / 8 % 32;
if(scbw::getUpgradeLevel(unit->playerId, UnusedUpgrade57))
unit->sprite->createOverlay(420, 0, 0, frameAngle);
else
unit->sprite->createOverlay(421, 0, 0, frameAngle);
}
}
void createBunkerAttackThingyHook(CUnit* unit) {
...
if (unit->id == UnitId::firebat || unit->id == UnitId::gui_montag) {
frameAngle = ((unit->currentDirection1 + 8) / 16 % 16) * 16;
if(scbw::getUpgradeLevel(unit->playerId, UpgradeId::UnusedUpgrade57))
spriteId = 372; //Firebat flamethrower graphics
else
spriteId = 378;
unit->orderSignal &= ~(0x20);
}
...
...
FirebatGndAttkRpt:
wait 1
nobrkcodestart
sigorder 32
playfram 0x11 # frame set 1
attkshiftproj 24
wait 1
attkshiftproj 52
wait 1
attkshiftproj 80
wait 5
playfram 0x00 # frame set 0
wait 2
nobrkcodeend
gotorepeatattk
ignorerest
...
Obviously you will need to have the bunker hooks enabled in initialize.cpp. I replaced the entry for image ID 420 (Plasma Drip) in images.dat with an identical copy of ID 421 (Flamethrower) and just changed the remapping to use bexpl.pcx.
woow thanks
edit:
Here's the plugin I was describing for changing the flame color:
for (CUnit *unit = *firstVisibleUnit; unit; unit = unit->link.next) {
...
if(unit->id == UnitId::firebat && unit->orderSignal & 0x20
&& (unit->sprite->mainGraphic->animation == IscriptAnimation::GndAttkRpt
|| unit->sprite->mainGraphic->animation == IscriptAnimation::GndAttkInit)) {
unit->orderSignal &= ~(0x20);
u32 frameAngle = (unit->currentDirection1) / 8 % 32;
if(scbw::getUpgradeLevel(unit->playerId, UpgradeId::UnusedUpgrade57))
unit->sprite->createOverlay(420, 0, 0, frameAngle);
else
unit->sprite->createOverlay(421, 0, 0, frameAngle);
}
}
bunker_hook need
#include <SCBW/api.h>in DatEdit i change the image values
iscript save and input into .mpg
&
it works!!!

"dont run SCV! blue flame is healing"
Post has been edited 3 time(s), last time on Dec 2 2018, 4:37 pm by Lagi.
None.
what is this ? what this do?
&& unit->orderSignal & 0x20
None.

Responsible for my own happiness? I can't even be responsible for my own breakfast
what is this ? what this do?
&& unit->orderSignal & 0x20
I was using the order signal to communicate when the flamethrower graphic needs to be created.
FirebatGndAttkRpt:
wait 1
nobrkcodestart
sigorder 32
Here in the iscript, sigorder 32 is setting the 0x20 orderSignal flag.
unit->orderSignal & 0x20 is a condition that checks if that flag is set, the code then spawns the flamethrower graphic and then finally clears the 0x20 flag so we don't spawn it again.
i dont understand how to convert sigorder into order singal flag
f.ex. corsair
CorsairCastSpell:
playfram 0x00 # Frame set 0
nobrkcodestart
wait 1
playfram 0x00 # Frame set 0
wait 1
playsnd 1059 # Protoss\Corsair\PCorWeb1.wav
castspell
nobrkcodeend
gotorepeatattk
sigorder 2
sigorder 2 , which 0x0__ would that be?
None.
thanks,
this dont work however
if((unit->mainOrderId == OrderId::CastDisruptionWeb) && (unit->orderSignal & 0x02)
&& (unit->sprite->mainGraphic->animation == IscriptAnimation::CastSpell ))
{
unit->vulture.spiderMineCount--;
None.
In your earlier iscript, you put "sigorder 2"
after "gotorepeatattk".
If you really wrote it like that, it's probably never used.