Staredit Network > Forums > Modding Assistance > Topic: Set of bugs that I can't squish
Set of bugs that I can't squish
Apr 8 2021, 8:18 pm
By: Pandut  

Apr 8 2021, 8:18 pm Pandut Post #1

I'm just a fish

Yo, it's me again having more problems. It seems in my case, I fix one problem in my mod and 3 more pop out of nowhere. I'll be to the point, I'm currently dealing with 3 bugs that I have no clue how to fix. These bugs have pretty much permanently halted work on my mod.

#1 - Buildings cannot cast spells nor launch nukes.
In my mod, I'm trying to implement special structures for each faction that have access to unique abilities that can be used map-wide. The only problem, is that the buildings simply refuse to cast anything that is not Scanner Sweep. I've set all the proper iscript entries, any needed CastSpell and SpecialState1/2 iscript entries, weapon.dat entries allow these spells to be cast at 360 degrees. Firegraft entries set these buildings as the caster requirements for the spell, everything is properly set up but the buildings simply do nothing. I can give scanner sweep to a nuke silo and it'll work fine, but trying to get the nuke silo to launch it's own nuke has been an ordeal. I don't know if this is something that's hardcoded or not.

#2 - Custom melee.trg will not work
Some things in my mod require melee.trg edits in order to work, but my custom trgs will not function. It just defaults to the vanilla starcraft trg. Even an edit as tiny as changing starting minerals from 50 to 51 doesn't work. I don't know if something else needs to be done to get melee.trg to work properly, as I have made mods in the past with working custom trgs but I don't remember what I did to get it working. Using a working trg from a previous mod has no effect either.

#3 - Reaver doesn't work properly when made an air unit
In my mod, the reaver acts as an extremely fast and agile bomber unit and flies in, drops its scarabs and flies out. Unfortunately, when I set the reaver's elevation to any level of Air, it stops working a good 75% of the time. Rather than stopping when in range to attack, the reaver will sometimes just fly above the targets head and sit there. Other times trying to attack a target gives an "Unable to attack target" error. Changing the reaver back to ground elevation fixes the issue completely. Changing the scarab's elevation has no effect, nor does changing the reaver's speed from flingy control to iscript control. This issue also occurs on a blank mod that only changes reaver speed/elevation.



None.

Apr 9 2021, 12:09 pm Voyager7456 Post #2

Responsible for my own happiness? I can't even be responsible for my own breakfast

Quote from Pandut
Yo, it's me again having more problems. It seems in my case, I fix one problem in my mod and 3 more pop out of nowhere. I'll be to the point, I'm currently dealing with 3 bugs that I have no clue how to fix. These bugs have pretty much permanently halted work on my mod.

#1 - Buildings cannot cast spells nor launch nukes.
In my mod, I'm trying to implement special structures for each faction that have access to unique abilities that can be used map-wide. The only problem, is that the buildings simply refuse to cast anything that is not Scanner Sweep. I've set all the proper iscript entries, any needed CastSpell and SpecialState1/2 iscript entries, weapon.dat entries allow these spells to be cast at 360 degrees. Firegraft entries set these buildings as the caster requirements for the spell, everything is properly set up but the buildings simply do nothing. I can give scanner sweep to a nuke silo and it'll work fine, but trying to get the nuke silo to launch it's own nuke has been an ordeal. I don't know if this is something that's hardcoded or not.

In units.dat, is the building's right-click action set to "Nothing (with indicator)?"

Quote
#2 - Custom melee.trg will not work
Some things in my mod require melee.trg edits in order to work, but my custom trgs will not function. It just defaults to the vanilla starcraft trg. Even an edit as tiny as changing starting minerals from 50 to 51 doesn't work. I don't know if something else needs to be done to get melee.trg to work properly, as I have made mods in the past with working custom trgs but I don't remember what I did to get it working. Using a working trg from a previous mod has no effect either.
Have you stripped the headers from the .trg file?



all i am is a contrary canary
but i'm crazy for you
i watched you cradling a tissue box
sneezing and sniffling, you were still a fox


Modding Resources: The Necromodicon [WIP] | Mod Night
My Projects: SCFC | ARAI | Excision [WIP] | SCFC2 [BETA] | Robots vs. Humans | Leviathan Wakes [BETA]


Apr 9 2021, 3:18 pm IlyaSnopchenko Post #3

The Curious

Gotta remember that first one. Voyager, you're great as always!



Trial and error... mostly error.

Apr 9 2021, 7:01 pm Pandut Post #4

I'm just a fish

Quote from Voyager7456

In units.dat, is the building's right-click action set to "Nothing (with indicator)?"
I set that in units.dat for the Nuke Silo but it still doesn't want to work. For reference I got it set up like this in units.dat-
Computer Idle - Script (Computer)
Human Idle - Idle (Nuclear Silo)
Return to Idle - Idle (Nuclear Silo)
Attack Unit - Nothing 2 (Normal)
Attack Move - Nothing 2 (Normal)
Right-click Action - Nothing (With indicator)
Ai Internal - 3

EDIT: I forgot to mention, but I do have the Firegraft edit enabled that allows all units to use the launch nuke ability.

Quote from Voyager7456
Have you stripped the headers from the .trg file?
This is probably the culprit because I had no idea aha. How would one go about stripping the headers?



None.

Apr 9 2021, 11:22 pm Voyager7456 Post #5

Responsible for my own happiness? I can't even be responsible for my own breakfast

Quote from Pandut
Quote from Voyager7456

In units.dat, is the building's right-click action set to "Nothing (with indicator)?"
I set that in units.dat for the Nuke Silo but it still doesn't want to work. For reference I got it set up like this in units.dat-
Computer Idle - Script (Computer)
Human Idle - Idle (Nuclear Silo)
Return to Idle - Idle (Nuclear Silo)
Attack Unit - Nothing 2 (Normal)
Attack Move - Nothing 2 (Normal)
Right-click Action - Nothing (With indicator)
Ai Internal - 3

EDIT: I forgot to mention, but I do have the Firegraft edit enabled that allows all units to use the launch nuke ability.
I played around with this a little and I found that it does work, it's just the order requires the unit to turn. But if you target it within sight range of the silo and directly north, it will launch. I'm assuming this is hardcoded because I didn't see anything in orders.dat that looked relevant. I tried using the Use Weapon Targeting flag and setting the attack angle, but that didn't work.

I can poke around a little further and see how difficult it would be to hook this, assuming you're using 1.16.1.

Quote from Pandut
Quote from Voyager7456
Have you stripped the headers from the .trg file?
This is probably the culprit because I had no idea aha. How would one go about stripping the headers?

It's been a very long time since I messed around with .got files, but I am assuming that the "Convert .trg to GOT compatible" button in PyGOT is equivalent to the old "Strip headers" from GotEd. I haven't tried it personally though.



all i am is a contrary canary
but i'm crazy for you
i watched you cradling a tissue box
sneezing and sniffling, you were still a fox


Modding Resources: The Necromodicon [WIP] | Mod Night
My Projects: SCFC | ARAI | Excision [WIP] | SCFC2 [BETA] | Robots vs. Humans | Leviathan Wakes [BETA]


Apr 10 2021, 2:40 am Pandut Post #6

I'm just a fish

Quote from Voyager7456
I played around with this a little and I found that it does work, it's just the order requires the unit to turn. But if you target it within sight range of the silo and directly north, it will launch. I'm assuming this is hardcoded because I didn't see anything in orders.dat that looked relevant. I tried using the Use Weapon Targeting flag and setting the attack angle, but that didn't work.

I can poke around a little further and see how difficult it would be to hook this, assuming you're using 1.16.1.
Yeah, I'm using 1.16.1, I've honestly exhausted what I could do to get it to work. Atm, my only real solution is having a dummy unit making use of the infinite nuke range edit in FireGraft. I thought I could try and use a turret akin to the science vessel but that didn't pan out either.


Quote from Voyager7456
It's been a very long time since I messed around with .got files, but I am assuming that the "Convert .trg to GOT compatible" button in PyGOT is equivalent to the old "Strip headers" from GotEd. I haven't tried it personally though.
Yeah that was it, saved with GOT compatibility and it's working now, thank you :D.



None.

Apr 10 2021, 1:58 pm Voyager7456 Post #7

Responsible for my own happiness? I can't even be responsible for my own breakfast

Quote from Pandut
Quote from Voyager7456
I played around with this a little and I found that it does work, it's just the order requires the unit to turn. But if you target it within sight range of the silo and directly north, it will launch. I'm assuming this is hardcoded because I didn't see anything in orders.dat that looked relevant. I tried using the Use Weapon Targeting flag and setting the attack angle, but that didn't work.

I can poke around a little further and see how difficult it would be to hook this, assuming you're using 1.16.1.
Yeah, I'm using 1.16.1, I've honestly exhausted what I could do to get it to work. Atm, my only real solution is having a dummy unit making use of the infinite nuke range edit in FireGraft. I thought I could try and use a turret akin to the science vessel but that didn't pan out either.

Ah, I'm happy to report that this was actually much easier than I originally thought. Somehow I missed this code the first time I looked at the nuke order hooks in GPTP.

In nuke_orders.cpp in the function orders_NukeGround(), there is a check:

Code
            if(direction < -1 || direction > 1)
                bEndThere = true;


Remove this (or add a conditional to exclude the buiding's unit ID) and the buildings are able to nuke fine.

I'm not sure how much experience you have using GPTP, I can explain in greater detail if you want.

The reaver thing will require a little more work, I'm sure there's hardcode checking to see if there's a ground path from the Reaver to its target, but I'm not sure where.

EDIT: the function at 0x00476730 has a check to see if Reavers have a ground path to their target when attacking. Seems like that will need to be hooked.

Post has been edited 1 time(s), last time on Apr 10 2021, 3:19 pm by Voyager7456.



all i am is a contrary canary
but i'm crazy for you
i watched you cradling a tissue box
sneezing and sniffling, you were still a fox


Modding Resources: The Necromodicon [WIP] | Mod Night
My Projects: SCFC | ARAI | Excision [WIP] | SCFC2 [BETA] | Robots vs. Humans | Leviathan Wakes [BETA]


Apr 10 2021, 7:33 pm Pandut Post #8

I'm just a fish

Quote from Voyager7456
Quote from Pandut
Quote from Voyager7456
I played around with this a little and I found that it does work, it's just the order requires the unit to turn. But if you target it within sight range of the silo and directly north, it will launch. I'm assuming this is hardcoded because I didn't see anything in orders.dat that looked relevant. I tried using the Use Weapon Targeting flag and setting the attack angle, but that didn't work.

I can poke around a little further and see how difficult it would be to hook this, assuming you're using 1.16.1.
Yeah, I'm using 1.16.1, I've honestly exhausted what I could do to get it to work. Atm, my only real solution is having a dummy unit making use of the infinite nuke range edit in FireGraft. I thought I could try and use a turret akin to the science vessel but that didn't pan out either.

Ah, I'm happy to report that this was actually much easier than I originally thought. Somehow I missed this code the first time I looked at the nuke order hooks in GPTP.

In nuke_orders.cpp in the function orders_NukeGround(), there is a check:

Code
            if(direction < -1 || direction > 1)
                bEndThere = true;


Remove this (or add a conditional to exclude the buiding's unit ID) and the buildings are able to nuke fine.

I'm not sure how much experience you have using GPTP, I can explain in greater detail if you want.

The reaver thing will require a little more work, I'm sure there's hardcode checking to see if there's a ground path from the Reaver to its target, but I'm not sure where.

EDIT: the function at 0x00476730 has a check to see if Reavers have a ground path to their target when attacking. Seems like that will need to be hooked.
Aha unfortunately I have absolutely zero clue how GPTP works. I've been told in the past that it's best to learn it, but I don't even know how to set it up. I don't even understand the instructions provided in the GitHub release. My brain doesn't quite have the capacity for things like C++ so my modding just relies on the basics.



None.

Apr 11 2021, 9:31 am Ultraviolet Post #9



Quote from Pandut
#3 - Reaver doesn't work properly when made an air unit
In my mod, the reaver acts as an extremely fast and agile bomber unit and flies in, drops its scarabs and flies out. Unfortunately, when I set the reaver's elevation to any level of Air, it stops working a good 75% of the time. Rather than stopping when in range to attack, the reaver will sometimes just fly above the targets head and sit there. Other times trying to attack a target gives an "Unable to attack target" error. Changing the reaver back to ground elevation fixes the issue completely. Changing the scarab's elevation has no effect, nor does changing the reaver's speed from flingy control to iscript control. This issue also occurs on a blank mod that only changes reaver speed/elevation.

I'm no pro-modder like Voy but I wondered if the scarabs might be able to target correctly if they had the 'Flyer' special ability flag checked? I see you mentioned changing the scarab's elevation, but didn't see any mention of that flag so I thought it might be worth mentioning in case it was as simple as that. But with Voy saying what he said about the hardcoded ground targetting on the reaver, I'm probably wrong.




Apr 11 2021, 2:45 pm Voyager7456 Post #10

Responsible for my own happiness? I can't even be responsible for my own breakfast

The Flyer flag actually only controls targeting for weapons - elevation is the true determinant of whether a unit uses air or ground pathing.

I'll see about writing a quick plugin for you Pandut.



all i am is a contrary canary
but i'm crazy for you
i watched you cradling a tissue box
sneezing and sniffling, you were still a fox


Modding Resources: The Necromodicon [WIP] | Mod Night
My Projects: SCFC | ARAI | Excision [WIP] | SCFC2 [BETA] | Robots vs. Humans | Leviathan Wakes [BETA]


Apr 12 2021, 2:04 am Ultraviolet Post #11



Gotcha. Good to know as I experiment with light modding through EUDs :)




Apr 16 2021, 7:12 pm Pandut Post #12

I'm just a fish

Quote from Voyager7456
The Flyer flag actually only controls targeting for weapons - elevation is the true determinant of whether a unit uses air or ground pathing.

I'll see about writing a quick plugin for you Pandut.
Honestly, I'd greatly appreciate that, thank you :).

Since melee.trg works now, I've been playing around with it the last few days. I am encountering a bit of a problem; one thing I'm trying to implement into my mod is a secondary economy system, where specific structures/units give an income bonus every specific amount of in-game seconds. That part works fine, but I'm using the "Display Text" action to display flavor text that's like "Resource bonus at 20%" that'll eventually go to 100% and tell the player that additional secondary econ buildings/units aren't going to do anything. Pretty much a limiter. Problem is, when I save the trg for GOT compatibility, it removes my Display Text strings and the trigger doesn't work.

Here's how it looks before I save;
Collapsable Box


Here's how it looks after I save;
Collapsable Box

Changing "Exactly" to "At least" or "At most" doesn't have any effect, nor does having a Wait action called before or after the Display Text action.



None.

Apr 16 2021, 10:34 pm poiuy_qwert Post #13

PyMS and ProTRG developer

Hey Pandut, the format for GOT compatible trg files doesn't support strings (or create unit with properties data), so they can't be used. Unfortunately it looks like PyTRG doesn't warn you and just silently removes those things when saving (I have added that to my list of issues). I think there are also other limitations of what actions will run in melee, even though they can be saved to the trg file. I remember this being very annoying and not well known when I looked into this a long time ago.




Apr 17 2021, 2:27 pm Voyager7456 Post #14

Responsible for my own happiness? I can't even be responsible for my own breakfast

poiuy is correct, there's a bunch of trigger actions that just aren't supported with the GOT format. The best solution is probably for me to just roll that resource generation stuff into the plugin as well - I can easily do that if you want to PM me some details.

Attached is the current version of the plugin that should allow your buildings to nuke and disable the Reaver's pathing check when attacking. (I also threw in WMode support for my testing purposes, but I can easily take it out if you want).

Let me know if you have any issues.

Post has been edited 1 time(s), last time on Apr 17 2021, 9:33 pm by Voyager7456.



all i am is a contrary canary
but i'm crazy for you
i watched you cradling a tissue box
sneezing and sniffling, you were still a fox


Modding Resources: The Necromodicon [WIP] | Mod Night
My Projects: SCFC | ARAI | Excision [WIP] | SCFC2 [BETA] | Robots vs. Humans | Leviathan Wakes [BETA]


Apr 17 2021, 8:26 pm Pandut Post #15

I'm just a fish

Quote from Voyager7456
poiuy is correct, there's a bunch of trigger actions that just aren't supported with the GOT format. The best solution is probably for me to just roll that resource generation stuff into the plugin as well - I can easily do that if you want to PM me some details.

Attached is the current version of the plugin that should allow your buildings to nuke and disable the Reaver's pathing check when attacking. (I also threw in WMode support for my testing purposes, but I can easily take it out if you want).

Let me know if you have any issues.
Understood about the triggers, thanks for clearing it up.

As for the plugin, thank you for doing that for me! I believe the reaver issue is fixed, I just have to mess with flingy settings and whatnot to iron things out. For the nuke silo, it can launch successfully but there's a few issues;
-Even with the unlimited range nuke range edit in firegraft, nuke range is limited to the nuke silo's vision range.
-The nuke silo can successfully paint a target, but once the nuke paint call finishes the game crashes. Same result when changing units.dat right-click actions to Nothing (With Indicator) and No Movement/Normal Attack.

I'm already using Niev's chainwmode so WMode support in it doesn't make -too- much of a difference to me. For resource generation stuff, I appreciate the help again and if it's alright I'd rather PM you after getting the nuke silo stuff working aha.



None.

Apr 17 2021, 9:24 pm Voyager7456 Post #16

Responsible for my own happiness? I can't even be responsible for my own breakfast

I'll take a look at the sight range thing. As for the crash, it's likely an iscripting issue - you need to add a WalkingToIdle animation to the Nuke Silo.

EDIT: Sight range thing was a trivial fix, try this.

Attachments:
GPTP.qdp
Hits: 3 Size: 3281kb

Post has been edited 1 time(s), last time on Apr 17 2021, 9:33 pm by Voyager7456.



all i am is a contrary canary
but i'm crazy for you
i watched you cradling a tissue box
sneezing and sniffling, you were still a fox


Modding Resources: The Necromodicon [WIP] | Mod Night
My Projects: SCFC | ARAI | Excision [WIP] | SCFC2 [BETA] | Robots vs. Humans | Leviathan Wakes [BETA]


Apr 17 2021, 10:50 pm Pandut Post #17

I'm just a fish

Quote from Voyager7456
I'll take a look at the sight range thing. As for the crash, it's likely an iscripting issue - you need to add a WalkingToIdle animation to the Nuke Silo.

EDIT: Sight range thing was a trivial fix, try this.
Yeah, that fixed it! On both fronts. The only thing is that having more than one nuke silo seems to confused them and sometimes they'll launch nukes from different silos and it causes a crash. Which, isn't that big of a deal because I intend to have a limit of 1 per player. I'll shoot you a pm in a short bit, again thanks for all the help!



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[11:50 pm]
O)FaRTy1billion[MM] -- nice, now i have more than enough
[11:49 pm]
O)FaRTy1billion[MM] -- if i don't gamble them away first
[11:49 pm]
O)FaRTy1billion[MM] -- o, due to a donation i now have enough minerals to send you minerals
[2024-4-17. : 3:26 am]
O)FaRTy1billion[MM] -- i have to ask for minerals first tho cuz i don't have enough to send
[2024-4-17. : 1:53 am]
Vrael -- bet u'll ask for my minerals first and then just send me some lousy vespene gas instead
[2024-4-17. : 1:52 am]
Vrael -- hah do you think I was born yesterday?
[2024-4-17. : 1:08 am]
O)FaRTy1billion[MM] -- i'll trade you mineral counts
[2024-4-16. : 5:05 pm]
Vrael -- Its simple, just send all minerals to Vrael until you have 0 minerals then your account is gone
[2024-4-16. : 4:31 pm]
Zoan -- where's the option to delete my account
[2024-4-16. : 4:30 pm]
Zoan -- goodbye forever
Please log in to shout.


Members Online: lil-Inferno, RIVE, Zycorax