Repository navigation
trigscript/workers buildAutoMiningProgram(), on u.gather(target) #88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
a3bd96f
u.gather(target): send a worker to mine a mineral field or gather fro…
mstephenhunt 570c563
trigscript/workers: autoMining(), a rallied worker goes to work
mstephenhunt cb6e8c1
autoMining(): a second call adds nothing, in place of the @topLevelOn…
mstephenhunt 4c051b9
trigscript/workers: autoMining() is now buildAutoMiningProgram()
mstephenhunt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -205,6 +205,8 @@ class GameUnit implements SimUnit { | |
| get speedUpgrade() { return this.read("speedUpgrade", () => this.flag(0x10000000)); } | ||
| get hasTarget() { return this.read("hasTarget", () => this.m.getUint32(this.at + 0x5c, true) !== 0); } | ||
| get inTransport() { return this.read("inTransport", () => this.flag(0x00000040)); } | ||
| get orderTargetX() { return this.read("orderTargetX", () => this.m.getUint16(this.at + 0x58, true)); } | ||
| get orderTargetY() { return this.read("orderTargetY", () => this.m.getUint16(this.at + 0x5a, true)); } | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| // Not read from the game yet: the spell timers and whether the unit is under attack. | ||
| stim = 0; ensnare = 0; plague = 0; lockdown = 0; maelstrom = 0; irradiate = 0; stasis = 0; | ||
| /** The attack-notify timer (+0x87) running: the game raised its under-attack alert for the unit within the last second or so. */ | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"As a right-click on it does" promises more than the lowering does. A right-click goes through the game's command, which refuses some workers; this writes the order, its state and its target into the unit whatever state it is in.
The library only calls it on a worker just out of production, so that use is fine. A map maker can call it on any worker, though. Could you trace two cases: a burrowed Drone, and an SCV inside a Dropship? A right-click does nothing for either. If the written order makes them misbehave, I'd guard them in the lowering (
burrowedandinTransportare already among the flags it reads) and add them to the emitter test. If they turn out harmless, say here what it is: the order written to the unit, with those cases named.