Goonstation Forums
[QOL] [Feature] State AI Laws (Advanced) - Printable Version

+- Goonstation Forums (https://forum.ss13.co)
+-- Forum: Discussion (https://forum.ss13.co/forumdisplay.php?fid=6)
+--- Forum: Patches (https://forum.ss13.co/forumdisplay.php?fid=30)
+---- Forum: Implemented (https://forum.ss13.co/forumdisplay.php?fid=31)
+---- Thread: [QOL] [Feature] State AI Laws (Advanced) (/showthread.php?tid=12846)



[QOL] [Feature] State AI Laws (Advanced) - UrsulaMejor - 09-01-2019

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/goonstation-2016/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




RE: [QOL] [Feature] State AI Laws (Advanced) - Adhara In Space - 09-01-2019

i am Not an ai main but this seems really nice to have, i think


RE: [QOL] [Feature] State AI Laws (Advanced) - NateTheSquid - 09-02-2019

This is quite neat, i'd suggest naming the 'standard laws' one to 'State Asimov Laws'


RE: [QOL] [Feature] State AI Laws (Advanced) - UrsulaMejor - 09-02-2019

(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 :]


RE: [QOL] [Feature] State AI Laws (Advanced) - UrsulaMejor - 09-02-2019

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)



RE: [QOL] [Feature] State AI Laws (Advanced) - Superlagg - 09-04-2019

Does it let the AI just state law 1 a few hundred times?


RE: [QOL] [Feature] State AI Laws (Advanced) - UrsulaMejor - 09-04-2019

negative; duplicates are condensed down to one statement per law