antstubell Posted June 15, 2019 Share Posted June 15, 2019 Running this scripy on a skeever actor base. It works but when the skeever dies there is a very noticeable time gap between the death and the explosion. Player can literally look at the dead skeever - wait a second (less than a second but feels longer) - explosion - message. Actor Property PlayerREF AutoExplosion Property MyBang AutoMessage Property MyMSG AutoEvent OnDeath(Actor akKiller)if akKiller == PlayerREFplaceAtMe(MyBang)Game.GetPlayer().DamageActorValue("Health", 20)MyMSG.show()endifEndEvent Link to comment Share on other sites More sharing options...
cdcooley Posted June 21, 2019 Share Posted June 21, 2019 It should be taking 4 frames total but could potentially take longer. A minor improvement would be to use the PlayerREF property instead of the Game.GetPlayer() call because that function is 1/4 of the script's running time, but that still doesn't explain a long delay. The only reason I can think of that this would be slow is that you've already got too much other script activity going on in your game. Each of the functions will require one frame to run, but even at 30 fps that should still be just over 0.1 seconds for the message (with the explosion and health both happening during that time). Link to comment Share on other sites More sharing options...
maxarturo Posted June 21, 2019 Share Posted June 21, 2019 PLUS.You have in the same script "PlayerRef" and "Game.GetPlayer()".Use only one of them in each script, the use of different can cause a number of issues. Link to comment Share on other sites More sharing options...
antstubell Posted June 21, 2019 Author Share Posted June 21, 2019 Changed to... Explosion Property MyBang AutoMessage Property MyMSG AutoEvent OnDeath(Actor akKiller)if akKiller == Game.GetPlayer()placeAtMe(MyBang)Game.GetPlayer().DamageActorValue("Health", 50)MyMSG.show()endifEndEvent Still runs slow. Player is in an small interior cell and nothing 'taxing' is happening. Link to comment Share on other sites More sharing options...
maxarturo Posted June 21, 2019 Share Posted June 21, 2019 Probably because the game is searching where to place the explosion. You haven't define where the explosion should be placed. self.placeAtMe(MyBang) Link to comment Share on other sites More sharing options...
antstubell Posted June 21, 2019 Author Share Posted June 21, 2019 Yep, stupid me. Anyway, corrected that and made a quick video of how long it takes. Is this normal? https://onedrive.live.com/?cid=B60C11D037429D8E&id=B60C11D037429D8E%2134166&parId=B60C11D037429D8E%21191&o=OneUp Link to comment Share on other sites More sharing options...
maxarturo Posted June 21, 2019 Share Posted June 21, 2019 First of all, there isn't a delay, is just the message that interrupts the explosion FX. There is supposed to be small delay when an npc dies about 0.3sec (if i remember correctly the sec), the time for the game engine to do its things (like change container and other....) Modify the time to what you want, but give it an amount so that it plays the FX. Explosion Property MyBang Auto Message Property MyMSG Auto Event OnDeath(Actor akKiller) if akKiller == Game.GetPlayer() self.placeAtMe(MyBang) Game.GetPlayer().DamageActorValue("Health", 50) utility.wait(2.0) MyMSG.show() endif EndEvent Link to comment Share on other sites More sharing options...
antstubell Posted June 21, 2019 Author Share Posted June 21, 2019 meh. Not much difference IMO. Thanks for the help, I'm simply just waiting on the game really. Link to comment Share on other sites More sharing options...
maxarturo Posted June 21, 2019 Share Posted June 21, 2019 (edited) Seen your video again i see that you have already a script running on the skiver that gives it a visual FX, if so, attach the "OnDeath" to the visual script so that it runs only one script. Don't expect to see an immediate explosion as soon as you see in game the skiver dying, for that you need to difine in the script that when its health reaches 0 the explosion will occur, so you need a completly different scripting approch. The line up - order of the functions - event you put in the script plays an important role on what you see, the game engine will execute the functions from top to bottom, so if you put the visuals first and then the explosion that's what you are going to see. For example: Play.FX on skiver Stop.FX on skiver palce explosion Is different from Play.FX on skiver palce explosion Stop.FX on skiver Edited June 21, 2019 by maxarturo Link to comment Share on other sites More sharing options...
antstubell Posted June 21, 2019 Author Share Posted June 21, 2019 Food for thought. I'll 'toy' with the script and see if I can improve it. Thanks. Link to comment Share on other sites More sharing options...
Recommended Posts