Thread Rating:
  • 5 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[QOL] [Feature] State AI Laws (Advanced)
#1
State AI Laws (Advanced)


- Renamed "State Laws 1-3" to "State Standard Laws" because, uh, that's what it does. It doesn't actually state laws 1-3

- New AI Verb: State Laws (Advanced). Allows the AI to state laws out of order, skip laws, and even renumber them to match the new order provided. Neat!

prpr: UM-016
https://github.com/goonstation/goonstati...6/pull/154

wait one hot second I just got inspired

new commit comin'

Pushed an update.

You can now specify an optional, and arbitrary, renumbering like so:

"1;3=2;4=3"
to do
1. Law 1
2. Law 3
3. Law 4



Reply
#2
i am Not an ai main but this seems really nice to have, i think
Reply
#3
This is quite neat, i'd suggest naming the 'standard laws' one to 'State Asimov Laws'
Reply
#4
(09-02-2019, 02:42 AM)NateTheSquid Wrote: This is quite neat, i'd suggest naming the 'standard laws' one to 'State Asimov Laws'

I was gonna name it that until someone reminded me that they're not Asimov either :]
Reply
#5
kurt found a bug where if you type "1;1;1" in, you get really odd results.

I've commit a fix to the pull request, but the fix is to add the following code:

Code:
// 1;1;1 becomes 1:list() and 1=2;1=3 becomes 1:(2,3), so we need to break the results down into one association per index
    
    var/found = 0
    for (var/index in laws_to_state)
        if(laws_to_state[index])
            for (var/association in laws_to_state[index])
                if(association)
                    laws_to_state[index] = association
                    found = 1
                    break
                    
            if(!found)
                laws_to_state[index] = null
                
            found = 0

after

Code:
laws_to_state = params2list(state)
Reply
#6
Does it let the AI just state law 1 a few hundred times?
Reply
#7
negative; duplicates are condensed down to one statement per law
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)