News: Welcome back to Bullworth! If you haven't already, you will need to reset your password..


Author Topic: Help  (Read 2639 times)

0 Members and 1 Guest are viewing this topic.

Offline denizthebest

  • Jr. Member
  • **
  • Posts: 85
  • Half way there.
    • View Profile
Help
« on: July 24, 2015, 08:33:06 AM »
Hey guys i need help
when i add TextPrintString("hello",4,1)
it only shows text for few frames not seconds how can i fix this

Offline Shrimp

  • Sr. Member
  • ***
  • Posts: 514
  • Gender: Male
  • your official b-b's chav. wag wan.
    • View Profile
Re: Help
« Reply #1 on: July 24, 2015, 09:50:10 AM »
Do Wait(5000) or something, if am right the text will appear for 5 seconds.
1000 = 1 second
2000 = 2 second
so on, you'll understand.

Offline denizthebest

  • Jr. Member
  • **
  • Posts: 85
  • Half way there.
    • View Profile
Re: Help
« Reply #2 on: July 24, 2015, 10:24:01 AM »
İ did that but thanks and i allready solved the problem thanks

Offline DaBOSS54320

  • Hero Member
  • ****
  • Posts: 3,398
  • Gender: Female
    • View Profile
Re: Help
« Reply #3 on: July 24, 2015, 06:39:25 PM »
TextPrintString(string,time,style) will simply print a string to the screen for as long as you specify in time (which expects time in seconds) and either on the top (style=1) or bottom (style=2) of the screen.

There's 2 places the text can be printed (top/bottom) and if you print to the same place twice, the old text will be replaced. So for example:
TextPrintString("You won't even see this",1,1)
TextPrintString("But you will see this",1,1)
because it'll just immediately get replaced by that second one. The game can only run (and so text can only be printed) when your script is waiting using Wait. That's why you use Wait(0) in loops, so the loop doesn't crash the game. Similarly for text if you want the game to wait a moment so your text can actually be seen, use Wait(ms) in between text.

TextPrintString("Text 1",1,1)
Wait(1000)
TextPrintString("Text 2",1,1)

However keep in mind using Wait will of course make your script wait and not be able to do anything for a short period of time. For example if you have something like this:

repeat
  if IsButtonBeingPressed(3,0) then
    TextPrintString("Give spudgun",1,1)
    Wait(1000)
  elseif IsButtonBeingPressed(6,0) then
    PedSetActionNode(gPlayer,"/Global/Freaks/Mermaid/MermaidIdle","Act/Anim/FreakShow.act")
  end
  Wait(0)
until false

When you press button 3 the script will wait for an entire second before the script can run again, meaning there will be a whole second that your script isn't running and thus in that 1 second you will not be able to use that action node that we play when 6 is pressed.

Offline MadmaN

  • Bully-Board Admin Team
  • Newbie
  • *
  • Posts: 0
  • Gender: Male
  • Biblio-Techa Mods (retired)
    • View Profile
Re: Help
« Reply #4 on: August 01, 2015, 02:23:21 AM »
There IS another way to add text styles to the game...this happens to be custom text styles and this makes use of the text boxes that show various hints and other info in the game.

I DO know how do do this but the problem is...you will break the missions in the game if you expect to do a full play through of the game with xx mod that you are using.

I will outline soon how to do this since I have found another 'possible' way that this may be done without breaking the game.

Currently...any testing of any code I write I will be asking DaBOSS to take care of for me until I redo my system and swap my hdds around due to having absolutely no space on my C drive for any games......thanks 3d artwork...ROFL. Need to fix my customized windows installation to install in UEFI mode in order to use my much much larger drives so....sit tight and I will be returning soon to modding since it is apparent I am still needed to help out.  8)

Offline denizthebest

  • Jr. Member
  • **
  • Posts: 85
  • Half way there.
    • View Profile
Re: Help
« Reply #5 on: August 01, 2015, 05:39:41 AM »
There IS another way to add text styles to the game...this happens to be custom text styles and this makes use of the text boxes that show various hints and other info in the game.

I DO know how do do this but the problem is...you will break the missions in the game if you expect to do a full play through of the game with xx mod that you are using.

I will outline soon how to do this since I have found another 'possible' way that this may be done without breaking the game.

Currently...any testing of any code I write I will be asking DaBOSS to take care of for me until I redo my system and swap my hdds around due to having absolutely no space on my C drive for any games......thanks 3d artwork...ROFL. Need to fix my customized windows installation to install in UEFI mode in order to use my much much larger drives so....sit tight and I will be returning soon to modding since it is apparent I am still needed to help out.  8)

Good luck with that my friend.  :biggrin: