View previous topic :: View next topic |
Author |
Message |
msw188
Joined: 02 Jul 2003 Posts: 1041
|
Posted: Sun Dec 10, 2006 7:39 pm Post subject: Get hero name? |
|
|
How should get hero name work? Right now I have:
get hero name (1,herobyrank(0))
trace(1)
and I never get anything in my trace. The script compiles fine, but I can't get my string. _________________ My first completed OHR game, Tales of the New World:
http://castleparadox.com/gamelist-display.php?game=161
This website link is for my funk/rock band, Euphonic Brew:
www.euphonicbrew.com |
|
Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Mon Dec 11, 2006 10:18 am Post subject: Re: Get hero name? |
|
|
Hmmm... the documentation at 'plot:get hero name' is pretty vague here.
The command expects the hero's position in the party. If I am guessing correctly, you want to get the name of the leader. You should write:
Code: |
get hero name (1,find hero(hero by rank(0)))
trace(1)
|
'plot:hero by rank' finds the ID of the hero at position 0 in the walkabout party
'plot:find hero' find the position in the party of that ID number
The three possible different ways of referring to heroes can be confusing.
.... but actually, when I look at the code, i think that even when you do it right, it will still not work. There appears to be an off-by-one bug in get hero name that causes it to read one slot too early. EDIT: no, enevermind. I was wrong. There is no bug. I tested my example above and it works perfectly. |
|
Back to top |
|
 |
msw188
Joined: 02 Jul 2003 Posts: 1041
|
Posted: Mon Dec 11, 2006 8:17 pm Post subject: |
|
|
Ah, thanks James. I think that it would be a very good (and easy) idea to point this out on the documentation for "get hero name", and "set hero name" too I imagine. _________________ My first completed OHR game, Tales of the New World:
http://castleparadox.com/gamelist-display.php?game=161
This website link is for my funk/rock band, Euphonic Brew:
www.euphonicbrew.com |
|
Back to top |
|
 |
Rimudora Psychopath yandere Halloween 2006 Creativity Winner


Joined: 26 May 2005 Posts: 335
|
Posted: Mon Dec 11, 2006 8:36 pm Post subject: |
|
|
Wouldn't it be better then just to use getheroname(1,0) ? |
|
Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Tue Dec 12, 2006 9:41 am Post subject: |
|
|
msw188 wrote: | Ah, thanks James. I think that it would be a very good (and easy) idea to point this out on the documentation for "get hero name", and "set hero name" too I imagine. |
I have updated the doucmentation.
Rimudora wrote: | Wouldn't it be better then just to use getheroname(1,0) ? |
That would usually work out, but what if the first party slot was empty, and the leader was actually in the second party slot? (That often happens after hero swapping) |
|
Back to top |
|
 |
Moogle1 Scourge of the Seas Halloween 2006 Creativity Winner


Joined: 15 Jul 2004 Posts: 3377 Location: Seattle, WA
|
Posted: Tue Dec 12, 2006 9:53 am Post subject: |
|
|
There's also the shorter leader function, which returns herobyrank(0) as well. (I mistakenly thought it was a constant with value 0 until I checked just now.) _________________
|
|
Back to top |
|
 |
|