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.
Can someone demo the new Scripting commands?
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"; }
} ]
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"; }
} ]
- QuestOfDreams
- Site Admin
- Posts: 1520
- Joined: Sun Jul 03, 2005 11:12 pm
- Location: Austria
- Contact:
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)
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)
- QuestOfDreams
- Site Admin
- Posts: 1520
- Joined: Sun Jul 03, 2005 11:12 pm
- Location: Austria
- Contact:
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...
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...
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
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
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);
}]
}
//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);
}]
}