by Bainespal » Thu Aug 12, 2010 7:54 am
In hugolib.h, the NewMessages routine appears to be a stub intended to be replaced in the game code so that the user can customize specific parser messages.
Code: Select all
routine NewMessages(r, num, a, b) ! The NewMessages routine may be
{ ! replaced, and should return true
return false ! if a replacement message <num>
} ! exists for routine <r>
I'm trying to modify the third message for the CheckReach routine (here's the code from Message):
Code: Select all
case &CheckReach
{
select num
case 1
{
print "Except that "; The(parent(a)); \
MatchPlural(parent(a), "has", "have"); \
" "; The(a); "."
}
case 2
{
print "Except that "; The(parent(a)); \
MatchPlural(parent(a), "doesn't", "don't"); \
" want to give "; The(player, true); \
" "; The(a); "."
}
case 3: print CThe(player); " can't reach "; The(a); \
" from "; The(parent(player)); "."
}
I want to replace case 3, so I tried
Code: Select all
replace NewMessages(CheckReach, 3)
{ [My modification here.] }
in my code, but I get errors, regardless as to whether I try "NewMessages(CheckReach, 3)" or "NewMessages(&CheckReach, 3)".
I actually haven't tried to create a different message in place of the library message yet, because I haven't figured out how to do what I want it to (de-capitalize room names). But I can't experiment to try to do that until I can successfully replace the message.
In hugolib.h, the NewMessages routine appears to be a stub intended to be replaced in the game code so that the user can customize specific parser messages.
[code]routine NewMessages(r, num, a, b) ! The NewMessages routine may be
{ ! replaced, and should return true
return false ! if a replacement message <num>
} ! exists for routine <r>[/code]
I'm trying to modify the third message for the CheckReach routine (here's the code from Message):
[code] case &CheckReach
{
select num
case 1
{
print "Except that "; The(parent(a)); \
MatchPlural(parent(a), "has", "have"); \
" "; The(a); "."
}
case 2
{
print "Except that "; The(parent(a)); \
MatchPlural(parent(a), "doesn't", "don't"); \
" want to give "; The(player, true); \
" "; The(a); "."
}
case 3: print CThe(player); " can't reach "; The(a); \
" from "; The(parent(player)); "."
}[/code]
I want to replace case 3, so I tried
[code]replace NewMessages(CheckReach, 3)
{ [My modification here.] }[/code] in my code, but I get errors, regardless as to whether I try "NewMessages(CheckReach, 3)" or "NewMessages(&CheckReach, 3)".
I actually haven't tried to create a different message in place of the library message yet, because I haven't figured out how to do what I want it to (de-capitalize room names). But I can't experiment to try to do that until I can successfully replace the message.