Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Poll

Fanfiction stuff?

Very yes
Yes
Indifferent
No
Very no

Pages: 1 ... 58 59 [60] 61 62 ... 88

Author Topic: Sparking!!! Dragon Ball Mod (0.47, rolling releases): Half a Raditz  (Read 333702 times)

Alceris

  • Bay Watcher
  • [ETHIC:KILL:FLOWER]
    • View Profile
Re: Sparking!!! Dragon Ball Mod (2.9.2): It's over 9000!! (0.40.24)
« Reply #885 on: June 21, 2015, 01:41:32 am »

I'm getting no errors, it doesn't do anything when I have a unit selected, either, and what arguments would there even be?
Logged

Alceris

  • Bay Watcher
  • [ETHIC:KILL:FLOWER]
    • View Profile
Re: Sparking!!! Dragon Ball Mod (2.9.2): It's over 9000!! (0.40.24)
« Reply #887 on: June 21, 2015, 01:48:15 am »

The -accurate argument is not valid, and legacy continues to do nothing.
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Sparking!!! Dragon Ball Mod (2.9.2): It's over 9000!! (0.40.24)
« Reply #888 on: June 21, 2015, 01:50:51 am »

I get the feeling that dfhack.gui.showPopupAnnouncement might not work in adv mode. Switch that to "print" in raw/scripts/dragonball/sparking.lua and see what it says when you try again. If it's nothing, you don't have a unit selected; if it says a power level, my hunch about showPopupAnnouncement is correct.

Alceris

  • Bay Watcher
  • [ETHIC:KILL:FLOWER]
    • View Profile
Re: Sparking!!! Dragon Ball Mod (2.9.2): It's over 9000!! (0.40.24)
« Reply #889 on: June 21, 2015, 01:59:44 am »

It does, in fact, print a power level in the dfhack window if I do that.
Edit: Wait, no, it doesn't. It only does that in the Object Testing Arena. In Adventurer Mode, it still doesn't do anything. The -all argument does work, but if there's a god around, it gives an error. Also, the self-only scouter floods the console with errors if you are a god.
« Last Edit: June 21, 2015, 02:52:53 am by Alceris »
Logged

Max™

  • Bay Watcher
  • [CULL:SQUARE]
    • View Profile
Re: Sparking!!! Dragon Ball Mod (2.9.2): It's over 9000!! (0.40.24)
« Reply #890 on: June 21, 2015, 04:53:18 am »

Yeah, crazy spam from the nearby unit emotions and stuff too when I got all crazy strong. Was really confusing.
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Sparking!!! Dragon Ball Mod (2.9.2): It's over 9000!! (0.40.24)
« Reply #891 on: June 21, 2015, 05:23:43 am »

use -ignoreGod for that

I fixed the emotion thing a while ago...

Max™

  • Bay Watcher
  • [CULL:SQUARE]
    • View Profile
Re: Sparking!!! Dragon Ball Mod (2.9.2): It's over 9000!! (0.40.24)
« Reply #892 on: June 21, 2015, 05:41:13 am »

Ah, hadn't kept track of updates, I'll make sure to grab the newest one next time I pop back on.
Logged

Alceris

  • Bay Watcher
  • [ETHIC:KILL:FLOWER]
    • View Profile
Re: Sparking!!! Dragon Ball Mod (2.9.2): It's over 9000!! (0.40.24)
« Reply #893 on: June 21, 2015, 02:07:49 pm »

The scouter simply is not properly detecting if you're looking at a unit in Adventurer Mode. Regardless of whether or not I'm seeing the basic screen showing the status of their body parts, their description, or even looking at myself, it thinks I'm not looking at anyone.
« Last Edit: June 21, 2015, 03:32:00 pm by Alceris »
Logged

Alceris

  • Bay Watcher
  • [ETHIC:KILL:FLOWER]
    • View Profile
Re: Sparking!!! Dragon Ball Mod (2.9.2): It's over 9000!! (0.40.24)
« Reply #894 on: June 21, 2015, 10:58:02 pm »

If it helps at all, this is the scouter.lua file. The scouter worked in an older version of the mod when I was doing exactly the same thing I'm doing now.
Code: [Select]
-- Gives power level of selected unit. Type "accurate" for a more linear, but more boring number or "legacy" for pre-ki calculation.

local utils=require('utils')

validArgs = utils.invert({
 'legacy',
 'all',
 'citizens',
 'ignoreGod'
})

local args = utils.processArgs({...}, validArgs)

--power levels should account for disabilities and such
local function isWinded(unit)
    return unit.counters.winded > 0
end
local function isStunned(unit)
    return unit.counters.stunned > 0
end
local function isUnconscious(unit)
    return unit.counters.unconscious > 0
end
local function isParalyzed(unit)
    return unit.counters2.paralysis > 0
end
local function getExhaustion(unit)
    local exhaustion = 1
    if unit.counters2.exhaustion~=0 then
        exhaustion = 1000/unit.counters2.exhaustion
        return exhaustion
    end
    return 1
end

function getPowerLevel(saiyan,legacy,ignoreGod)
    if not saiyan then return 'nothing' end
    if legacy then
local strength,endurance,toughness,spatialsense,kinestheticsense,willpower
if saiyan.curse.attr_change then
strength = ((saiyan.body.physical_attrs.STRENGTH.value+saiyan.curse.attr_change.phys_att_add.STRENGTH)/3550)*(saiyan.curse.attr_change.phys_att_perc.STRENGTH/100)
endurance = ((saiyan.body.physical_attrs.ENDURANCE.value+saiyan.curse.attr_change.phys_att_add.ENDURANCE)/1000)*(saiyan.curse.attr_change.phys_att_perc.ENDURANCE/100)
toughness = ((saiyan.body.physical_attrs.TOUGHNESS.value+saiyan.curse.attr_change.phys_att_add.TOUGHNESS)/2250)*(saiyan.curse.attr_change.phys_att_perc.TOUGHNESS/100)
spatialsense = ((saiyan.status.current_soul.mental_attrs.SPATIAL_SENSE.value+saiyan.curse.attr_change.ment_att_add.SPATIAL_SENSE)/1500)*(saiyan.curse.attr_change.ment_att_perc.SPATIAL_SENSE/100)
kinestheticsense = ((saiyan.status.current_soul.mental_attrs.KINESTHETIC_SENSE.value+saiyan.curse.attr_change.ment_att_add.KINESTHETIC_SENSE)/1000)*(saiyan.curse.attr_change.ment_att_perc.KINESTHETIC_SENSE/100)
willpower = ((saiyan.status.current_soul.mental_attrs.WILLPOWER.value+saiyan.curse.attr_change.ment_att_add.WILLPOWER)/1000)*(saiyan.curse.attr_change.ment_att_perc.WILLPOWER/100)
else
strength = saiyan.body.physical_attrs.STRENGTH.value/3550
endurance = saiyan.body.physical_attrs.ENDURANCE.value/1000
toughness = saiyan.body.physical_attrs.TOUGHNESS.value/2250
spatialsense = saiyan.status.current_soul.mental_attrs.SPATIAL_SENSE.value/1500
kinestheticsense = saiyan.status.current_soul.mental_attrs.KINESTHETIC_SENSE.value/1000
willpower = saiyan.status.current_soul.mental_attrs.WILLPOWER.value/1000
end
local exhaustion = getExhaustion(saiyan)
local bodysize = (saiyan.body.blood_count/100)^2
powerlevel = bodysize*((strength*endurance*toughness*spatialsense*kinestheticsense*willpower)^(1/6))*exhaustion
if isWinded(saiyan) then powerlevel=powerlevel/1.2 end
if isStunned(saiyan) then powerlevel=powerlevel/1.5 end
if isParalyzed(saiyan) then powerlevel=powerlevel/5 end
if isUnconscious(saiyan) then powerlevel=powerlevel/10 end
if powerlevel == 1/0 then
return 'undefined'
end
return math.floor(powerlevel)
    else
        local powerLevel,kiLevel=dfhack.script_environment('dragonball/ki').get_ki_investment(saiyan.id)
        if kiLevel>1 then
            if ignoreGod then
                local kiLevelStr=kiLevel==1 and 'demigod' or kiLevel==2 and 'god' or kiLevel==3 and 'one infinity core' or kiLevel<11 and tostring(kiLevel-2)..' infinity cores' or "the culmination"
                return powerLevel..' ('..kiLevelStr..' ki)'
            else
                return '(undetectable--a god?!)'
            end
        else
            return powerLevel
        end
    end
end

if args.all then
for k,v in ipairs(df.global.world.units.active) do
        local powerlevel=getPowerLevel(v,args.legacy,args.ignoreGod)
        if powerlevel>0 then
            print(dfhack.TranslateName(dfhack.units.getVisibleName(v))..' has a power level of '..powerlevel)
        end
end
elseif args.citizens then
for k,v in ipairs(df.global.world.units.active) do
if dfhack.units.isCitizen(v) then
print(dfhack.TranslateName(dfhack.units.getVisibleName(v))..' has a power level of '..getPowerLevel(v,args.legacy,args.ignoreGod))
end
end
else
    local unit=dfhack.gui.getSelectedUnit(true)
    if unit then
        print("The scouter says " .. getPowerLevel(dfhack.gui.getSelectedUnit(true),args.legacy,args.ignoreGod) .. "!",11)
    end
end
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Sparking!!! Dragon Ball Mod (2.9.2): It's over 9000!! (0.40.24)
« Reply #895 on: June 21, 2015, 11:05:25 pm »

I don't think I can handle th

the adventure scouter is a new viewscreen overlayed onto the current viewscreen, which has no method that wraps getSelectedUnit()

gimme a sec

Alceris

  • Bay Watcher
  • [ETHIC:KILL:FLOWER]
    • View Profile
Re: Sparking!!! Dragon Ball Mod (2.9.2): It's over 9000!! (0.40.24)
« Reply #896 on: June 21, 2015, 11:12:57 pm »

What? That sounds like the wrong scouter. I'm talking about the one you have to use manually with the dragonball/scouter command. It works when I take control of a creature in the Object Testing Arena, but it doesn't work in Adventurer Mode.
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Sparking!!! Dragon Ball Mod (2.9.2): It's over 9000!! (0.40.24)
« Reply #897 on: June 21, 2015, 11:17:09 pm »

No, I know what I meant. The adventure mode scouter which automatically turns on when you start the game broke the functionality of dragonball/scouter due to the lack of an onGetSelectedUnit() method for the adventure mode scouter viewscreen that I had overlay all of the units in adventure mode. I fixed that, so now it should work.

Alceris

  • Bay Watcher
  • [ETHIC:KILL:FLOWER]
    • View Profile
Re: Sparking!!! Dragon Ball Mod (2.9.2): It's over 9000!! (0.40.24)
« Reply #898 on: June 21, 2015, 11:21:55 pm »

I can confirm that it works now. However, the -accurate argument is still invalid.
Edit: And instant transmission gives a wildly different number to the new scouter.
« Last Edit: June 21, 2015, 11:25:02 pm by Alceris »
Logged

Alceris

  • Bay Watcher
  • [ETHIC:KILL:FLOWER]
    • View Profile
Re: Sparking!!! Dragon Ball Mod (2.9.2): It's over 9000!! (0.40.24)
« Reply #899 on: June 22, 2015, 05:41:27 pm »

I keep getting this error while I'm fighting a bunch of corpses.
Code: [Select]
... Fortress Z 2.9.2/data/save/Goku/raw/init.d/sparking.lua:561: attempt to inde
x field 'current_soul' (a nil value)
stack traceback:
        ... Fortress Z 2.9.2/data/save/Goku/raw/init.d/sparking.lua:561: in func
tion 'unitInDeadlyCombat'
        ... Fortress Z 2.9.2/data/save/Goku/raw/init.d/sparking.lua:649: in func
tion <... Fortress Z 2.9.2/data/save/Goku/raw/init.d/sparking.lua:623>
        [C]: in function 'onUnitAction'
        ...Z 2.9.2/data/save/Goku/raw/scripts/unit_action_check.lua:30: in funct
ion 'func'
        ...ownloads\Dwarf Fortress Z 2.9.2\hack\lua\repeat-util.lua:28: in funct
ion <...ownloads\Dwarf Fortress Z 2.9.2\hack\lua\repeat-util.lua:27>
Logged
Pages: 1 ... 58 59 [60] 61 62 ... 88