Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 30 31 [32] 33 34 ... 42

Author Topic: [DFHack] Roses' Script Collection Updated 5/4/15  (Read 125408 times)

Vherid

  • Bay Watcher
  • [CREATURE:SLARK]
    • View Profile
Re: [DFHack] Roses' Script Collection
« Reply #465 on: December 10, 2014, 06:16:24 pm »

By combining it with item-trigger you can make it so a weapon you equip gives the unit the interaction needed to use the projectile script.

Oh nice, I would indeed be able to put together some proper ww2 weapons then. Is there like a guide or crash course on implementing scripts somewhere?

Also how viable/possible would things like grenades be with the script?
« Last Edit: December 10, 2014, 07:53:13 pm by Vherid »
Logged

Roses

  • Bay Watcher
    • View Profile
Re: [DFHack] Roses' Script Collection
« Reply #466 on: December 10, 2014, 07:58:56 pm »

For grenades you are going to want to use projectile-trigger. I believe Masterwork has examples of all of this stuff.
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: [DFHack] Roses' Script Collection
« Reply #467 on: December 10, 2014, 10:07:16 pm »

Masterwork is not updated. Its examples are worthless for modding nowadays.

Which is sad, because it's a really damn good example for modding six months ago.

Roses

  • Bay Watcher
    • View Profile
Re: [DFHack] Roses' Script Collection Updated 12/11/15
« Reply #468 on: December 11, 2014, 09:49:06 pm »

Alright, finally uploaded the fixes to the class system. Should be working correctly now.
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: [DFHack] Roses' Script Collection Updated 12/11/15
« Reply #469 on: December 11, 2014, 10:41:14 pm »

Code: [Select]
...warf Fortress\ASCII\hack\lua\classes\establish-class.lua:9: attempt to index
field 'roses' (a nil value)
stack traceback:
        ...warf Fortress\ASCII\hack\lua\classes\establish-class.lua:9: in functi
on 'establishclass'
        ...arf Fortress\ASCII\hack\scripts/classes/change-class.lua:98: in main
chunk
        (...tail calls...)
        ...ta/save/region1/raw/scripts/fortbent/claspect_assign.lua:58: in funct
ion 'makeClaspect'
        ...ta/save/region1/raw/scripts/fortbent/claspect_assign.lua:82: in funct
ion 'assignAllClaspects'
        ...ta/save/region1/raw/scripts/fortbent/claspect_assign.lua:92: in main
chunk
        (...tail calls...)

It ain't properly initializing GlobalTable.roses when I run change-class first thing. Do I need to run something beforehand?

EDIT: yes, base/classes somehow got removed from dfhack.init, assumedly during one of my copy+paste sprees  ::)

EDIT 2: Damn, yeah, my dfhack.init's all wrong now...

EDIT 3: Fixed that, now this:

Code: [Select]
...f Fortress\ASCII\hack\lua\classes\requirements-spell.lua:39: attempt to index
 field '?' (a nil value)
stack traceback:
        ...f Fortress\ASCII\hack\lua\classes\requirements-spell.lua:39: in funct
ion 'checkspell'
        ...warf Fortress\ASCII\hack\scripts/classes/learn-skill.lua:50: in main
chunk
        (...tail calls...)
        ...arf Fortress\ASCII\hack\scripts/classes/change-class.lua:82: in funct
ion 'changeclass'
        ...arf Fortress\ASCII\hack\scripts/classes/change-class.lua:101: in main
 chunk
        (...tail calls...)
        ...ta/save/region1/raw/scripts/fortbent/claspect_assign.lua:58: in funct
ion 'makeClaspect'
        ...ta/save/region1/raw/scripts/fortbent/claspect_assign.lua:82: in funct
ion 'assignAllClaspects'
        ...ta/save/region1/raw/scripts/fortbent/claspect_assign.lua:92: in main
chunk
        (...tail calls...)

persistTable.GlobalTable.roses.UnitTable[tostring(key)]['Classes'][persistTable.GlobalTable.roses.UnitTable[tostring(key)]['Classes']['Current']] is coming up nil for some reason.

Um. Wow. unitClasses[currentClassName] looks better, heh.

EDIT 4: Oh, didn't notice that it made a successful class assignment immediately beforehand. Probably on my side, then, gimme a sec.

EDIT 5: Nope.

Code: [Select]
[lua]# printall(persist_table.GlobalTable.roses.UnitTable._children)
1                        = 736
2                        = 737
3                        = 738
4                        = 739
5                        = 740
6                        = 741
7                        = 742

I don't think that's right?

EDIT 6: Wow, it's completely incomprehensible how that could have happened. That seems to be a bug with my current version of persist-table than with the classes system.

EDIT 7: Found it. It was that mt fix earlier.
« Last Edit: December 11, 2014, 11:21:31 pm by Putnam »
Logged

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: [DFHack] Roses' Script Collection
« Reply #470 on: December 12, 2014, 09:02:16 pm »

Masterwork is not updated. Its examples are worthless for modding nowadays.

Which is sad, because it's a really damn good example for modding six months ago.
Cant update... still no spawnunit for dfhack. And I tried using insolors localisation patcher with a new string dump, couldnt get it to work properly.
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: [DFHack] Roses' Script Collection
« Reply #471 on: December 12, 2014, 09:07:36 pm »

Masterwork is not updated. Its examples are worthless for modding nowadays.

Which is sad, because it's a really damn good example for modding six months ago.
Cant update... still no spawnunit for dfhack.

https://gist.github.com/Rumrusher/f4d0ba18ba6868d38221

Roses

  • Bay Watcher
    • View Profile
Re: [DFHack] Roses' Script Collection Updated 12/11/15
« Reply #472 on: December 13, 2014, 12:04:20 am »

Sorry was traveling. Is it working now Putnam?
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: [DFHack] Roses' Script Collection Updated 12/11/15
« Reply #473 on: December 13, 2014, 12:22:00 am »

Yeah, I had to patch persist-table.lua

Roses

  • Bay Watcher
    • View Profile
Re: [DFHack] Roses' Script Collection Updated 12/11/15
« Reply #474 on: December 13, 2014, 01:21:11 am »

Yeah, that mt -> 'mt' thing really caused some issues.
Logged

Roses

  • Bay Watcher
    • View Profile
Re: [DFHack] Roses' Script Collection Updated 12/11/15
« Reply #475 on: December 13, 2014, 10:04:06 pm »

So I am going to be visiting family soon in poor internet country. This means I will finally have some time to work on my ever growing back-log of stuff to do. Current goals for this break (in relative order)
  • Finish moving the Civilization System to the new persistent storage method
  • Finish the Event System
  • Finish the Unit Viewer GUI
  • Combine Class, Civilization, and Event systems into an integrated system allowing cross calling
  • Write building-trigger script, to allow outside/inside only buildings, limited number of buildings, buildings placed near water/magma, etc...
  • Write a modified spawn-unit script to allow better control of the creature that is spawned
  • Create an in-game journal GUI (details on front page)
  • Create a Quest System that ties in with the journal
  • Finish creating my spell database
Now the main reason I am posting is because I might have forgotten something that I told someone I would do. So before I disappear into the internet void, if there are any things that I need to fix or said that I would do, let me know and I will add them to the top of my list. Hoping that I can start the new year with a clean ToDo list.

EDIT: A little work done
« Last Edit: December 17, 2014, 03:52:52 am by Roses »
Logged

Boltgun

  • Bay Watcher
  • [UTTERANCES]
    • View Profile
Re: [DFHack] Roses' Script Collection
« Reply #476 on: December 19, 2014, 06:16:49 am »

Masterwork is not updated. Its examples are worthless for modding nowadays.

Which is sad, because it's a really damn good example for modding six months ago.
Cant update... still no spawnunit for dfhack.

https://gist.github.com/Rumrusher/f4d0ba18ba6868d38221

Fantastic, I might modify it so placeUnit returns the creature. That way, as a library, you can perform further actions after creating the unit.
Logged

Roses

  • Bay Watcher
    • View Profile
Re: [DFHack] Roses' Script Collection Updated 12/11/15
« Reply #477 on: December 19, 2014, 08:33:07 pm »

Work continues on the event system. The current syntax is;
Code: [Select]
[EVENT:TEST_EVENTS_SYSTEM_1]
 [NAME:systems test] --name of event
 [CHECK:WEEKLY] --how often to check for the event
 [CHANCE:1] --% chance of event occuring
 [REQUIREMENT:COUNTER:FIRE:100] --checks if the counter has reached a specific value, syntax is COUNTER:COUNTER_ID:#
 [REQUIREMENT:TIME:36000] --checks if an amount of time has passed (number of ticks)
 [REQUIREMENT:POPULATION:100] --checks the number of active adult members of your fortress there are
 [REQUIREMENT:WEALTH:10000] --checks the wealth value of your fortress
 [REQUIREMENT:IMPORT:10000] --checks the import value of your fortress
 [REQUIREMENT:EXPORT:10000] --checks the export value of your fortress
 [REQUIREMENT:BUILDING:CUSTOM_BUILDING] --checks to see if you have the CUSTOM_BUILDING built
 [REQUIREMENT:SKILL:FORGE_WEAPON:15] --checks to see if any of your population has a skill of a desired level (ANY can also be used)
 [EFFECT:SAMPLE_EFFECT_1] --start of declaration of event effects
  [EFFECT_NAME:kill random unit] --effects name
  [EFFECT_CHANCE:100] --% chance the effect will trigger if the event triggers
  [EFFECT_REQUIREMENT:--] -- takes all the same arguments as above, but specified for this effect
  [UNIT:RANDOM] --if your script specifies a unit, this will tell it what unit to pick, valid values include
   --RANDOM
   --RANDOM:SPECIFIC_CREATURE
   --POPULATION:RANDOM/SPECIFIC_CREATURE
   --CIV:RANDOM/SPECIFIC_CREATURE
   --FRIENDLY:RANDOM/SPECIFIC_CREATURE
   --ENEMY:RANDOM/SPECIFIC_CREATURE
   --SIEGER:RANDOM/SPECIFIC_CREATURE
   --AMBUSHER:RANDOM/SPECIFIC_CREATURE
   --TRADER:RANDOM/SPECIFIC_CREATURE
   --ADULT:RANDOM/SPECIFIC_CREATURE
   --CHILD:RANDOM/SPECIFIC_CREATURE
   --ANIMAL:RANDOM/SPECIFIC_CREATURE
   --ANIMAL:WILD:RANDOM/SPECIFIC_CREATURE
   --ANIMAL:PET:RANDOM/SPECIFIC_CREATURE
   --ANIMAL:PET:WAR_TRAINED/HUNT_TRAINED:RANDOM/SPECIFIC_CREATURE
  [SCRIPT:"special/change-value -unit UNIT -token blood -percent //-100"]
 [EFFECT:SAMPLE_EFFECT_2]
  [EFFECT_NAME:spawn blood blob] --effects name
  [EFFECT_CHANCE:10] --% chance the effect will trigger if the event triggers
  [LOCATION:SURFACE:RANDOM] --if your script specifies a location, this will tell it where to pick, valid values include
   --RANDOM
   --SURFACE:RANDOM
   --SURFACE:EDGE:RANDOM/NORTH/SOUTH/EAST/WEST
   --SURFACE:CENTER
   --SURFACE:CIRCLE:#
   --CAVERN:RANDOM/1/2/3:RANDOM
   --CAVERN:RANDOM/1/2/3:EDGE:RANDOM/NORTH/SOUTH/EAST/WEST
   --CAVERN:RANDOM/1/2/3:CENTER
   --CAVERN:RANDOM/1/2/3:CIRCLE:#
   --BUILDING:RANDOM
   --BUILDING:CUSTOM_BUILDING
   --LOCATION:WAITING_AREA
   --LOCATION:BURROW
   --LOCATION:IDLE
   --UNIT:RANDOM
   --UNIT:CLASS
   --UNIT:PROFESSION
  [SCRIPT:"mod-tools/spawn-unit -location LOCATION -creature TEST_CREATURE"]
Other options will most likely be included (for both requirements and UNIT/LOCATION), any that people are interested in seeing?

EDIT: Effects can now be contingent on previous effects (i.e. effect 2 requires that effect 1 occurred) and can take the arguments for different effects (i.e. you can specify that the same unit get chosen for effect 2 as effect 1). For this change the syntax for declaring an effect has changed to
Code: [Select]
[EFFECT:SAMPLE_EFFECT:1]Where the number specifies the order to apply the effects in.
« Last Edit: December 24, 2014, 02:34:32 am by Roses »
Logged

expwnent

  • Bay Watcher
    • View Profile
Re: [DFHack] Roses' Script Collection Updated 12/11/15
« Reply #478 on: December 27, 2014, 05:47:29 pm »

Since you have the most experience with its cousin scripts: can you test if item-trigger works for you? Two users have reported crash bugs but I can't reproduce it.
Logged

Roses

  • Bay Watcher
    • View Profile
Re: [DFHack] Roses' Script Collection Updated 12/11/15
« Reply #479 on: December 27, 2014, 05:53:16 pm »

Since you have the most experience with its cousin scripts: can you test if item-trigger works for you? Two users have reported crash bugs but I can't reproduce it.

Sure, I will test it out. I'm going to need it for what I am planning anyway, so it'll be good to learn the ropes. Are there any things I should know about it first? Does it work in arena? Adventure? Fort only? Is there anything in particular I should look out for/be testing, or just a general check to make sure it's working?
Logged
Pages: 1 ... 30 31 [32] 33 34 ... 42