Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 164 165 [166] 167 168 ... 360

Author Topic: DFHack 0.43.03-r1  (Read 1120737 times)

Max™

  • Bay Watcher
  • [CULL:SQUARE]
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #2475 on: April 14, 2015, 02:25:00 am »

Hmmm, I think it works out easier (unless you know a simple way to open an army with the id directly) if you change it to this:
Code: [Select]
local armies=df.global.world.armies.all
function find_player_army()
        for k,v in ipairs(armies) do
                if v.unk_48[0] then
                        return k
                end
        end
end
print(find_player_army())
Which spits out 80 for my army just now, and I can put that in gui/gm-editor df.global.world.armies.all[80] and open it up... could that be done in the script itself?
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #2476 on: April 14, 2015, 02:34:35 am »

Better would be to print the ID so you can use df.army.find(id).

Max™

  • Bay Watcher
  • [CULL:SQUARE]
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #2477 on: April 14, 2015, 02:46:29 am »

Well fuck, that's much easier.

So, I'm gonna learn how to sew and make you a big fucking cobalt blue hat with a big gold crescent moon on it, k?

lol
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #2478 on: April 14, 2015, 02:51:25 am »

Another hint: df.(something).find works for, like, everything. df.weapon.find, df.army_controller.find, df.world_site.find, df.historical_figure.find, df.historical_entity.find, df.item.find, df.entity_raw.find, df.creature_raw.find...

Max™

  • Bay Watcher
  • [CULL:SQUARE]
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #2479 on: April 14, 2015, 05:42:32 am »

Yup, was just playing with that, very neat. Incidentally I think I've got an adventurer mode version of propel rumrusher was fiddling with working... the testing has been really painful and derpy looking, poor kids I was rescuing have been sitting there wondering why I'd randomly jump into the ground face first, hop off the ground and fly into a tree and so forth.

It's workable but dangerous as shit, had to check out how various other scripts failed safely because the way I was using the cursor as a target AND to set the speed meant you zoomed off at relativistic velocities towards -30000 x/y/z without a cursor, buuuutttt...
Spoiler (click to show/hide)
I was standing a tile away from the base of a three z high gobby tower just before taking that shot. :D
« Last Edit: April 14, 2015, 06:46:34 am by Max™ »
Logged

expwnent

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #2480 on: April 14, 2015, 09:06:53 am »

Fun fact: DF itself uses -30000 as a constant internally to represent invalid or nonexistent locations.
Logged

Max™

  • Bay Watcher
  • [CULL:SQUARE]
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #2481 on: April 14, 2015, 02:34:14 pm »

Yup, which means turning yourself into a projectile with speed based on your cursor position while having no cursor REALLY freaking hurts.

Still, being able to go from here:
Spoiler (click to show/hide)

To here on a parabolic trajectory (with a hand free so you can grab the tree >.>):
Spoiler (click to show/hide)

Is pretty freaking cool. As is doing the Tarzan thing and leaping tree to tree.

Though dbz-ing elves waaaaay the hell across the map is awesome! I say dbz-ing because one swung at me from one z-level up as I went by from below and I decided 'nah, screw this guy' so I grabbed him and launched myself aimed way up and through him. It turned out way cooler than I hoped:
Spoiler (click to show/hide)

At least until you try to jump so far that you explode mid-tackle, shotgun blasting the elf you were tackling with your gear and armor before they also explode...
Spoiler (click to show/hide)

Got a good hearty laugh out of me though!
« Last Edit: April 14, 2015, 02:36:49 pm by Max™ »
Logged

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #2482 on: April 14, 2015, 11:13:00 pm »

best way to avoid death by falling is to wear clothes of none so that it would cause a Pass right through option when you hit the ground.
I notice this when riding on minecarts made of that material.
Logged
I thought I would I had never hear my daughter's escapades from some boy...
DAMN YOU RUMRUSHER!!!!!!!!
"body swapping and YOU!"
Adventure in baby making!Adv Homes

scamtank

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #2483 on: April 14, 2015, 11:15:19 pm »

Wear a void to protect yourself from the laws of physics.

genius
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #2484 on: April 14, 2015, 11:16:15 pm »

That's... actually a really cool idea, fantasy-wise. Items made of literal nothing making attacks go through you.

Max™

  • Bay Watcher
  • [CULL:SQUARE]
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #2485 on: April 15, 2015, 01:00:11 am »

No luck, just goes straight to bruising the skin.
Logged

endlessblaze

  • Bay Watcher
  • likes dragons for their fiery breath
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #2486 on: April 15, 2015, 02:34:06 pm »

What if you set the ground below you to nothing? :o

I would test it myself but I'm crap with lua, and yes, I tried it even before I had ever heard of DF
Logged
Kids make great meat shields.
I nominate endlessblaze as our chief military executive!

Max™

  • Bay Watcher
  • [CULL:SQUARE]
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #2487 on: April 15, 2015, 08:36:45 pm »

Hmmm, I found that if you null your speed and flip the right flags you don't take damage.

I tested this by launching myself on an absolutely suicidal trajectory (like 15 x and z difference) and pulling up the proj_list in gm-editor quickly at the top of the arc, with the right changes you just drop to the ground and only need to stand up, no impact or skidding or slamming into anything.

I tried to figure out how to trigger this at the very top of a jump in a couple ways, I got it where it doesn't error when I added these lines:
Code: [Select]
roof = proj.target_pos.z - proj.cur_pos.z

if roof==0 then
        proj.speed_x=0
        proj.speed_y=0
        proj.speed_z=0
        proj.flags.parabolic=false
        proj.flags.has_hit_ground=true
        unitSource.flags1.projectile=false
 end
Because those are the flags/speed changes that caused me to drop from like 15 z up with no damage.

Unfortunately I'm not sure how to actually make it do a check like "if you're about to slam into something" or "if you're at the top of a jump" or "if your speed_z becomes negative" properly.

Note that I doubled the speed boosts because x/y/z*20000 let me consistently pass through the target_pos, though you do overshoot it sometimes, anyone got an idea how to make it flip those flags mid-jump when certain conditions are met, I was digging through the gui/gm-editor df lists to see if I could find a collisions index or something but I haven't had any luck yet.

Edit: nevermind, it isn't working now, not sure what happened but it's erroring me with those lines added in and I'm not even able to reproduce the "drop from way up in the air safely" result.
« Last Edit: April 15, 2015, 09:43:18 pm by Max™ »
Logged

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #2488 on: April 15, 2015, 09:46:35 pm »

notice something funny with jump, if you give to many jump commands you will fling the person from point to point
or well fling into themselves

this was with the pointer 1 tile next to the dwarf and activating the jump command 8 times
the poor dwarf was sent back to the original position and flung over time and time again so much that his last position didn't clear up and smack into himself
going so fast you hit yourself in the past present and future.
so uhh remember kids don't attempt to shine spark unless you have loads of muscle and fat to absorb the blow, or ancient bird people armor.
oh well best slap some mechanic where if someone grappled then jumping takes them with you.
Logged
I thought I would I had never hear my daughter's escapades from some boy...
DAMN YOU RUMRUSHER!!!!!!!!
"body swapping and YOU!"
Adventure in baby making!Adv Homes

Max™

  • Bay Watcher
  • [CULL:SQUARE]
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #2489 on: April 15, 2015, 10:19:54 pm »

I did that when I tried flipping some of the flags off without nulling the speed. I could move around but I kept getting jostled back in the direction of my flight path and if I moved far enough that way I could get the "You jump out of your flight path!" message.
Logged
Pages: 1 ... 164 165 [166] 167 168 ... 360