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 ... 31 32 [33] 34 35 ... 88

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

Spirit of Power

  • Bay Watcher
    • View Profile

And that one's now gone, except I'm getting this one:



On line 94. I looked at it, and with a bit of deduction, concluded that it needs a number in the parentheses for that command based on the other announcement lines. I fixed it and now it works:

Code: [Select]
-- Gives power level of selected unit. Type "accurate" for a more linear, but more boring number.

local selectedUnit = dfhack.gui.getSelectedUnit(silent)

local args = {...}

local accurate = false

for _,arg in ipairs(args) do
    if arg == "accurate" then accurate = true end
end

local function unitIsGod(unit)
    local unitraws = df.creature_raw.find(unit.race)
    local casteraws = unitraws.caste[unit.caste]
    local unitclasses = casteraws.creature_class
    for _,class in ipairs(unitclasses) do
        if class.value == "GOD" then return true end
    end
    for _,u_syndrome in ipairs(unit.syndromes.active) do
        local syndrome = df.global.world.raws.syndromes.all[u_syndrome.type]
        for _,synclass in ipairs(syndrome.syn_class) do
            if synclass.value == "GOD" then return true end
        end
    end
    return false
end

--power levels should account for disabilities and such
local function isWinded(unit)
    if unit.counters.winded > 0 then return true end
    return false
end
local function isStunned(unit)
    if unit.counters.stunned > 0 then return true end
    return false
end
local function isUnconscious(unit)
    if unit.counters.unconscious > 0 then return true end
    return false
end
local function isParalyzed(unit)
    if unit.counters2.paralysis > 0 then return true end
    return false
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

if not selectedUnit then
    qerror('Need to select a unit.')
end

--blood_max appears to be the creature's body size divided by 10; the power level calculation relies on body size divided by 1000, so divided by 100 it is. blood_count refers to current blood amount, and it, when full, is equal to blood_max.
local speed = 1000/dfhack.units.computeMovementSpeed(selectedUnit)
if selectedUnit.curse.attr_change then
strength = ((selectedUnit.body.physical_attrs.STRENGTH.value+selectedUnit.curse.attr_change.phys_att_add.STRENGTH)/3550)*(selectedUnit.curse.attr_change.phys_att_perc.STRENGTH/100)
endurance = ((selectedUnit.body.physical_attrs.ENDURANCE.value+selectedUnit.curse.attr_change.phys_att_add.ENDURANCE)/1000)*(selectedUnit.curse.attr_change.phys_att_perc.ENDURANCE/100)
toughness = ((selectedUnit.body.physical_attrs.TOUGHNESS.value+selectedUnit.curse.attr_change.phys_att_add.TOUGHNESS)/2250)*(selectedUnit.curse.attr_change.phys_att_perc.TOUGHNESS/100)
spatialsense = ((selectedUnit.status.current_soul.mental_attrs.SPATIAL_SENSE.value+selectedUnit.curse.attr_change.ment_att_add.SPATIAL_SENSE)/1500)*(selectedUnit.curse.attr_change.ment_att_perc.SPATIAL_SENSE/100)
kinestheticsense = ((selectedUnit.status.current_soul.mental_attrs.KINESTHETIC_SENSE.value+selectedUnit.curse.attr_change.ment_att_add.KINESTHETIC_SENSE)/1000)*(selectedUnit.curse.attr_change.ment_att_perc.KINESTHETIC_SENSE/100)
willpower = ((selectedUnit.status.current_soul.mental_attrs.WILLPOWER.value+selectedUnit.curse.attr_change.ment_att_add.WILLPOWER)/1000)*(selectedUnit.curse.attr_change.ment_att_perc.WILLPOWER/100)
else
strength = selectedUnit.body.physical_attrs.STRENGTH.value/3550
endurance = selectedUnit.body.physical_attrs.ENDURANCE.value/1000
toughness = selectedUnit.body.physical_attrs.TOUGHNESS.value/2250
spatialsense = selectedUnit.status.current_soul.mental_attrs.SPATIAL_SENSE.value/1500
kinestheticsense = selectedUnit.status.current_soul.mental_attrs.KINESTHETIC_SENSE.value/1000
willpower = selectedUnit.status.current_soul.mental_attrs.WILLPOWER.value/1000
end
local exhaustion = getExhaustion(selectedUnit)


if accurate == true
then
    local bodysize = selectedUnit.body.blood_count*10
    powerlevel = bodysize*speed*((strength*endurance*toughness*spatialsense*kinestheticsense*willpower)^(1/6))*exhaustion
    powerlevel = powerlevel * 300
else
    local bodysize = (selectedUnit.body.blood_count/100)^2
    powerlevel = bodysize*speed*((strength*endurance*toughness*spatialsense*kinestheticsense*willpower)^(1/6))*exhaustion
end
if isWinded(selectedUnit) then powerlevel=powerlevel/1.2 end
if isStunned(selectedUnit) then powerlevel=powerlevel/1.5 end
if isParalyzed(selectedUnit) then powerlevel=powerlevel/5 end
if isUnconscious(selectedUnit) then powerlevel=powerlevel/10 end

if powerlevel == 1/0 or unitIsGod(selectedUnit) then
    dfhack.gui.showPopupAnnouncement("The scouter broke at this incredible power. Either the power belongs to a god... or it's immeasurable.",11)
    qerror("Scouter broke! Oh well, there are more.",11)
end

dfhack.gui.showAnnouncement("The scouter says " .. math.floor(powerlevel) .. "!",11)

Note this bit:

Code: [Select]
    dfhack.gui.showPopupAnnouncement("The scouter broke at this incredible power. Either the power belongs to a god... or it's immeasurable.",11)
More specifically, the ",11". I assume you forgot to add that, which was causing the problem. That particular line was moved down, and was, for lack of a better word, "buried" under some other problems, so it's understandable why you missed it. Anyways, it works now, so I'm off to test Super Saiyan.
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile

I've added that ,11 3 times already :P

Spirit of Power

  • Bay Watcher
    • View Profile

I've added that ,11 3 times already :P

Wait, seriously? Then why did I get that problem?  ???
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile

Oh, things like that happen all the time.

Spirit of Power

  • Bay Watcher
    • View Profile

Also, the errorlog tells me you've got a duplicate reaction for the reaction WISH_FOR_POTARA_DB, so I renamed the adventure mode version to WISH_FOR_POTARA_DB_ADV. Currently trying to survive long enough to kill enough things to go Super Saiyan.
Logged

Spirit of Power

  • Bay Watcher
    • View Profile

I'm currently a Super Saiyan 3, but weirdly enough I can't do anything but bruise people  :-\

Though I can report that I can go Super Saiyan 2 multiple times, even if I have to use the ability, then wait for it to be usable again in order to do so. Also I could only bruise people in SS2 as well. Haven't yet tested SS3, because I cannot freaking kill this guy because I can't do anything but bruise him :/

EDIT:Also, oddly, I have a speed of like 650-ish as a SS3. Might be a side effect of going SS3 while already SS2 though.

EDIT2:Okay, my attacks just started working and my speed just skyrocketed to 9708 (I'd activated flashstep to attempt to remedy the speed problem). This is really, really weird.

EDIT3:DF just crashed after trying to go SS3 after trying (and failing) to go SS and SS2. Going to reload and try this again.

EDIT4:Just reloaded and tried to go SS2 without going SS, and it worked  :o Attacks don't work though. Going to get and use SS3 again.
« Last Edit: March 31, 2013, 05:26:42 pm by Spirit of Power »
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile

...that's odd.

I may have to include a DFHack script to prevent overflows, hehe. Just check all the various overflowable values and, if they're negative, set them to 2147483647.

Spirit of Power

  • Bay Watcher
    • View Profile

Aaaaand I died. Couldn't kill anyone because my attacks didn't do nearly enough damage to kill them even via bleeding out. I also seem completely unable to go SS more than once, though I can go SS2 at least twice. Haven't survived long enough to use SS3 twice though.

EDIT:And now I can go SS more than once. Alright, seems a bit inconsistent, but whatever works.
« Last Edit: March 31, 2013, 05:52:50 pm by Spirit of Power »
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile

Including overflow checks as a hopeful bug fix to your inefficiency issue. Not sure if it'll work, though.

Spirit of Power

  • Bay Watcher
    • View Profile

Okay, this is getting really, really weird. I went SS3, and that worked alright. But then I tried to use it again, and it didn't work. But then I tried SS2, and that seemed to work :/

Of course, I didn't test combat, but I know speed didn't change. These results are all over the place. Sometimes I can do it properly, sometimes I can't, sometimes I do it properly but I get massive overflows...

Yeah, anyways, I'm done for now. Gonna eat dinner, see if I can find an english subbed stream of Battle of Gods, maybe try again in a couple hours.
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile

Okay.

Right now, I'm working on Super Saiyan 4, 5, 6, 7, 8, 9 and 10. Also going to include Super Humans 1-5; Android 21 is going to get a megabeast, and commas will end sentences,
« Last Edit: April 01, 2013, 02:18:43 am by Putnam »
Logged

Sergarr

  • Bay Watcher
  • (9) airheaded baka (9)
    • View Profile

I'd recommend working on Super Saiyan 1337  ;)
Logged
._.

jaxy15

  • Bay Watcher
  • Adept Modder
    • View Profile

You should totally add Xicor as a super-mega-ultra-super-strong megabeast that's like 2500000 Broly's combined.
Logged
Dwarf Fortress: Threats of metabolism.

alamoes

  • Bay Watcher
    • View Profile

Cannot wait to try this mod.  I will report my findings later. 
Logged
Pages: 1 ... 31 32 [33] 34 35 ... 88