Jump to content
sizraide

TitleText dissapears too fast

Recommended Posts

Hello, I'm creating a COOP mission.

I have some dialog and I'm using TitleText, the text dissapears too fast even though I don't know why?

Here is my script.
 

Quote

scriptedCharge = "DemoCharge_Remote_Ammo_Scripted" createVehicle (getMarkerPos "amb1"); 

scriptedCharge setDamage 1;

 

if(!isDedicated) then

{

    addCamShake [2, 2.5, 20];

    sleep 0.05;

    titleText ["<t align = 'center' shadow = '2' color='#00ff00' size='1.5' font='PuristaSemiBold' >General Demitri</t><br /><t color='#ffffff' size='1.5' font='PuristaSemiBold' shadow = '2' >Testing 1</t>", "PLAIN DOWN", -1, true, true];

    sleep 8;

    titleText ["<t align = 'center' shadow = '2' color='#00ff00' size='1.5' font='PuristaSemiBold' >General Demitri</t><br /><t color='#ffffff' size='1.5' font='PuristaSemiBold' shadow = '2' >Testing 2</t>", "PLAIN DOWN", -1, true, true];

};

 

 

Share this post


Link to post
Share on other sites
10 minutes ago, sarogahtyp said:

Read DreadedEntity's comment bout 3rd parameter in biki:

 

https://community.bistudio.com/wiki/titleText

 

Reading biki is a general rule during scripting...


I changed the of -1 to 8 and there is no difference. It dissapears way too quick. It appears only for like 1-2 seconds and then disappears really fast.

 

Quote

titleText ["<t align = 'center' shadow = '2' color='#00ff00' size='1.5' font='PuristaSemiBold' >General Demitri</t><br /><t color='#ffffff' size='1.5' font='PuristaSemiBold' shadow = '2' >Testing 2</t>", "PLAIN DOWN", 8, true, true];

 

I even tried 80 instead of 8.

 

Quote

titleText ["<t align = 'center' shadow = '2' color='#00ff00' size='1.5' font='PuristaSemiBold' >General Demitri</t><br /><t color='#ffffff' size='1.5' font='PuristaSemiBold' shadow = '2' >Testing 2</t>", "PLAIN DOWN", 80, true, true];

 

Same results.

Share this post


Link to post
Share on other sites
2 minutes ago, Soapbox0331 said:

 

First text appears then dissapears really fast, second text doesn't show up at all.
 

Quote

if(!isDedicated) then

{

    addCamShake [2, 2.5, 20];

    sleep 0.05;

    titleText ["<t align = 'center' shadow = '2' color='#00ff00' size='1.5' font='PuristaSemiBold' >General Demitri</t><br /><t color='#ffffff' size='1.5' font='PuristaSemiBold' shadow = '2' >Testing 1</t>", "PLAIN DOWN", -1, true, true];

    titleFadeOut 8;

    titleText ["<t align = 'center' shadow = '2' color='#00ff00' size='1.5' font='PuristaSemiBold' >General Demitri</t><br /><t color='#ffffff' size='1.5' font='PuristaSemiBold' shadow = '2' >Testing 2</t>", "PLAIN DOWN", -1, true, true];
    titleFadeOut 8;

};


Here is what I did. Probably something wrong.

Share this post


Link to post
Share on other sites
titleText ["<t align = 'center' shadow = '2' color='#00ff00' size='1.5' font='PuristaSemiBold' >General Demitri</t><br /><t color='#ffffff' size='1.5' font='PuristaSemiBold' shadow = '2' >Testing 1</t>", "PLAIN DOWN", 0.5, true, true]; 
 

    titleText ["<t align = 'center' shadow = '2' color='#00ff00' size='1.5' font='PuristaSemiBold' >General Demitri</t><br /><t color='#ffffff' size='1.5' font='PuristaSemiBold' shadow = '2' >Testing 2</t>", "PLAIN DOWN", 0.5, true, true];

 

I tested above in debug console and it works well. displays both texts about 5 seconds as it should with speed set to 0.5

  • Like 1

Share this post


Link to post
Share on other sites

@sizraide Just a thought: try removing the first titleFadeOut 8;...that may be preventing second text from showing.

Share this post


Link to post
Share on other sites
9 minutes ago, sarogahtyp said:

titleText ["<t align = 'center' shadow = '2' color='#00ff00' size='1.5' font='PuristaSemiBold' >General Demitri</t><br /><t color='#ffffff' size='1.5' font='PuristaSemiBold' shadow = '2' >Testing 1</t>", "PLAIN DOWN", 0.5, true, true]; 
 

    titleText ["<t align = 'center' shadow = '2' color='#00ff00' size='1.5' font='PuristaSemiBold' >General Demitri</t><br /><t color='#ffffff' size='1.5' font='PuristaSemiBold' shadow = '2' >Testing 2</t>", "PLAIN DOWN", 0.5, true, true];


 

I tested above in debug console and it works well. displays both texts about 5 seconds as it should with speed set to 0.5


Same results, It appears then disappears really fast.

Share this post


Link to post
Share on other sites
6 minutes ago, Soapbox0331 said:

@sizraide Just a thought: try removing the first titleFadeOut 8;...that may be preventing second text from showing.


Didn't work unfortunately. I tried titleFadeOut before and I never knew how to use it. I always ended up using sleep and it works perfectly but now it is not working for some reason.

Share this post


Link to post
Share on other sites

As I already told you. Your shown code is working perfectly. Try it yourself in debug console!

 

This is working there:

private _dummy = [] spawn
{

 if(!isDedicated) then

 {
   addCamShake [2, 2.5, 20]; 
 
    sleep 0.05; 
 
    titleText ["<t align = 'center' shadow = '2' color='#00ff00' size='1.5' font='PuristaSemiBold' >General Demitri</t><br /><t color='#ffffff' size='1.5' font='PuristaSemiBold' shadow = '2' >Testing 1</t>", "PLAIN DOWN", -1, true, true]; 
 
    sleep 8; 
 
    titleText ["<t align = 'center' shadow = '2' color='#00ff00' size='1.5' font='PuristaSemiBold' >General Demitri</t><br /><t color='#ffffff' size='1.5' font='PuristaSemiBold' shadow = '2' >Testing 2</t>", "PLAIN DOWN", -1, true, true];
 };
};

There is no problem with your shown code. Maybe it is the code you did not show, who knows?

  • Like 1

Share this post


Link to post
Share on other sites
4 minutes ago, sarogahtyp said:

As I already told you. Your shown code is working perfectly. Try it yourself in debug console!

 

This is working there:


private _dummy = [] spawn
{

 if(!isDedicated) then

 {
   addCamShake [2, 2.5, 20]; 
 
    sleep 0.05; 
 
    titleText ["<t align = 'center' shadow = '2' color='#00ff00' size='1.5' font='PuristaSemiBold' >General Demitri</t><br /><t color='#ffffff' size='1.5' font='PuristaSemiBold' shadow = '2' >Testing 1</t>", "PLAIN DOWN", -1, true, true]; 
 
    sleep 8; 
 
    titleText ["<t align = 'center' shadow = '2' color='#00ff00' size='1.5' font='PuristaSemiBold' >General Demitri</t><br /><t color='#ffffff' size='1.5' font='PuristaSemiBold' shadow = '2' >Testing 2</t>", "PLAIN DOWN", -1, true, true];
 };
};
 

There is no problem with your shown code. Maybe it is the code you did not show, who knows?


Same results with debug console, this time it dissapears faster only.

Share this post


Link to post
Share on other sites
7 minutes ago, sarogahtyp said:

As I already told you. Your shown code is working perfectly. Try it yourself in debug console!

 

This is working there:


private _dummy = [] spawn
{

 if(!isDedicated) then

 {
   addCamShake [2, 2.5, 20]; 
 
    sleep 0.05; 
 
    titleText ["<t align = 'center' shadow = '2' color='#00ff00' size='1.5' font='PuristaSemiBold' >General Demitri</t><br /><t color='#ffffff' size='1.5' font='PuristaSemiBold' shadow = '2' >Testing 1</t>", "PLAIN DOWN", -1, true, true]; 
 
    sleep 8; 
 
    titleText ["<t align = 'center' shadow = '2' color='#00ff00' size='1.5' font='PuristaSemiBold' >General Demitri</t><br /><t color='#ffffff' size='1.5' font='PuristaSemiBold' shadow = '2' >Testing 2</t>", "PLAIN DOWN", -1, true, true];
 };
};
 

There is no problem with your shown code. Maybe it is the code you did not show, who knows?


Perhaps I could provide a video to show you how it looks like?

Share this post


Link to post
Share on other sites
45 minutes ago, sizraide said:


Perhaps I could provide a video to show you how it looks like?

 

I would imagine that Sarogahtyp could do the same thing and show it working as he's described, so you showing a video of working code not working for you probably won't change much.

 

I don't think there's any doubt from anyone here that you're not getting the result you want. The issue is that you're not getting that result with code that works. Try starting a fresh scenario, no mods, and just get in and see how it runs from the debug console.

  • Like 3

Share this post


Link to post
Share on other sites
2 hours ago, beno_83au said:

 

I would imagine that Sarogahtyp could do the same thing and show it working as he's described, so you showing a video of working code not working for you probably won't change much.

 

I don't think there's any doubt from anyone here that you're not getting the result you want. The issue is that you're not getting that result with code that works. Try starting a fresh scenario, no mods, and just get in and see how it runs from the debug console.


Okay so it works perfectly normal on a new scenario with the same mods.

The question is, is there anything that can affect titleText? I only have two large scripts and they are ambient fire and ambient battles by ALIAS.

Share this post


Link to post
Share on other sites
3 hours ago, sarogahtyp said:

Maybe it is the code you did not show, who knows?

I don't like to quote myself, but sometimes there is no way around it.

  • Like 1

Share this post


Link to post
Share on other sites
5 minutes ago, sarogahtyp said:

I don't like to quote myself, but sometimes there is no way around it.

 

I found it, so basically im using two scripts made by ALIAS.

 

Disabling this entire script made titleText work properly

 

Quote

player_onFire_from_vanillafire = true;  // if true the player will take fire from vanilla assets like camp fire, burning vehicle

publicVariable "player_onFire_from_vanillafire";

 

damage_playeron_fire = 0.01;    // amount of damage players will take from fire script

publicVariable "damage_playeron_fire";

 

set_vik_fire = false;          // if true by default all mission vehicles will be set in fire when they are disabled

publicVariable "set_vik_fire";

 

// animations used by players to get rid of fire

off_fire = ["amovppnemstpsraswrfldnon_amovppnemevaslowwrfldl","amovppnemstpsraswrfldnon_amovppnemevaslowwrfldr","amovppnemstpsnonwnondnon_amovppnemevasnonwnondl","amovppnemstpsnonwnondnon_amovppnemevasnonwnondr","amovppnemstpsraswpstdnon_amovppnemevaslowwpstdl","amovppnemstpsraswpstdnon_amovppnemevaslowwpstdr"];

publicVariable "off_fire";

 

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

 

list_vegetation = ["TREE","SMALL TREE","BUSH","FOREST BORDER","FOREST TRIANGLE","FOREST SQUARE","FOREST"];

publicVariable "list_vegetation";

 

vik_list = ["CAR","TANK","PLANE","HELICOPTER","Motorcycle","Air","Ship"];

publicVariable "vik_list";

 

street_lapms = ["Land_fs_roof_F","Land_TTowerBig_2_F","Land_TTowerBig_1_F","Lamps_base_F","PowerLines_base_F","PowerLines_Small_base_F","Land_LampStreet_small_F"];

publicVariable "street_lapms";

 

buildings_list = ["BUILDING","HOUSE","CHURCH","CHAPEL","FUELSTATION","HOSPITAL","RUIN","BUNKER"];

publicVariable "buildings_list";

 

list_man = ["Civilian","SoldierGB","SoldierEB","SoldierWB"];

publicVariable "list_man";


 

/////////////////////// DO NOT EDIT LINES BELOW ---------------------------------------------------------------------------------

 

[] spawn {

    if (isNil "allPlayers_on") then 

    {

        chk_players = true;

        while {chk_players} do 

        {

            allPlayers_on = call BIS_fnc_listPlayers;

            //allPlayers_on = allPlayers_on - entities "HeadlessClient_F";

            publicVariable "allPlayers_on";

            sleep 60;

        };

    }

};

 

if (set_vik_fire) then 

{

    chk_vik=true;

    while {chk_vik} do 

    {

        all_car = allMissionObjects "CAR";

        all_tank = allMissionObjects "TANK";

        all_moto = allMissionObjects "Motorcycle";

        all_viks = all_car+all_tank+all_moto;

        publicVariable "all_viks";

        if (count all_viks>0) then {

            {if (isNil{_x getVariable "on_alias_fire"}) then {_life_time_fire = 10+random 60;[_x,_life_time_fire,true,true] execVM "AL_fire\al_vehicle_fire.sqf"}} foreach all_viks

        };

        sleep 300

    };

};

 

 

This is the FIRE script by Alias, just to add ambient fire.

I have no idea whats on here and other dozen files in this script thats making titleText act abnormally.

Share this post


Link to post
Share on other sites

@sarogahtyp, I totally agree with you.

 

I'd like to add, that I had a lot of problems with TitleText as well. 

 

For example I had to call it in a separate function to make it work. 

God knows, why. I still do not understand the problem. 

 

@sizraide, your code seems to be correct. It's most likely something else. 

I'd recommend you to try my approach:

Put the code in a separate function and spawn it. 

 

Share this post


Link to post
Share on other sites
2 minutes ago, Smart Games said:

@sarogahtyp, I totally agree with you.

 

I'd like to add, that I had a lot of problems with TitleText as well. 

 

For example I had to call it in a separate function to make it work. 

God knows, why. I still do not understand the problem. 

 

@sizraide, your code seems to be correct. It's most likely something else. 

I'd recommend you to try my approach:

Put the code in a separate function and spawn it. 

 

 

 

Im a newbie in scripting, could you tell me how to script that?

Share this post


Link to post
Share on other sites

If you are in MP context, just avoid remoteExecuting all stuff for nuts. Most of the time the code could be ready on all PCs (especially all hints or HUDs or effects) just waiting for few parameters and/or set variable to trigger.

publicVariable lists is probably a non-sense. remoteExecuting entire titleText script... can lead to no result in heavy script context.

 

Share this post


Link to post
Share on other sites
4 minutes ago, pierremgi said:

If you are in MP context, just avoid remoteExecuting all stuff for nuts. Most of the time the code could be ready on all PCs (especially all hints or HUDs or effects) just waiting for few parameters and/or set variable to trigger.

publicVariable lists is probably a non-sense. remoteExecuting entire titleText script... can lead to no result in heavy script context.

 

 

Very important advice!

Share this post


Link to post
Share on other sites
45 minutes ago, pierremgi said:

If you are in MP context, just avoid remoteExecuting all stuff for nuts. Most of the time the code could be ready on all PCs (especially all hints or HUDs or effects) just waiting for few parameters and/or set variable to trigger.

publicVariable lists is probably a non-sense. remoteExecuting entire titleText script... can lead to no result in heavy script context.

 


I use execVM instead, does it make a difference?

Share this post


Link to post
Share on other sites

I guess we get closer.

show al_vehicle_fire.sqf !

Share this post


Link to post
Share on other sites
2 hours ago, Smart Games said:

 Please send me the mission folder.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×