Problem with script setting resources.

Official forum of the Wake of Gods mod to Heroes of Might and Magic III.
User avatar
Arkas
Peasant
Peasant
Posts: 56
Joined: 03 Nov 2006

Problem with script setting resources.

Unread postby Arkas » 09 Nov 2006, 03:47

I've been playing with scripts and learning a TON. I've made dozens of modifications, and I've even added a few simple scripts to the Wog options page. Now it's time to build a campaign. And the fun begins.

The following timed event crashes my game. I set the time to day 500, removed both players from the event and set the event to only show to computer players as the documentation and tutorials say. I've read and re-read the OW receiver and cannot figure out WHAT I am doing wrong...

I'm not using variables, and I've even changed the instructions to receivers and set the event for day one instead. That stops it from crashing but still disables the script due to "Syntax".

And I am using the scripting editor to write the script and copy/pasting it into the event.

ZVSE
ERMS_ScriptDate=8.11(November).2006
_WARNING_#1=IMPORTANT! This file is not in a plain text format. NEVER use any editor except ERM_S for making any kind of changes!
ERMS_PoweredBy=ERM Scripter v. 2005.9.7.814

!#OW:R0/0/1; Remove most funds from Player 1 (Red)
!#OW:R0/1/1;
!#OW:R0/2/1;
!#OW:R0/3/1;
!#OW:R0/4/1;
!#OW:R0/5/1;
!#OW:R0/6/1000;

Quoted straight from the help on OW: "You can use a set style Ri/3/1000"

Am I missing something overly simple?

User avatar
Beholder
Scout
Scout
Posts: 150
Joined: 27 Feb 2006
Location: Poland, Kraków
Contact:

Unread postby Beholder » 09 Nov 2006, 16:28

if you`ll change it to receivers then you`ll get a syntax error (no trigger)
As for how it seems, maybe there is some other script modifing these values at the same time. Try to use post instructions, maybe that will help.
Beholder

User avatar
Fnord
Round Table Knight
Round Table Knight
Posts: 341
Joined: 27 Nov 2005
Location: Victoria, BC, Canada

Unread postby Fnord » 09 Nov 2006, 17:37

Some ERM commands simply don't work as instructions. A few won't even work with the post-instruction trigger (!?PI;).

In this case, I think it's impossible to set resources prior to a day 1 timer without the game crashing.

I tested it using a day one timer and it worked fine without any crash or syntax errors.
- Fnord

User avatar
Arkas
Peasant
Peasant
Posts: 56
Joined: 03 Nov 2006

Unread postby Arkas » 09 Nov 2006, 23:04

Good, I was afraid I just wasn't "getting it". I wanted to make sure my syntax was good and that I wasn't missing something basic.

Thanks for the help guys, I'll try it with a day1 timer and if it still doesn't work, I'll try something differently.

User avatar
Arkas
Peasant
Peasant
Posts: 56
Joined: 03 Nov 2006

Unread postby Arkas » 09 Nov 2006, 23:31

Well I solved my problem with the GE Trigger and a Day1 event for the computer player.

I was unable to get the script to work with any of the following methods, and perhaps I am doing something wrong, if so, I can't figure out what it is.

Day 1 event - Didn't work
Day 1 Timer - Timer didn't trigger on Day 1
Instructions - Script error, obviously resources cannot be set on map load.
PI Trigger - Same as above, resources just cannot be set prior to day 1.

Erm.hlp stated that Timers do not work on Day 1.

The TM Timer will not activate properly on the very first day when a map is played, so if you want ERM code (receivers) to do something on the very first day, it is better to link them to something else such as a local event or a day 1 general (timed) event.


I have however seen them being used on Day 1 (in wogify scripts, which may very well be handled differently), and they work. In my case the help was right.

However, the above quoted paragraph did get me back to the GE Trigger which strangely enough had an example of almost exactly what I wanted to do. I apologize for missing that originally and posting for help.

I had read the help and had gone through all of the triggers and receivers several weeks ago, but I have primarily been using examples in the wogify scripts as my guide, and appropriately, Alexis' Script40.erm for this particular case.

User avatar
Fnord
Round Table Knight
Round Table Knight
Posts: 341
Joined: 27 Nov 2005
Location: Victoria, BC, Canada

Unread postby Fnord » 10 Nov 2006, 06:41

It's true that the TM timer didn't work properly on day 1 in an earlier version of WoG/ERM but it was fixed (I don't recall which version) and works correctly in 3.58f. It's the ERM help that's wrong and out of date.

If you want to post the code you used for setting up your timer and the timer trigger, etc. I can tell you if there's a problem there.

And yes, the GE trigger and receiver is another way to do it, although that's only possible to use in custom maps and not with wogify scripts (for obvious reasons). I'm glad you got your code working finally. :)
- Fnord

User avatar
Arkas
Peasant
Peasant
Posts: 56
Joined: 03 Nov 2006

Unread postby Arkas » 11 Nov 2006, 02:30

Thanks Fnord, How do I tell which version of 3.58 I am using? Because the day 1 timer definitely does not work.

As far as code, I used what I already posted above (changed them back to receivers instead of instructions). Used the trigger:

?!TM25;

At the top of the previously posted script.

Then, I set an instruction to set the timer:

!#TM25:S1/1/999/255;

User avatar
Beholder
Scout
Scout
Posts: 150
Joined: 27 Feb 2006
Location: Poland, Kraków
Contact:

Unread postby Beholder » 11 Nov 2006, 10:34

!!UN:V?$1/?$2;

Gets the version of WoG and ERM being used.
$1 version of WoG (now 356 as 3.56)
$2 version of ERM (now 250 as 2.50)
And don`t worry. You`ll probably never memorize all ERM commands :)
We`re about to rewrite the help so that it would be even better, but it takes time.
Beholder

User avatar
Arkas
Peasant
Peasant
Posts: 56
Joined: 03 Nov 2006

Unread postby Arkas » 11 Nov 2006, 12:03

Thanks beholder, that answered my question perfectly, however, I guess mt question should have been... How do I tell if I am on 3.58 or 3.58f?

User avatar
Fnord
Round Table Knight
Round Table Knight
Posts: 341
Joined: 27 Nov 2005
Location: Victoria, BC, Canada

Unread postby Fnord » 11 Nov 2006, 19:15

Arkas wrote:Thanks Fnord, How do I tell which version of 3.58 I am using? Because the day 1 timer definitely does not work.

As far as code, I used what I already posted above (changed them back to receivers instead of instructions). Used the trigger:

?!TM25;

At the top of the previously posted script.

Then, I set an instruction to set the timer:

!#TM25:S1/1/999/255;
To check WoG version, when you start the game, right-click on the Credits button on the main screen. It should say 3.58f if it's 3.58f (Built on Oct 24 2004, ERM 2.8.1)

For the timer, try changing it to !#TM25:S1/1/1/255; instead -- I'm not sure if it works properly if you set a higher increment than the end date.
- Fnord

User avatar
Arkas
Peasant
Peasant
Posts: 56
Joined: 03 Nov 2006

Unread postby Arkas » 11 Nov 2006, 21:58

Ok well I'm not sure how that happened, I could have sworn I downloaded the latest and greatest, but unfortunately not. I still have 3.58, without the "f".

So to my next question. If I go and download 3.58f, will it install over my 3.58 without problems, and which files do I need to back up if any? (I do have custom scripts in the \s folder, and I'm not concerned about other wog files (other than my current custom map).

User avatar
Fnord
Round Table Knight
Round Table Knight
Posts: 341
Joined: 27 Nov 2005
Location: Victoria, BC, Canada

Unread postby Fnord » 12 Nov 2006, 01:32

Arkas wrote:Ok well I'm not sure how that happened, I could have sworn I downloaded the latest and greatest, but unfortunately not. I still have 3.58, without the "f".

So to my next question. If I go and download 3.58f, will it install over my 3.58 without problems, and which files do I need to back up if any? (I do have custom scripts in the \s folder, and I'm not concerned about other wog files (other than my current custom map).
It will usually install fine over a previous version but not always. If you want to be safe, reinstall Heroes from scratch. Or you can try it and if it works, that's great, and if it fails to install, then reinstall from scratch.

What I do is install SoD+AB and then instead of installing WoG over it, I copy and paste the whole SoD folder and install WoG on that. Then if I ever need to install WoG again, I can just do the same thing.

As for backups, yes, backup your Data\s folder and maps, etc. If there are no other files, you won't need to backup anything else. If you have custom WoG Option settings, you could back those up too but it's usually not a big deal to go back in and choose what you want. Of course, if you want to be completely safe, you could backup everything, just in case there's anything you did want to keep that you're forgotten about.
- Fnord

User avatar
Arkas
Peasant
Peasant
Posts: 56
Joined: 03 Nov 2006

Unread postby Arkas » 13 Nov 2006, 02:52

Thanks for your help Fnord, I now have 3.58f and the day 1 timer works fine!

User avatar
Fnord
Round Table Knight
Round Table Knight
Posts: 341
Joined: 27 Nov 2005
Location: Victoria, BC, Canada

Unread postby Fnord » 13 Nov 2006, 04:00

Arkas wrote:Thanks for your help Fnord, I now have 3.58f and the day 1 timer works fine!
You're welcome and great news! :)
- Fnord


Return to “Wake of Gods”

Who is online

Users browsing this forum: No registered users and 3 guests