Skip to content

Scripts Auto-translated

4.8 (8 ratings)
In reply to Его Высокопреосвященство
User Avatar
#200
Auto-translated
No, I actually need the "else" part here... if I remove it, the map will completely lose its meaning...

Added 13 minutes later
Unfortunately, your example script turned out to be non-functional. By the way, "object" refers to the hut where they should give a quest... But since there is a line SetObjectEnabled("gloria", nil);, it seems that the object's own function should not be executed, only the script, but when I enter the hut, it displays the message "There is no one here"...
#201
Auto-translated
I forgot something:
SetObjectEnabled("gloria", nil);
function gloriaF(heroname)
if HasArtefact("RedHeavenHero04", 58) = true then
MessageBox(GetMapDataPath().."gloriaF.txt");
ChangeHeroStat("RedHeavenHero04", STAT_EXPERIENCE, 8000);
Trigger(OBJECT_TOUCH_TRIGGER, "gloria", nil);
else MessageBox(GetMapDataPath().."gloria1F.txt");
end;
end;
Trigger(OBJECT_TOUCH_TRIGGER, "gloria", "gloriaF");
Although, it probably won't work. Could you provide a complete description of the quest with the scripts? I also have constant problems with if statements. I don't know how to deal with them.
Дайте мне всего шесть строк, написанных рукой самого честного человека, и я найду, за что его можно повесить.
Весьма хороший попутчик... До первого перекрестка.
In reply to Его Высокопреосвященство
User Avatar
#202
Auto-translated
Here is the map. By the way, it turned out that none of the scripts work, not even those with regions. The problem is that the trigger doesn't respond... (probably... :( )
Attachments 1
1 file attached • Total size: 46.6 KB
#203
Auto-translated
Now, give it a try.
Attachments 1
1 file attached • Total size: 47.0 KB
Дайте мне всего шесть строк, написанных рукой самого честного человека, и я найду, за что его можно повесить.
Весьма хороший попутчик... До первого перекрестка.
User Avatar
#204
Auto-translated
If none of them work, there might be an error at the very beginning. I had this happen to me. For example, there might be an error in a certain line, and everything after that won't work until you fix that error.
User Avatar
#205
Auto-translated
I am, of course, grateful to you, but you recorded the function not with a script; I can do that myself. What's important to me is the "else" part...
No, of course, it can be recorded with a completely different script, but this one is much simpler... and I still don't understand why scripts that display a message box when entering a region don't work... but nevertheless, thank you. I'll try to remove the first script; maybe the problem is in it. I'll let you know later.
#206
Auto-translated
Try treating it as a task; everything will become much simpler, and you'll be able to write the `else` statement.
Дайте мне всего шесть строк, написанных рукой самого честного человека, и я найду, за что его можно повесить.
Весьма хороший попутчик... До первого перекрестка.
In reply to Его Высокопреосвященство
User Avatar
#207
Auto-translated
Unfortunately, none of the scripts work. Now the trigger responds, but it doesn't reset and doesn't trigger the message box. I decided to delete all the scripts and remove the script files from the map; I'll try again and let you know.
In reply to 32MeTpa
User Avatar
#209
Auto-translated
Thank you! Now everything is working. :)
Dear "32Meters", could you describe my mistake? (I write scripts from memory and don't even look at the manuals.)
User Avatar
#210
Auto-translated
I recommend checking the manuals. The most common errors are related to strange quotation marks. Use the script editor (MapScriptsEditor); it will detect these errors. There weren't many other minor errors.
In reply to 32MeTpa
User Avatar
#211
Auto-translated
Thanks! The keyboard automatically types those quotation marks (it's an expensive keyboard that automatically adds quotation marks when needed if configured correctly), but I must have messed up the keyboard settings. I'll connect the old one to write scripts. :D
Создаётся карта "Забытый Авангард (готовность 80%)
#212
Auto-translated
How to properly use GetDate and NEW_DAY_TRIGGER?
Дайте мне всего шесть строк, написанных рукой самого честного человека, и я найду, за что его можно повесить.
Весьма хороший попутчик... До первого перекрестка.
User Avatar
#213
Auto-translated
Here's an example from my map (a caravan arrives on Mondays):
function Caravan()
if GetDate(DAY_OF_WEEK)==1 then
goldy=GetPlayerResource(1, 6)+diff*10000;
SetPlayerResource(2, 6, goldy);
MessageBox(GetMapDataPath()..'NewCar.txt');
CreateCaravan('CN', 1, 0, 180, 1,0, 184, 14);
sleep(2);
if nom==0 then
AddObjectCreatures('CN',106,(5-diff)*10);
AddObjectCreatures('CN',107,(5-diff)*5);
elseif nom==1 then
AddObjectCreatures('CN',106,(5-diff)*20);
AddObjectCreatures('CN',107,(5-diff)*10);
AddObjectCreatures('CN',108,(5-diff)*5);
elseif nom==2 then
AddObjectCreatures('CN',106,(5-diff)*20);
AddObjectCreatures('CN',107,(5-diff)*10);
AddObjectCreatures('CN',108,(5-diff)*5);
AddObjectCreatures('CN',109,(5-diff)*3);
AddObjectCreatures('CN',110,(5-diff)*2);
elseif nom==3 then
AddObjectCreatures('CN',106,(5-diff)*30);
AddObjectCreatures('CN',107,(5-diff)*15);
AddObjectCreatures('CN',108,(5-diff)*8);
AddObjectCreatures('CN',109,(5-diff)*5);
AddObjectCreatures('CN',110,(5-diff)*3);
elseif nom==4 then
AddObjectCreatures('CN',106,(5-diff)*30);
AddObjectCreatures('CN',107,(5-diff)*15);
AddObjectCreatures('CN',108,(5-diff)*8);
AddObjectCreatures('CN',109,(5-diff)*5);
AddObjectCreatures('CN',110,(5-diff)*3);
AddObjectCreatures('CN',111,(5-diff)*2);
else
AddObjectCreatures('CN',106,(5-diff)*30);
AddObjectCreatures('CN',107,(5-diff)*15);
AddObjectCreatures('CN',108,(5-diff)*8);
AddObjectCreatures('CN',109,(5-diff)*5);
AddObjectCreatures('CN',110,(5-diff)*3);
AddObjectCreatures('CN',111,(5-diff)*2);
AddObjectCreatures('CN',112,(5-diff)*1);
end;
nom=nom+1;
end;
end;
Trigger(NEW_DAY_TRIGGER,'Caravan');
 

К А
Стикеры GBF в Telegram
User Avatar
#214
Auto-translated
Could you suggest a script that sends messages on a specific day? Something similar to what was in the third game.