DelayCommand Apparently Not Working [Solved]
TarotRedhand
Member Posts: 1,481
Context - Most current Retail version of the game. Win 10 64 bit.
I have a number of void functions that work fine if called directly but are apparently ignored when they are in a DelayCommand. This -
Thanks.
TR
I have a number of void functions that work fine if called directly but are apparently ignored when they are in a DelayCommand. This -
ResetToBlack(oArea);works fine while this -
DelayCommand(3.0f, ResetToBlack(oArea));seems to be ignored. In an effort to find out what is going on I put a SendMessageToPC() as the first instruction in ResetToBlack(). I see this message when I call ResetToBlack() directly but not when I try to use that function call as the second parameter for a DelayCommand(). From the BD client Options/Verify Game finds no problems either. Anyone got any idea what's going on.
Thanks.
TR
Post edited by TarotRedhand on
0
Comments
Like mentioned you should double check that the references are correct, make sure the object still exists and so on.
Whenever I use a DelayCommand to call a void/sub function I assign the command to be called by an area.
AssignCommand(oArea, DelayCommand(3.0f, wrap());
This may work for ya.
DJ-WoW
FWIW A friend of mine is working on a module for an 8 year old and I am scripting a very simple puzzle for them. These delays are critical for the solution to be apparent. The puzzle is simply this. There are 3 stones on the ground. On each stone there is a single letter coloured black. The letters are T, R and A and are used to spell one of these three words (determined by the contents of a local variable) - RAT or TAR or ART. They have to be clicked on, one at a time in the right order. If one is clicked on at the right time, the letter turns green. On the other hand, if it is not the right one the letter turns red for a short time before all coloured letters are recoloured to black. Once they are all green, the puzzle is solved.
TR
Also, be mindful that the script function is now running as the area so depending on the script it may need to be modified at times. I don't think it is always a good idea to automatically always run delays on an area blindly.