Does anyone know if its possible to make icons appear, when a player character approaches a door, or an NPC prior to initiating a conversation?
I had this idea to have multiple icons appear, so that a player can decide what they want to do - open a door, or lock it. Or speak to somebody or kidnap them.
Maybe this goes beyond the capabilities of RF.
Icons for actions etc
Re: Icons for actions etc
Yes, it is possible with scripting. There's a command called DrawFlipBookImage() which draws an image on the screen. The tough part is figuring out the conditions for it. Like how you are going to check if the player is near a door or a NPC.
Pain is only psychological.
- blutwurstchen
- Posts: 57
- Joined: Wed Mar 19, 2008 8:51 pm
Re: Icons for actions etc
Can it be done, by checking if the player is within a certain texel range, or if the crosshairs are on the NPC or object?
I'm not sure what this would look like in a script. It would be nice to see how this works in an RF demo. Does anyone have this working?
I'm not sure what this would look like in a script. It would be nice to see how this works in an RF demo. Does anyone have this working?
-
- Posts: 3
- Joined: Tue Jun 23, 2009 1:08 am
Re: Icons for actions etc
I was wondering the same thing. How would you be able to do it?
Re: Icons for actions etc
Use the command MouseSelect(false) to get the EntityName of the thing that is selected with the mouse cursor. If you don't see a mouse cursor, that's no problem, it is hidden and is automaticly where the crosshair is. Now you must give your Pawns and StaticEntityProxys EntityNames each a prefix which contains what the object is. (e.g. "ENEMY_" for enemies, "PAWN_" for talk-to-pawns, "CHEST_" for treasure chests) This way you can recognize in a script what was selected.
Like this:
SELECT=MouseSelect(false);
if(LeftCopy(SELECT,6)="ENEMY_")
{
//It is an enemy, draw attack icon
DrawFlipBookImage(...);
}
if(LeftCopy(SELECT,5)="PAWN_")
{
//It is a talk-to-pawn, draw speak icon
DrawFlipBookImage(...);
}
if(LeftCopy(SELECT,6)="CHEST_")
{
//It is a treasure ches, draw chest icon
DrawFlipBookImage(...);
}
More info on the used script commands is in the docs. For this to work, the script must be in LowLevel. If you use a scripted player, you should add it into
Sadly this doesn't work for world models (Doors, MovingPlatforms etc). I used a workaround by making my doors StaticEntityProxys and then teleporting the player inside and outside of houses.
Moved to Scripting, this seems to be more of a scripting problem than a level design problem.
Like this:
SELECT=MouseSelect(false);
if(LeftCopy(SELECT,6)="ENEMY_")
{
//It is an enemy, draw attack icon
DrawFlipBookImage(...);
}
if(LeftCopy(SELECT,5)="PAWN_")
{
//It is a talk-to-pawn, draw speak icon
DrawFlipBookImage(...);
}
if(LeftCopy(SELECT,6)="CHEST_")
{
//It is a treasure ches, draw chest icon
DrawFlipBookImage(...);
}
More info on the used script commands is in the docs. For this to work, the script must be in LowLevel. If you use a scripted player, you should add it into
Sadly this doesn't work for world models (Doors, MovingPlatforms etc). I used a workaround by making my doors StaticEntityProxys and then teleporting the player inside and outside of houses.
Moved to Scripting, this seems to be more of a scripting problem than a level design problem.
Everyone can see the difficult, but only the wise can see the simple.
-----
-----