Scripts / Display of text

Author
Message
grinseengel
9
Years of Service
User Offline
Joined: 27th Jul 2015
Location:
Posted: 25th Mar 2016 15:53 Edited at: 25th Mar 2016 16:02
Again I have a problem with LUA . I have the fast zombie LUA . Now I would like that when the zombie I was killed a text for about 1 second displays get . I have now incorporated into the .exit function . With PromptDuration ( " xxxxx " , 1000) is the prima .




However, the text will be displayed just below the middle . Now I have tried it with text ( x , y ,, size "text " ) . That did not work . Then I still tried to start timer and getTimer . But that also did not go .



Can someone help me?
PartTimeCoder
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location:
Posted: 27th Mar 2016 15:27
I'm not sure if the code will still be running as the exit function is called when the object is destroyed, I would think the exit function is a single call function for cleanup!, try moving it into the main loop and check the entities health



PM
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 27th Mar 2016 18:27
It works for me, I've just change 1000 by 3000.


You can run code via exit function, even increase a global var, IE: when you are working with some sort of "killcount" var.



3com
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics

PM
PartTimeCoder
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location:
Posted: 27th Mar 2016 18:50
yea I get that but surly the exit function is not looped, I mean, its called once when the object is destroyed so placing timer code in exit will fail ...... I'm only guessing here of course, goner go try it out to satisfy my own curiosity lol

PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 27th Mar 2016 19:34
yes it's (exit(e)) only run once when the entity is killed so you would need to set a separate entity that detects when enemies die to use the Text commands on a timer.
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 28th Mar 2016 19:31
@ PartTimeCoder
You are right, I've not notice him entering the second piece of code, inside the exit function too, my fault.

3com
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics

PM

Login to post a reply

Server time is: 2024-12-22 15:24:01
Your offset time is: 2024-12-22 15:24:01