Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
Is it okay to use "DelayCommand" to get the code to work?
Or does the programmer's saying work here: "If it works, then don't touch it!"?
Yeah, it's fine to use DelayCommand. You will use it a lot, particularly with cutscenes.
A few notes from working on cutscenes myself:
When a PC enters a module or area, for reasons unknown their position is undefined. If you print the location, you'll see that the area is OK, but the position is (0. 0. 0.) and the facing is 0.0.
The position is actually set shortly after the event.
So, in those event scripts, anything that depends on PC position will fail. SetCameraFacing fails because it is reset almost immediately. Functions of the type GetNearest# are unreliable. Conversations may not start if the PC is not yet next to the speaker, and so on.
One remedy is to use a trigger instead. Trigger OnEnter events are very reliable and seem to wait until the area is properly set up.
The other is to use a delay. From experience, it seems that as long as you choose a fairly generous delay, it will always work.
For conversations in particular, I find that a delay of 2 seconds on entering an area is advisable, otherwise you get Unknown Speakers and default portraits.
The fact is that I already use this method, but I still have to use the "DelayCommand" function.
In any case, thank you all for the advice! The main thing is that now everything has begun to work!