Skip to content

Posts from Scripts are not working. Auto-translated

No ratings yet — be the first to rate!
User Avatar
#31
Auto-translated
I'm busy right now, I'll write the trigger you need a little later.
Когда ты задумываешься о том, что ты задумался, ты перестаёшь задумываться ;)
Хаос во всём тоже порядок...
Кампания Седьмое затмение. Грань Империи.
В стадии разработки 10%
User Avatar
#32
Auto-translated
Okay
Делаю кампанию "Последний Феникс"
User Avatar
#33
Auto-translated
Oh, sorry, I'm swamped with work. If I can, I'll write it today.

Added 1 hour 38 minutes ago
Here it is, as promised:
PLAYER_REMOVE_HERO_TRIGGER = 2
Call format:
Trigger(PLAYER_REMOVE_HERO_TRIGGER, nPlayerID, sProc)
Format of the called procedure:
void sProc(sHeroName)
Stop:
Trigger(PLAYER_REMOVE_HERO_TRIGGER, nPlayerID, nil)
The procedure is called when player nPlayerID loses a hero. The name of this hero is passed to the procedure as a parameter.

Added 30 seconds ago
I don't know of any other option.
Когда ты задумываешься о том, что ты задумался, ты перестаёшь задумываться ;)
Хаос во всём тоже порядок...
Кампания Седьмое затмение. Грань Империи.
В стадии разработки 10%
In reply to Варсус
User Avatar
#34
Auto-translated
Thank you.
Делаю кампанию "Последний Феникс"
User Avatar
#35
Auto-translated
Aleha, does the trigger I wrote work? If so, tell me how you wrote it. Because it seems like I wrote everything correctly, but something isn't working.
Когда ты задумываешься о том, что ты задумался, ты перестаёшь задумываться ;)
Хаос во всём тоже порядок...
Кампания Седьмое затмение. Грань Империи.
В стадии разработки 10%
In reply to Варсус
User Avatar
#36
Auto-translated
Damn, sorry, I haven't written it yet, I'll check it later, I need to write my term paper.

Added 6 minutes later
I don't quite understand about sProc, is something supposed to be there instead?
Делаю кампанию "Последний Феникс"
User Avatar
#37
Auto-translated
To be honest, I don't know, but logically, I came to the conclusion that instead of "Proc," you should write what will happen when the trigger is activated. In other words, write a script. But this is just my opinion, based on my reasoning.
Когда ты задумываешься о том, что ты задумался, ты перестаёшь задумываться ;)
Хаос во всём тоже порядок...
Кампания Седьмое затмение. Грань Империи.
В стадии разработки 10%
User Avatar
#38
Auto-translated
sProc -- the name of the function that the trigger calls.
Next, you need to write something like this somewhere:
function sProc(sHeroName)
Here is the function body
end;
 

К А
Стикеры GBF в Telegram
User Avatar
#39
Auto-translated
Hey, does anyone know of a script that plays a sound at the beginning? (In my case, it's the scream of a Nazgûl. When the map starts, this scream plays, and then the camera shows a specific region and displays the message: "It's the Black Rider! We must leave, immediately!")
Делаю кампанию "Последний Феникс"
User Avatar
#40
Auto-translated
PlaySound or something similar, check the manual. You need to import the sound into the game to play it. The method is similar to importing models (described on the psatkha website), but Maya doesn't seem to be needed.
 

К А
Стикеры GBF в Telegram
User Avatar
#41
Auto-translated
Another question about the sounds: I recorded a script for a sound, but the problem is that the game console complains that the sound file was not found. I moved the sound file to the music folder and, just in case, also to the map archive. Here is the script:
function StartF()
MessageBox ("/Maps/SingleMissions/LotR_1/Nazgul_begin.txt");
Play2DSound ("Scream.ogg")
end;

Trigger(REGION_ENTER_AND_STOP_TRIGGER, "StartLocation", "StartF");
Делаю кампанию "Последний Феникс"
User Avatar
#42
Auto-translated
Aleha, Play2DSound requires the path to a *.xdb file containing sound descriptions as input; examples can be found in /Sounds/_(Sound)/. Additionally, it is recommended to explicitly specify the file path. For example, if you place the file next to the map script, it should look something like this:
Play2DSound(GetMapDataPath()..'Scream.xdb#xpointer(/Sound)')
In reply to Jack_of_shadows
User Avatar
#43
Auto-translated
When creating the .xdb file, you need to specify the path to the WAV file, but I have no idea where all these sounds are located (for example: H5A1\Sounds\SFX\FireballHitMono.wav).
Делаю кампанию "Последний Феникс"
User Avatar
#44
Auto-translated
Obviously, the .wav file will be located wherever you place it. Most likely, you can simply specify the name of your file without the path in the .xdb file and place it in the same directory.
User Avatar
#45
Auto-translated
http://psatkha.narod.ru/tutorial_ru.html
Sounds need to be exported in exactly the same way! That is, create an xdb file, write the path to the actual existing sound in it (not embedded in the map archive, but located somewhere in a folder, for example, Complete, as in the example in the link), in advanced editor mode, right-click on this xdb file, and click "Export".
In general, the difference from that tutorial is only that some steps can be skipped (for example, installing Maya, etc.).
 

К А
Стикеры GBF в Telegram