Registered Users
  • Content count

  • Joined

  • Last visited

Community Reputation

13 Good

About DGM

  • Rank
    Junior Member

Recent Profile Visitors

468 profile views
  1. Neptune Corporation

    Will that fix a game or mission in progress or will I have to restart?
  2. Neptune Corporation

    One of the guard types in the Neptune levels is bugged. When I put the cursor over him to get info I got an error message every frame until the cursor was moved away: Oct 15 22:27:22 -- game/sim/unitdefs/commondefs.lua:965: bad argument #1 to 'format' (string expected, got nil) stack traceback: [C] ? [C] in function 'format' game/sim/unitdefs/commondefs.lua:965 in function 'onWorldTooltip' game/client/hud/hud.lua:1217 in function <game/client/hud/hud.lua:1111> (tail call) ? game/client/mui/mui_screen.lua:339 in function 'handleInputEvent' game/client/mui/mui.lua:376 in function 'onInputEvent' game/client/input-manager.lua:57 in function 'notifyListeners' game/client/input-manager.lua:116 in function <game/client/input-manager.lua:112> I don't know the name of the guard type, but I have a screenshot. It's the rightmost guard standing next to the door: EDIT: Forgot to include the log. Expect a LOT of the error message I quoted above since, as I said, I was getting that every frame the cursor was over him: invisibleinc.txt
  3. Neptune Corporation

    Never mind. I just updated to the latest version of Sim Constructor and suddenly it's loading. You might want to specify that it require a recent version in case anyone else has this problem.
  4. Neptune Corporation

    I just tried this. When I try to start the program I get several seconds of black screen and then a crash to desktop. Mods installed are: AgentModsCombo GenerationOptions NeptuneCorp SimConstructor UITweaks I'm attaching the log: invisibleinc.txt
  5. Nevermind. I moved the call to oldEndTurn from the beginning of the function to the end and it seems to be acting properly now. I still don't fully understand how the timing is working here - I expected upkeep to be checked when the player ended his turn - but it's finally doing what I want so I'm not going to complain. Thanks yet again, guys.
  6. >> "So implicit arg "self" should be your sim." That works, thanks. Unfortunately, I was right about the timing. Tags are still reporting the guard paths before getting destroyed. EDIT: Before anyone suggests it, I tried setting patrolObserved to false right after removing the tag. Doesn't work.
  7. I'm trying to implement this, but there's a complication. I need the sim object and it isn't passed to the simengine:endTurn function through the parameters. I'm trying to get at it like so: function simengine:endTurn() oldEndTurn( self ) local playerUnits = simplayer._units local sim = playerUnits[1].getSim() . . . end ...But I'm getting a crash on the "local sim" line: Jul 29 17:06:11 -- Sim returned: BrokenStrats/tag_changes.lua:37: attempt to index local 'playerUnits' (a nil value) stack traceback: BrokenStrats/tag_changes.lua:37 in function 'endTurn' game/sim/simactions.lua:474 in function '?' game/sim/engine.lua:2100 in function 'applyAction' game/client/states/state-game.lua:362 in function <game/client/states/state-game.lua:359> The term "sim" is used in so many places that even a grep tool isn't helping me find an easier way to do this.
  8. Sorry for the delayed reply, but I've been sick. >> "if you replace simengine.endTurn instead you can make endTurn and thus the trigger be called before your code." Wouldn't that cause the upkeep to be checked AFTER the tags have already revealed the guard paths? The idea is to check after things like generator programs and portable servers go off, but before the tags perform their function.
  9. >> "Use a for loop like in your original post and replace simplayer.onStartTurn instead of simunit.onStartTurn." And with that (and a little debugging) it's finally working. Yeesh. That took way longer than I was expecting, but at least I know how to set up once-per-turn effects now. Thanks for your patience, guys. One more question. Testing revealed that the upkeep was being paid before Power Drip kicked in, resulting in tags being lost unnecessarily at low power. I should probably address this, which means I need to learn how the engine handles the ordering of such things. What section(s) of the code deal with this?
  10. Yeah, I just posted about that (probably while you were responding). It doesn't work. The upkeep check is being skipped entirely now, presumably because it thinks I'm asking for the controller of the current unit rather than the active player. Here's the current code: local oldOnStartTurn = simunit.onStartTurn local tagUpkeepCost = .5 function simunit:onStartTurn( sim ) local player = sim:getCurrentPlayer() if player:isPC() and self:getTraits().isGuard and self:getTraits().tagged then if player:getCpus() >= tagUpkeepCost then player:addCPUs(-tagUpkeepCost) else self:setTagged("dissable") end end oldOnStartTurn( self, sim ) end
  11. Never mind. I just remembered that the isPC and isNPC functions do that. EDIT: No, wait, that doesn't work. That just checks who's controlling the unit being checked at the time, which no longer works now that I'm not using the for loop any more. @#$%. Is there a function that does this, or do I need to jury rig something?
  12. Sounds about right, but I still need a way to ask the engine which side's turn it is and I haven't found it yet. Without that it'll be checking for upkeep on both turns instead of just the agency's.
  13. I figured it out. For some reason I thought the code would only work once at the start of the agency's turn instead of once per agency unit. And agency units meant not only my agents but every device I had captured. I had a high upkeep cost for testing purposes and kept paying it over and over until I couldn't afford the tag any more. Is there a function for doing something once at the start of a given side's turn?
  14. [facepalm] How did I miss THAT? Okay, fixed. Thanks. But now I'm getting a different problem. Power is being deducted appropriately, only when the agency has enough to spare. But the tag is removed every turn even when the upkeep is payed. Apparently the else clause is triggering when it isn't supposed to.
  15. Just realized I stuck a semicolon at the end of the addCpus line. Damned muscle memory. However, the line still crashes the game even after removing that (and making no other changes). New log, in case it matters: invisibleinc.txt