Float text on a non creature object
#1
Posté 06 janvier 2011 - 09:00
However I only see on creature as possible scripts so far (and that never worked anyway).
#2
Posté 06 janvier 2011 - 09:01
#3
Posté 06 janvier 2011 - 09:31
It's can look ugly, but at least it works.
#4
Posté 06 janvier 2011 - 09:37
#5
Posté 06 janvier 2011 - 10:39
#6
Posté 06 janvier 2011 - 10:50
on use. (And the object must be usable and reachable obviously.) I make the object plot as well so it can't be accidentally destroyedEguintir Eligard wrote...
where does that go? On Conversation?
.
IIrc the tag for the object should be the same as the conversation name as well.
#7
Posté 06 janvier 2011 - 11:02
#8
Posté 07 janvier 2011 - 12:30
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
Posté 07 janvier 2011 - 12:59
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
Posté 07 janvier 2011 - 03:31
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
Posté 07 janvier 2011 - 09:29
#12
Posté 08 janvier 2011 - 02:24
#13
Posté 08 janvier 2011 - 05:40
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
Posté 11 janvier 2011 - 07:13
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
Posté 11 janvier 2011 - 07:27
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
Posté 11 janvier 2011 - 08:56
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
Posté 11 janvier 2011 - 11:07
#18
Posté 12 janvier 2011 - 12:59
#19
Posté 15 janvier 2011 - 05:12
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
Posté 15 janvier 2011 - 05:21
#21
Posté 15 janvier 2011 - 05:30
#22
Posté 15 janvier 2011 - 05:50
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
Posté 16 janvier 2011 - 10:05
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
Posté 17 janvier 2011 - 02:22
#25
Posté 17 janvier 2011 - 12:33
//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 .





Retour en haut







