Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: how to spawn units and get tile coordinates?  (Read 3699 times)

Mysterious Tree

  • Bay Watcher
    • View Profile
how to spawn units and get tile coordinates?
« on: April 16, 2021, 08:07:54 pm »

what the title says. its been driving me nuts seeing constant errors because i have no clue what im doing wrong
the command has coordinates, a race, a caste and age and its still not spawning it
i really just want to create a wyvern pit but since im not going to wait around for one to come lookie lookie at my suffering i want to just spawn one in to have some fun but im beginning to run out of my fun reserves because of this damn command

here is the command i was trying to execute in dfhack
Code: [Select]
modtools/create-unit -race WYVERN -caste MALE -age 200 -location 110 119 98 (also the wyvern is a modded creature i made so thats not where it goes wrong. it keeps rejecting argument 9 which is number 119 at -location and i dont understand why its doing that)

and in the meantime can someone also please explain to me how you can retrieve coordinates? is there some sort of command or something that i havent found yet or is it just brute force tile counting? because there is next to nothing on the internet about this stuff except for either outdated or vague things that im too dumb for...
Logged

Atomic Chicken

  • Bay Watcher
    • View Profile
Re: how to spawn units and get tile coordinates?
« Reply #1 on: April 29, 2021, 07:54:10 am »

Questions related to DFHack scripts should be posted in the Utilities and 3rd Party Applications subforum since they're more likely to be missed elsewhere, as was the case here.

The main issue with your command is that the coordinates need to be enclosed in square brackets as such:
Code: [Select]
modtools/create-unit -race WYVERN -caste MALE -age 200 -location [ 110 119 98 ]

As a modtools script, this was primarily designed to receive -location coordinates from scripts like modtools/reaction-trigger, which is why it currently lacks cursor support. Until an option to obtain the coordinates directly from the cursor is implemented, you may retrieve these manually by selecting the target location with your cursor and entering the following into the DFHack console:

Code: [Select]
lua printall(df.global.cursor)
Logged
As mentioned in the previous turn, the most exciting field of battle this year will be in the Arstotzkan capitol, with plenty of close-quarter fighting and siege warfare.  Arstotzka, accordingly, spent their design phase developing a high-altitude tactical bomber. 

Jundavr

  • Bay Watcher
    • View Profile
Re: how to spawn units and get tile coordinates?
« Reply #2 on: May 06, 2021, 07:18:56 pm »

You can also use a side utility of the teleport script and use "teleport -showpos" in the console. It'll simply display the coordinates you need.
Logged
I was out in the rain. So exasperating!