I am in need of a generic item pick up script, that I can set to any item
by way of ID or some other way, to display a string when an item is picked up.
a generic item pick up script please.
item script string{
void run(int str){
Screen->Message(str);
}
}Where D0 in the item editor is the ID number of the string.
thanks Joe
EDIT: I can't get the script to work.....
oh, what's wrong?
Make sure you attach it to the pickup tag script in the item editor, not the action tab script.
nevermind, it works now, I forgot to do something.
And another thing, make sure you have the rule "messages dissapear" checked, or the message will stay on screen. It can get anoying if the item happens to be in a room full of enemies, and a big string that says "You got the _____" is blocking the top half of the screen.
Hey, why not tweak it a little? Make it use the D7 argument so it will most likely not interfere with the action script. Like this:
item script string{
void run(int null0, int null1, int null2, int null3, int null4, int null5, int null6, int str){
Screen->Message(str);
}
}What does moving it's argument do differently?
..Oh, I guess I should learn how to read.
Perhaps link it to another blank message.