Can someone demo the new Scripting commands?

Topics regarding Scripting with Reality Factory
Post Reply
hike1
RF FAQ-Keeper
Posts: 607
Joined: Tue Jul 05, 2005 4:19 am
Contact:

Can someone demo the new Scripting commands?

Post 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.
Nout
Posts: 136
Joined: Tue Jul 05, 2005 5:14 pm

Post 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
Guest

Post 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"; }
} ]
User avatar
QuestOfDreams
Site Admin
Posts: 1520
Joined: Sun Jul 03, 2005 11:12 pm
Location: Austria
Contact:

Post 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)
Guest

Post by Guest »

where are the docs right now?
how do i get to them?
User avatar
QuestOfDreams
Site Admin
Posts: 1520
Joined: Sun Jul 03, 2005 11:12 pm
Location: Austria
Contact:

Post 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)
Guest

Post by Guest »

how incredibly conveinient. :)


Thanks you,
Fps
hike1
RF FAQ-Keeper
Posts: 607
Joined: Tue Jul 05, 2005 4:19 am
Contact:

Post 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...
Nout
Posts: 136
Joined: Tue Jul 05, 2005 5:14 pm

Post 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
hike1
RF FAQ-Keeper
Posts: 607
Joined: Tue Jul 05, 2005 4:19 am
Contact:

Post 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);
}]

}
Post Reply