PDA

View Full Version : Scripting : How change hintstring when Press button.



Salem75
5th March 2018, 17:51
Hi,
I'll let you now know how change hintstring After press button , for example from ("Press ^2[F]^7 To use") to ("^1Wait")

PHP Code:


init()
{
lovyshka = getent("lov1", "targetname");
uselov = getent("flov1", "targetname");
k1 = getent("lov1kg", "targetname");
k2 = getent("lov1kr", "targetname");
while(1)
{
k2 hide();
uselov sethintstring("^2Press [F] to use ");
uselov waittill("trigger", user);
k1 hide();
k2 show();
uselov sethintstring("^1Wait... ");
lovyshka movez(-200,0.3);
lovyshka waittill ("movedone");
wait (10);
lovyshka movez(200,3);
lovyshka waittill ("movedone");
wait (10);
uselov sethintstring("^2Press [F] to use ");
k2 hide();
k1 show();
}
}


Enjoy !

Salem75
5th March 2018, 18:06
Notice : You can also use colors .

IzNoGoD
5th March 2018, 22:13
Test this in developer mode, as it will show you that your strings should be localizedstrings.

Aside from that, you're not precaching them either.

milepunta
6th March 2018, 01:28
what is the difference if you use localizedstrings or just text in scripts? :D

serthy
6th March 2018, 10:21
what is the difference if you use localizedstrings or just text in scripts? :D

You can localize your text (one identifier-string in your code - multiple languages in the game).
However, you need to precache your localized string in your script (precacheString() iirc) and you have to add your translations in a file, i guess it was somename.localized or sth like that.

You also could use libcod for that.