GargamelLeNoir Posted September 7, 2015 Share Posted September 7, 2015 Yep. I know it's shockingly basic, but I don't know how to do it. I didn't find a tutorial about it, I tried stealing this line from another mod : getTextManager():DrawString(500, 500, textToDisplay); But it doesn't do anything. No exception thrown either. I've tried with other values (like half of the width/height of the screen, or 100/100), nothing.Thanks again for any help, and sorry for probably missing something shamefully obvious. Link to comment Share on other sites More sharing options...
RoboMat Posted September 7, 2015 Share Posted September 7, 2015 Is textToDisplay a string? Link to comment Share on other sites More sharing options...
GargamelLeNoir Posted September 7, 2015 Author Share Posted September 7, 2015 I suppose so, I set it like this : local textToDisplay = "@@@@@@@@@@@@@@@@";I may not be entirely comfortable with the lack of variable typing in lua. Link to comment Share on other sites More sharing options...
RoboMat Posted September 7, 2015 Share Posted September 7, 2015 I may not be entirely comfortable with the lack of variable typing in lua. It has it advantages. Did you hook the whole function to the correct event? (Take a look at my coordinate viewer mod) Link to comment Share on other sites More sharing options...
GargamelLeNoir Posted September 8, 2015 Author Share Posted September 8, 2015 The function is overriding ISReadABook:perform, but I know that it is properly executed. It does other things, including showing logs on the console.I'll check out the coordinate viewer tonight for clues. Link to comment Share on other sites More sharing options...
RoboMat Posted September 8, 2015 Share Posted September 8, 2015 Ahh that's your problem probably... You are trying to call a drawing function outside of the main "drawing" loop of the game and therefore it is ignored. Link to comment Share on other sites More sharing options...
GargamelLeNoir Posted September 8, 2015 Author Share Posted September 8, 2015 Well that's unfortunate... The deal is that I need to display something when the player is reading something, that's the whole gist of the mod I'm trying to make. Do you know how I could sidestep that issue? Link to comment Share on other sites More sharing options...
RoboMat Posted September 8, 2015 Share Posted September 8, 2015 The easiest solution would be to use player:Say('Text I want to say') ... that would display the text above the player's head like shouting. Of course you could use the drawString() function with the event I used for the coordinate viewer (can't remember what it's called) and simply remove / hide the string after a while. Link to comment Share on other sites More sharing options...
GargamelLeNoir Posted September 8, 2015 Author Share Posted September 8, 2015 That sounds pretty good. Having the player talk won't alert zombies though will it? Link to comment Share on other sites More sharing options...
RoboMat Posted September 8, 2015 Share Posted September 8, 2015 That sounds pretty good. Having the player talk won't alert zombies though will it? No, you'd need to set an attraction point for that Link to comment Share on other sites More sharing options...
GargamelLeNoir Posted September 8, 2015 Author Share Posted September 8, 2015 Works like a charm, thanks a lot RobotMat! Link to comment Share on other sites More sharing options...
RoboMat Posted September 10, 2015 Share Posted September 10, 2015 You are welcome Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now