Page 1 of 1

Can someone demo the new Scripting commands?

Posted: Tue Dec 27, 2005 9:37 pm
by hike1
Like mainly the bit where you put the cursor over an item or
person and it writes some text. And anything else cool, I can't
really tell from the docs what's cool. I'll supply the non-scripting
resources (actually I'll steal them) if someone writes the script with explanations.

Posted: Wed Dec 28, 2005 5:47 pm
by Nout
All mouse commands are script commands
You can look back to the old demo I posted a longer time ago. The scripts include most of the mouse commands

Posted: Sat Dec 31, 2005 6:47 pm
by Guest
This looks like the right code, in Virgil.s, basically I need to
know how to

A. make each of my pickups (gold, health, armor, weapons, etc.) light up when the cursor is over them

B. A little text appearing 'you see a health potion'.

I guess I'd just make a proj.act placeholder pawn and assign the
script to it, it could be a part of my default startup entities, like
the ground walking texture sounds, the in-game map, the player start, etc.

The command 'showpicture' isn't in the new scripting docs,
or I couldn't find it, I could only find showhudpicture.

SelectEntityByMouse[ ()
{
NAME = MouseSelect(false, true);
if (NAME = "")
{ ShowText(1, "", "", "Move the mouse on Leo and see what happens!", 13, "", 10, 100, "Right", 255);}
else
{ ShowText(1, "", "", "This Entity has name: "#NAME#". Try also attributes!#To continue, press the right mouse button", 13, "", 10, 150, "Right", 255); }
ShowText(2, "StaticProxy", "", "StaticProxy", 13, "", 0, 0, "Right", 255);
ShowText(3, "Attribute1", "", "Attribute", 13, "", -90, -90, "Right", 255);
ShowText(4, "Attribute2", "", "Attribute", 13, "", -90, -90, "Right", 255);
ShowText(5, "Virgil", "", "Pawn", 13, "", -90, -90, "Right", 255);
ShowText(6, "Knuckles", "", "Pawn", 13, "", -90, -90, "Right", 255);
ShowPicture(10 , true, "Attribute1", -70, -70, 0, 0, 0);
ShowPicture(11 , true, "Attribute2", -70, -70, 0, 0, 0);
ShowPicture(12 , true, "Virgil", -70, -70, 0, 0, 0);
ShowPicture(13 , true, "Knuckles", -70, -70, 0, 0, 0);
if (self.rightmousekey_pressed)
{
for I = 1 to 7
{ ShowText(I); }
for I = 10 to 14
{ ShowPicture(I, false); }
HighLevel("WalkToTeleport");
}
else
{ self.think = "SelectEntityByMouse"; }
} ]

Posted: Sat Dec 31, 2005 7:22 pm
by QuestOfDreams
The new scripting commands will be demonstrated in the full install of RF 0.75 that I'm putting together. I'll probably use Nout's demo for this purpose (with updated scripts). I renamed some of the script commands to (hopefully) make clearer what they are doing and to emphasize similarities with existing commands. ShowHudPicture is in fact the renamed version of ShowPicture.
Also in the ShowText command a new line in the text is indicated by <CR> (as in conversation or mesage texts) not # (note: in "#NAME#" the # are NOT new line indicators)

Posted: Tue Jan 03, 2006 4:41 pm
by Guest
where are the docs right now?
how do i get to them?

Posted: Tue Jan 03, 2006 6:54 pm
by QuestOfDreams
You can view the docs online or you can look in the docs folder of your realityfactory install (click on index.htm) (if you updated to 075 the docs got updated too, changes are marked yellow)

Posted: Wed Jan 04, 2006 4:19 pm
by Guest
how incredibly conveinient. :)


Thanks you,
Fps

Posted: Wed Jan 04, 2006 10:03 pm
by hike1
I'll probably use Nout's demo

Could you also make a little standalone showing how to

A. make each of my pickups (gold, health, armor, weapons, etc.) light up when the cursor is over them

B. A little text appearing 'you see a health potion'. ?

I don't think many people are going to be popping the whole Nout's demo
into their games...

Posted: Sat Jan 07, 2006 6:27 pm
by Nout
Hike,

The script posted earlier in this treat shows all
So to A. make each of my pickups (gold, health, armor, weapons, etc.) light up when the cursor is over them you add the script command

NAME = MouseSelect(false, true);

This 1 command does all for you and it returns the name of the actor that is pointed by the mouse. Yes, only this 1 line will do it

B. A little text appearing 'you see a health potion'.
ShowText(1, "StaticProxy", "", "StaticProxy", 13, "", 0, 0, "Right", 255);

See the docs (also the old included docs in my demo) for the syntax of these commands

Posted: Mon Jan 23, 2006 7:15 pm
by hike1
This is what I have, doesn't work, I don't see a cursor anywhere.


//cursorlightup.s
NAME [mytext]

Spawn[ ()
{
Console(true);
MouseControlledPlayer(false);
LowLevel("SelectEntityByMouse");
} ]

SelectEntityByMouse[ ()
{
NAME = MouseSelect(false, true);
if (NAME = "")

{ShowText(1, "StaticProxy", "", "StaticProxy", 13, "", 0, 0, "Right", 255);
}]

}