Stone Story RPG

Stone Story RPG

Not enough ratings
Sight Stone Automation Script
By MAKAIROSI
Two scripts for helping with identifying enemies. I made them for myself, and I thought I'd share them.
   
Award
Favorite
Favorited
Unfavorite
Identify Next Enemy Button
This script adds a button in the UI that you can click on to identify the next enemy. It turns itself off when the enemy is identified.

Not very helpful, as an enemy might jump ahead in line, and the sight stone will be used on that instead. Still, fun to play around with.

infoText(18) func infoText(infoTextY) >`0,@infoTextY@,Loc: @loc.id@ ?foe.id >`0,@infoTextY-1@,Foe: @foe.id@ : >`0,@infoTextY-1@,Foe: ---- //>`0,@infoTextY-2@,R: @item.right@ //>`0,@infoTextY-3@,L: @item.left@ var toggle = false func OnPressed() toggle = !toggle ?toggle = true sb.bcolor = #green : sb.bcolor = #red ?item.left = sight & item.left.state = 4 OnPressed() ?toggle = true equipL sight ?foe.id var sb = ui.AddButton() sb.anchor = top_left sb.dock = top_left sb.y = 1 sb.x = 10 sb.w = 9 sb.text = "(<o>)" sb.bcolor = #red sb.hcolor = #green sb.SetPressed(OnPressed)
Auto-Identify Enemies
This isn't infallible but it will do the trick in most cases.
It uses the "storage" functions to store information between runs. You can change the default key I'm using, but make sure it's something that definitely won't already exist in the storage. Add something like my_own_custom_thing or something.

It automatically equips the sight stone whenever it finds a foe that doesn't exist in the storage, so it can identify the enemy for the book of enemies. Since it's using the storage, you will have to go through all areas again, and it will identify all enemies from the start, so that it can add them to storage.

Though this sounds troublesome, it doesn't take a lot of time.
Anyway here's the code:

var strKey = "my_loggedFoes" var mustEquip = false ?mustEquip = false ?foe.id setup() >@find(foe.id)@ ?find(foe.id) = false mustEquip = true ?mustEquip = true equipL sight ?item.left = sight & item.left.state = 4 mustEquip = false add(foe.id) func get() return storage.Get(strKey) func set(value) storage.Set(strKey, value) func setup() ?storage.Has(strKey) = false set("") func find(str) var exists = false var ene = get() var a = string.Split(ene) exists = a.Contains(str) return exists func add(value) var str = get() str += " " str += value set(str)