Skip to content

Instantly share code, notes, and snippets.

@Rumrusher
Rumrusher / tofort16.lua
Last active September 28, 2022 09:30 — forked from warmist/tofort.lua
Switch to fort mode and back to advmode with little saving 9/28/2022 now there's two versions of this old script one more close to the original, and one made for using in playerforts... and adv nobles owning campsites
-- changes from advmode to fort safely and back (hopefully)
--[[Now to warn you about saving and loading in either game mode might lead
to some side issues, for saving in fort mode switching to adv mode needs the adv to be `bodyswap`
back in again. for Saving in Adv to switch to Fort mode you probably be safe-ish if the site.
isn't a nano fort or a site that isn't 3x3 small. otherwise the game will try to resize the map.
oh and switching to fort mode on any pre-gen site larger than 4x4 might implode one pc if
you don't have like 20 gigs of memory for the 16x16 embark size.
ok so this version of this script has be updated again so that caravans and visitors and migrants
could show up at any edge of the map... and maybe leave from any spot... of the z level you assign the site too.
@Rumrusher
Rumrusher / telekinesis.lua
Created May 4, 2016 18:51
started as a Jump code Max and I co-created from the propel.lua from rose scripts now modified to now only throw items around. uses warmists get creature at xyz functions
function telekinesis(itemSource,itemTarget)
local curpos
if df.global.ui_advmode.menu==1 then
curpos=df.global.cursor
else
print ("No cursor located! uhh wouldn't had effected anything though.")
return
end
@Rumrusher
Rumrusher / addciv.lua
Created March 16, 2016 19:36
this script will randomly add an avaliable civ to embark screen and constant use will add more. up to 10+
local dlg=require("gui.dialogs")
local testciv=df.global.world.entities.all
require("utils").insert_sorted(dfhack.gui.getCurViewscreen().available_civs,df.global.world.entities.all[112],"id")
require("utils").insert_sorted(dfhack.gui.getCurViewscreen().available_civs,df.global.world.entities.all[302],"id")
require("utils").insert_sorted(dfhack.gui.getCurViewscreen().available_civs,df.global.world.entities.all[234],"id")
require("utils").insert_sorted(dfhack.gui.getCurViewscreen().available_civs,df.global.world.entities.all[134],"id")
require("utils").insert_sorted(dfhack.gui.getCurViewscreen().available_civs,df.global.world.entities.all[32],"id")
require("utils").insert_sorted(dfhack.gui.getCurViewscreen().available_civs,df.global.world.entities.all[274],"id")
require("utils").insert_sorted(dfhack.gui.getCurViewscreen().available_civs,df.global.world.entities.all[47],"id")
@Rumrusher
Rumrusher / jump.lua
Last active August 29, 2015 14:19
Jump code Max and I co-created from the propel.lua from rose scripts now with an throw option added.
function jump(unitSource,unitTarget)
local curpos
if df.global.ui_advmode.menu==1 then
curpos=df.global.cursor
else
print ("No cursor located! You would have slammed into the ground and exploded.")
return
end
@Rumrusher
Rumrusher / walljump.lua
Created July 29, 2014 08:26
this will give you the extra kick to your jumps only works if you're next to a wall, also follows laws of momentum so if your character comes to a complete stop they might not have enough X or Y speed to push them over the ledge.
function JUMP2()
--for k,v in pairs(df.global.world.proj_list.next.item) do
--printall(df.global.world.vehicles.active)
--S=0+getline()
--printall(df.global.world.vehicles.active[0])
--df.global.world.vehicles.active[0].speed_y=(-900000)
df.global.world.proj_list.next.item.accel_z=(20000)
df.global.world.proj_list.next.item.speed_z=(20000)
end
end
@Rumrusher
Rumrusher / selectworker.lua
Created July 27, 2014 10:29
it's a modified select adventure bodyswap to align a unit to the Comfort.lua script
function getxyz() -- this will return pointers x,y and z coordinates.
local x=df.global.cursor.x
local y=df.global.cursor.y
local z=df.global.cursor.z
return x,y,z -- return the coords
end
function getCreatureAtPos(x,y,z) -- gets the creature index @ x,y,z coord
--local x,y,z=getxyz() --get 'X' coords
local vector=df.global.world.units.all -- load all creatures
for i = 0, #vector-1 do -- look into all creatures offsets
@Rumrusher
Rumrusher / spawn.lua
Created July 24, 2014 21:09
40.0x version of the script
--create unit at pointer or given location and with given civ (usefull to pass -1 for enemy). Usage e.g. "spawnunit DWARF 0 Dwarfy"
--[=[
Creature (ID), caste (number), name, x,y,z , civ_id(-1 for enemy, optional) for spawn.
Made by warmist, but edited by Putnam for the dragon ball mod to be used in reactions
note that it's extensible to any autosyndrome reaction to spawn anything due to this; to use in autosyndrome, you want \COMMAND spawnunit CREATURE caste_number name \LOCATION
TODO:
birth time
death time
real body size
blood max
@Rumrusher
Rumrusher / Conga.gml
Created July 6, 2014 10:16
Conga attempt needs spriteloader and to be converted into a serversent.
object_event_add(Character,ev_step,ev_step_normal,'
repeat(global.frameskip)
{
// Do movement
if(taunting)
{
hspeed *= delta_mult_skip(baseFriction);
}
}
@Rumrusher
Rumrusher / everyoneisEngi.gml
Created April 3, 2014 16:41
put this on your server if you want invisible Floating autoguns that fire on you.
//Roll The Dice server plugin by lorgan
// current error the new sentry drop causes the plugin to add extra speed and send it plumeting to it's doom, also needs to be server sent so that players can see the orbital strike cannons.
global.canRoll = true;
global.effects = 28;
global.effect[0] = " Exploded!";
global.effect[1] = " Turned into a timebomb! Detonation in 10 seconds!"
global.effect[2] = " froze for 10 seconds!";
global.effect[3] = " Lost health!"
global.effect[4] = " can't jump for 20 seconds!";
@Rumrusher
Rumrusher / Rocketbootz.gml
Created March 25, 2014 05:39
Goomba stomp + this = stomp fest with rocket bootz
if (player.class == CLASS_MEDIC || player.class == CLASS_ENGINEER || player.class == CLASS_SPY) && taunting{
if tauntindex == 0 or tauntindex == tauntlength {
//Nwith(SentryTurret) team = 3;
effect = noone;
vspeed = 15;
moveStatus = 1;
}
}
if (player.class == CLASS_SOLDIER || player.class == CLASS_DEMOMAN || player.class == CLASS_SNIPER || player.class == CLASS_MEDIC||player.class == CLASS_PYRO ){