Aller au contenu

Photo

Float text on a non creature object


  • Veuillez vous connecter pour répondre
35 réponses à ce sujet

#1
Eguintir Eligard

Eguintir Eligard
  • Members
  • 1 832 messages
Is this possible? On a left click event script, it would pull a local string sText and float it above the object.
However I only see on creature as possible scripts so far (and that never worked anyway).

#2
kamalpoe

kamalpoe
  • Members
  • 711 messages
How about if you give the object the talk_object script and set up a one line barkstring convo.

#3
Dann-J

Dann-J
  • Members
  • 3 161 messages
The downside of the barkstring conversation is that the floating text will begin with [Placeable name]: (where 'placeable name' is obviously the name of the placeable).



It's can look ugly, but at least it works.

#4
kamalpoe

kamalpoe
  • Members
  • 711 messages
DannJ: not if there is no placeable name, or the name is inside {}.

#5
Eguintir Eligard

Eguintir Eligard
  • Members
  • 1 832 messages
where does that go? On Conversation?

#6
kamalpoe

kamalpoe
  • Members
  • 711 messages

Eguintir Eligard wrote...

where does that go? On Conversation?

on use. (And the object must be usable and reachable obviously.) I make the object plot as well so it can't be accidentally destroyed
.
IIrc the tag for the object should be the same as the conversation name as well.

#7
Shallina

Shallina
  • Members
  • 1 011 messages
it works fine, many way to do it, speakstring can do it,, a description can do it, there are many way to do it, it depend on what exactly you wana do.

#8
Eguintir Eligard

Eguintir Eligard
  • Members
  • 1 832 messages
But I dont want them to have to run up to it. The idea is to be able to click and have it float up a description like IWD/BG2.



Is there not some way to simply float text given a location? I dont have the toolset this second but Im guessing floattext is probably a core/base function you cant open up.




#9
MasterChanger

MasterChanger
  • Members
  • 686 messages

Eguintir Eligard wrote...

But I dont want them to have to run up to it. The idea is to be able to click and have it float up a description like IWD/BG2.


In that case you might be able to use OnLeftClick instead of OnUse.

The other thing you can do, which I don't know if you're aware of, is to make Examine the default action for that object rather than Automatic (which defaults to Use for placeables). It won't give you floating text, but it will give you the Examine eye-icon when you hover over it. That might be a useful compromise.

#10
Eguintir Eligard

Eguintir Eligard
  • Members
  • 1 832 messages
I am using left click I just need the float text. I guess as my LAST resort I will just float the text over the player. Thats 2nd best, but I really wanna make this thing work if it can.



I absolutely cannot stand reading the examine window and I never read any examine messages in campaigns because of it. But I always read the float text in BG2: just somehow seems more fun when its part of the game and not in a seperate window.

#11
Shallina

Shallina
  • Members
  • 1 011 messages
Juste put something in the description field of the object, and set one of the option, just have the mouse over the object will make a speastring above it.

#12
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
I would just change the name to include a description, as has already been mentioned. If it's a chest, instead of making the placeable's name "Chest" make it "Chest - This chest is iron bound and shows evidence of recent use" or something like that.

#13
Eguintir Eligard

Eguintir Eligard
  • Members
  • 1 832 messages
I got a new i-dear. If I have an IPoint speaker designated for the task, on the left click can be a script that spawns the speaker where it is, and it gets the float text.
The IP speaker will have its on spawnin script to destroyobject on itself in 10 seconds or whatever.

Sounds like a reasonably un-bulky way to do it i will see to it and let yall know.

Modifié par Eguintir Eligard, 08 janvier 2011 - 05:40 .


#14
Eguintir Eligard

Eguintir Eligard
  • Members
  • 1 832 messages
I don't know if my ingenius invention works because float text doesnt even work



void main()

{

SendMessageToPC(GetFirstPC(),"firing script describer");

string sDscrp = GetLocalString(OBJECT_SELF, "sDscrp");

object oDescriber = CreateObject(OBJECT_TYPE_PLACEABLE, "ip_describer", GetLocation(OBJECT_SELF));



FloatingTextStringOnCreature("test description", oDescriber, FALSE, 12.0);

DestroyObject(oDescriber, 12.0f);







}



I cant even get the words "test description" to come up. Wether I set faction to FALSE or TRUE. Come to think of it I dont think float text ever worked.



The object created is an invisible creature to speak the text on the local objects string as indicated. But before that happens I have to get at least the test text working and it does not any body?



If you are really feeling adventurous if there is a way to let the player left click without having their character forced to run up to the object that would be even better.

#15
MasterChanger

MasterChanger
  • Members
  • 686 messages

Eguintir Eligard wrote...

I don't know if my ingenius invention works because float text doesnt even work

void main()
{
SendMessageToPC(GetFirstPC(),"firing script describer");
string sDscrp = GetLocalString(OBJECT_SELF, "sDscrp");
object oDescriber = CreateObject(OBJECT_TYPE_PLACEABLE, "ip_describer", GetLocation(OBJECT_SELF));

FloatingTextStringOnCreature("test description", oDescriber, FALSE, 12.0);
DestroyObject(oDescriber, 12.0f);



}

I cant even get the words "test description" to come up. Wether I set faction to FALSE or TRUE. Come to think of it I dont think float text ever worked.

The object created is an invisible creature to speak the text on the local objects string as indicated.


Not how you have it now it isn't. The blueprint is probably right, but the CreateObject call passes a Placeable parameter. My guess is that you copied the script you had for the placeable and forgot to change that parameter when you tried it on the ip_speaker. ;)

#16
_Knightmare_

_Knightmare_
  • Members
  • 643 messages

MasterChanger wrote...

Eguintir Eligard wrote...

I don't know if my ingenius invention works because float text doesnt even work

void main()
{
SendMessageToPC(GetFirstPC(),"firing script describer");
string sDscrp = GetLocalString(OBJECT_SELF, "sDscrp");
object oDescriber = CreateObject(OBJECT_TYPE_PLACEABLE, "ip_describer", GetLocation(OBJECT_SELF));

FloatingTextStringOnCreature("test description", oDescriber, FALSE, 12.0);
DestroyObject(oDescriber, 12.0f);



}

I cant even get the words "test description" to come up. Wether I set faction to FALSE or TRUE. Come to think of it I dont think float text ever worked.

The object created is an invisible creature to speak the text on the local objects string as indicated.


Not how you have it now it isn't. The blueprint is probably right, but the CreateObject call passes a Placeable parameter. My guess is that you copied the script you had for the placeable and forgot to change that parameter when you tried it on the ip_speaker. ;)


I'm guessing the ip_ stands for "IPoint," in which case it is a placeable being spawned here (though EE specified it was an invisible creature being spawned - or perhaps that is the mistake as you pointed out there MC).

As to why it is not saying the string, try using the SpeakString() function instead of the FloatingText...() function. I was able to get a placeable object to do a SpeakString, but it wasn't really "centered" on the placeable itself. It was skewed a bit off to the side, though that may have to do with what is considered the center of the placeable itself and as opposed to the visual center (as we know some things don't spin in a perfect circle, instead they rotate around an off-set point which may be the official center of the placeable).

Modifié par _Knightmare_, 11 janvier 2011 - 08:58 .


#17
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
FloatingTextStringOnCreature() has only worked for the PC in my experience. As KM said, use SpeakString() or ActionSpeakString(). I found it effective to create a creature that is scripted hidden, and does not have a name, that way, when the speak string is spoken there isn't the ugly "placeable_name" in front of the string.

#18
Eguintir Eligard

Eguintir Eligard
  • Members
  • 1 832 messages
I saw my error before even reading these replies. I'll check back again once I've c hanged the placeable type constant.

#19
Eguintir Eligard

Eguintir Eligard
  • Members
  • 1 832 messages
I've got almost exactly what I want, having cured the moving up to the object problem and got the text printing.


so far I got this:

img16.imageshack.us/f/boatfloat.jpg/

By using this code:

void main()
{



string sColor = "<color=cyan>"; //default, change by area
object oPC = GetFirstPC();
location locNull = GetLocation(OBJECT_SELF);
location locWhere = CalcSafeLocation(oPC, locNull, 7.0f, FALSE, TRUE);

SendMessageToPC(oPC,"firing script describer");
string sDscrp = GetLocalString(OBJECT_SELF, "sDscrp");
object oDescriber = CreateObject(OBJECT_TYPE_CREATURE, "ip_describer", locWhere);

if (GetIsObjectValid(oDescriber)==FALSE)
    {
    SendMessageToPC(oPC, "invalid object");
    FloatingTextStringOnCreature(sColor + sDscrp, oPC, FALSE, 12.0);
    }
        else AssignCommand(oDescriber, ActionSpeakString(sDscrp, TALKVOLUME_TALK) );
       
       
AssignCommand(oPC, ClearAllActions(FALSE));
DestroyObject(oDescriber, 12.0f, TRUE);



}


The result always comes up invalid object and so the pc gets the float text rather than the oDescriber creature speaking. I changed the apperance to something visual to see if an object is created. Sure enough the creature appears nearby the clicked object. But it returns invalid object, and does not speak of course. Nor does it get destroyed after 12 seconds.

Any ideas on why the created object wont be passed to the oDescriber and return valid ?

#20
Eguintir Eligard

Eguintir Eligard
  • Members
  • 1 832 messages
For some reason the object no longer returns invalid but now I get a creature appearing and silence. (for pc and creature, so its attempting to make the creature speak but it wont)

#21
Eguintir Eligard

Eguintir Eligard
  • Members
  • 1 832 messages
Turns out you cant have no appearance, you have to use invisibleman i guess. Works good

#22
Eguintir Eligard

Eguintir Eligard
  • Members
  • 1 832 messages
Ok not 100%



The creature is never destroyed. It speaks its line, appears in the right spot but it will not go away with the destroy command or variations of it. Why is this? Commoner faction, not plot or immortal...

#23
Dann-J

Dann-J
  • Members
  • 3 161 messages
I've generally found it difficult (if not impossible) to queue up an action for a creature or placeable in the same script it is also destroyed in - even if you delay the destruction.



You could always reuse the same creature every time, and jump them to and from some hidden place - like a single-room tile in an underground area that the player can never get to (so it won't show up on the mini-map).

#24
Eguintir Eligard

Eguintir Eligard
  • Members
  • 1 832 messages
Well even having a destroy object on the creature spawn in script it refuses to die. The tile room could work I guess, but it would have to be a totally different area. I did that for my displacer beast script to move the "copy" but it seemed to crash a lot.

#25
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages
Have you tried using the SetNoticeText function?

//RWT-OEI 04/30/07
// This sends a text string to the player that will appear
// on the player's screen inside their Notice Window GUI.
// A notice window can be any text field that has
// the UIText_OnUpdate_DisplayNoticeText() callback running
// on it.
// oPlayer - The player to send the notice message to.
// sMessage - The text to display. Cannot be an empty
// string.
void SetNoticeText( object oPlayer, string sText );

I find this a very useful function and looks quite effective in the game. I use it quite a bit now.

Lance.

Modifié par Lance Botelle, 17 janvier 2011 - 12:34 .