Read-only archive of the Armageddon Games Forums Archive (2000–2026) · About this archive

Pickup Message script

7 replies · 2,195 views · Started 09 June 2007

Please don't insult me, I'm new at this. But can someone tell me what's wrong with this code? It won't compile.


import "std.zh"
item script SwordMessage
{

void run()
{
void Screen->Message(1)
}
}


I'm trying to make it display a string which will appear when the player picks up the sword. (I know where to assign it.)

Please help! I have no idea what I'm doing wrong!

I know far less than you do, but since it certainly couldn't hurt, ... try removing the "void" from "void Screen->Message(1)" ?

Yes, that should do it. That first "void" in the documentation means that the function doesn't return anything, and so you can't assign the function to a variable.


int x = Screen->Message(1); //not allowed
ffc f = Screen->LoadFFC(1); //OK, since LoadFFC has return type ffc.

I know nearly nothing about scripting in ZC but still this can be done with a single line of code in ZASM

(space)MASGSTRV #

Where it says (space) it's just one hit of the spacebar. # is the string ID.

Thanks! I did that before, but it wasn't working because I mistakenly forgot to put a ; at the end.

Questions: wow, ZASM looks a little simpler. I kinda prefer ZScript, though, because it seems more familiar to me.

EDIT: Two things:

1. Link can still move around while the script is displaying. Any way to fix that?
2. The message stays on screen until you leave, but I think this can be solved by answering question 1.

There's a quest rule, "Messages Freeze All Action." That will freeze link in place. And yeah, pure ASM can be useful for very short scripts or when you want low-level control of the script, such as direct access to the stack.