Castle Paradox Forum Index Castle Paradox

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Gamelist   Review List   Song List   All Journals   Site Stats   Search Gamelist   IRC Chat Room

Get hero name?

 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
msw188




Joined: 02 Jul 2003
Posts: 1041

PostPosted: Sun Dec 10, 2006 7:39 pm    Post subject: Get hero name? Reply with quote

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
View user's profile Send private message Visit poster's website
Bob the Hamster
OHRRPGCE Developer




Joined: 22 Feb 2003
Posts: 2526
Location: Hamster Republic (Southern California Enclave)

PostPosted: Mon Dec 11, 2006 10:18 am    Post subject: Re: Get hero name? Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
msw188




Joined: 02 Jul 2003
Posts: 1041

PostPosted: Mon Dec 11, 2006 8:17 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Rimudora
Psychopath yandere
Halloween 2006 Creativity Winner
Halloween 2006 Creativity Winner



Joined: 26 May 2005
Posts: 335

PostPosted: Mon Dec 11, 2006 8:36 pm    Post subject: Reply with quote

Wouldn't it be better then just to use getheroname(1,0) ?
Back to top
View user's profile Send private message Send e-mail
Bob the Hamster
OHRRPGCE Developer




Joined: 22 Feb 2003
Posts: 2526
Location: Hamster Republic (Southern California Enclave)

PostPosted: Tue Dec 12, 2006 9:41 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Moogle1
Scourge of the Seas
Halloween 2006 Creativity Winner
Halloween 2006 Creativity Winner



Joined: 15 Jul 2004
Posts: 3377
Location: Seattle, WA

PostPosted: Tue Dec 12, 2006 9:53 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address
Display posts from previous:   
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP! All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group