.com.unity Forums
  The Official e-Store of Shrapnel Games

This Month's Specials

Raging Tiger- Save $9.00
winSPMBT: Main Battle Tank- Save $6.00

   







Go Back   .com.unity Forums > Digital Eel > Weird Worlds: Return to Infinite Space > Scenarios and Mods

 
 
Thread Tools Display Modes
  #1  
Old November 13th, 2007, 04:54 AM

mantari mantari is offline
Private
 
Join Date: May 2007
Posts: 38
Thanks: 0
Thanked 1 Time in 1 Post
mantari is on a distinguished road
Default Running into some simple ITEM/PAGE bugs. Help?

Problems I've run into:

1] My inventory is empty before going to the planet. Most of the time, 5 items are created in my inventory. But sometimes 4 items are created. What's up with that?

2] What is the order of operation/evaluation for pages? (My experiments tell me that it is PAGE 0, PAGE 2, then PAGE 1. WHY?!!) Pages 1 or 2 will be displayed depending on if the item is generated in page 0. The very strange thing... if the content of pages 1 and 2 are swapped, it'll say that the frog never exists, even when it does! I do not want to always have a NOITEM case if I can avoid it.

Here is my code...

Code:
FLAG event always
KEYS unstablestar2

STAR 0
STRT msq_yellow
STRN Omni0
PLNC grassland
FLAG nearby
END STAR

CONDITION 0
TYPE explore
STR0 0
END CONDITION

CONDITION 1
TYPE haveitem
STR0 lf_lookfrog
END CONDITION

PAGE 0
REQ0 0
ITEM random life
ITEM random life
ITEM random life
ITEM random life
ITEM random life
END PAGE

PAGE 1
REQ0 0
NOVA 0 2 0 msq_yellow civilwar
ACTN endquest
GFXP misc/civilwar.jpg
TITL Global ThermoNuclear War
TEXT NOFROG!
SCOR 200 strategic
END PAGE

PAGE 2
REQ0 0
REQ1 1
NOVA 0 2 0 msq_yellow civilwar
ACTN endquest
GFXP misc/civilwar.jpg
TITL Global ThermoNuclear War
TEXT FROG!
SCOR 200 strategic
END PAGE

  #2  
Old November 13th, 2007, 01:33 PM

sgqwonkian sgqwonkian is offline
Sergeant
 
Join Date: Aug 2007
Location: Seattle
Posts: 231
Thanks: 3
Thanked 13 Times in 10 Posts
sgqwonkian is on a distinguished road
Default Re: Running into some simple ITEM/PAGE bugs. Help?

I have found that running the same command multiple times in a PAGE often results in only some of the lines activating. How many seems to be at least partially dependant on what the exact command is. For example, with SVAR it seems to only be the last instance of SVAR that triggers, making it take a multi-page pain-in-the-butt to have one event change numerous variables.

If for some reason you need it to generate exactly 5 items, your only real way to guarantee that is with a string of 5 PAGEs, each having a single instance of ITEM and 4 having a GOTO command to shuttle you on to the next page.
__________________
WW:RTIS & modding: http://transitivegaming.blogspot.com...abel/WW%3ARTIS
Other gaming stuff: http://transitivegaming.blogspot.com
  #3  
Old November 13th, 2007, 01:59 PM

mantari mantari is offline
Private
 
Join Date: May 2007
Posts: 38
Thanks: 0
Thanked 1 Time in 1 Post
mantari is on a distinguished road
Default Re: Running into some simple ITEM/PAGE bugs. Help?

You're awesome. I love your mods. Here is what I think I've figured out...

ALL matching items will run. (I figured this out by using ITEM and REMV to figure out which lines were being called. I can show you the code, if you're curious.) But, the last SVAR will have the final say on what the variable is set tp. If there are multiple pop-up windows (like in the example above),, only the last one processed will be shown to the user. The in-between ones will be ignored. Wild!

Here's a new bug I just tripped over...

Inside of a STAR block, if you set multiple variables with UVAR, only the *last* UVAR will be processed.

So, if you need to initialize multiple variables inside of a star block, you're probably best off setting a flag like "UVAR init 1", and then use a CONDITION and a PAGE to set the full list of variables. So, at least, this one can be worked around.
  #4  
Old November 13th, 2007, 05:18 PM

sgqwonkian sgqwonkian is offline
Sergeant
 
Join Date: Aug 2007
Location: Seattle
Posts: 231
Thanks: 3
Thanked 13 Times in 10 Posts
sgqwonkian is on a distinguished road
Default Re: Running into some simple ITEM/PAGE bugs. Help?

That's cool that you went to the trouble of testing it out more thoroughly. I've never had the patience to go through and test variations for the sake of figuring out the limitations of the system.

If it's no big trouble, please post the code as you tested it, it'd make it easier to understand exactly what you were saying.

A while back I'd hit the multiple-command problem with SVAR, and one of the REMV/REMI/REMA codes. Since moving the later instances of the command to new PAGEs solved the problem in both situations, I assumed it was a universal issue. Also, look at the Haven quest in the main game. They use 3 different PAGEs to put the three items on the planet.


P.S.: Thanks for the kind words about my mods.
__________________
WW:RTIS & modding: http://transitivegaming.blogspot.com...abel/WW%3ARTIS
Other gaming stuff: http://transitivegaming.blogspot.com
  #5  
Old November 13th, 2007, 09:03 PM

mantari mantari is offline
Private
 
Join Date: May 2007
Posts: 38
Thanks: 0
Thanked 1 Time in 1 Post
mantari is on a distinguished road
Default Re: Running into some simple ITEM/PAGE bugs. Help?

Okay. Here's what the code does:

You start with nothing. Go to the Star "Omni0". When you arrive on the planet, it will say: [TITLE "Page 5 Global"]: "Match on conditions 0 and 4 - removing a lookfrog, adding a threep." You will end up with a Cenotaph, a Codex, a Lummox, a Bee, and Threep. It will not say anything more (and the nova will go off in two days at a different star, and 200 days at the star you are currently at.)

Here is what happens when you visit the 'Omni0' star system:

PAGE 0 runs --
REQ0 verifies you are visiting for the first time.
You are given a brain.
You are given a brass time capsule.
You are given a cenotaph.
You are given a codex.

The next page is then automatically evaluated. (My personal experience is that even putting in a ACTN BREAK doesn't stop this from happening.)

PAGE 1 runs --
REQ0 verifies again that you are still visiting for the first time. (You still are.)
You are given a Lummox.
The nova is set to go off in 2 days.
Some text is put into the display buffer, but is not yet displayed.

The next page is then automatically evaluated.

PAGE 2 runs --
REQ0 verifies again that you are still visiting for the first time. (You still are.)
REQ1 verifies that you have the brain. You didn't have it at the start of the quest, but you received the brain in PAGE 0. It is fine with that, evidently, because the conditions are evaluated as they happen. Big surprise for me.
The Brain (received in PAGE 0) is taken away.
You are given a lookfrog.
The nova is set to go off, once again, in 2 days. This is a duplicate that has no ill effect.
Some text is put into the display buffer, but is not yet displayed.

The next page is then automatically evaluated.

PAGE 3 runs --
REQ0 verifies again that you are still visiting for the first time. (You still are.)
REQ1 verifies that you have the brass time capsule. You didn't have it at the start of the quest, but you received the brain in PAGE 0. It is fine with that.
The brass time capsule (received in PAGE 0) is taken away.
You are given a piranha bee.
The nova is set to go off in 2 days... on a completely different star than the one you are currently at.
Some text is put into the display buffer, but is not yet displayed.

PAGE 4 runs --
REQ0 verifies again that you are still visiting for the first time. (You still are.)
REQ1 verifies that you have the toy robot. YOU DO NOT! You were never given that.
The page is skipped.

PAGE 5 runs --
REQ0 verifies again that you are still visiting for the first time. (You still are.)
REQ1 verifies that you have the lookfrog. You didn't have it at the start of the quest, but you received the brain in PAGE 2. It is fine with that.
The lookfrog (received in PAGE 2) is taken away.
You are given a threep.
The nova is set to go off in 200 days on the star you are currently at. (We previously set it to 2 days.)
Some text is put into the display buffer.

Because you are out of pages, the last item in the display buffer is displayed (page 5). All the other things printed in the previous pages never happened. Any nova setting that was changed? The previous settings won't happen. The nova will go off in 200 days in the current system (and the one in the other system will still go off in 2 days).

All of the items added and removed in all of the (successful) pages [all but page 4] happened just fine. Just the text that goes along with them will never be displayed. This is probably why they want you to use GOTOs for multi-page texts.

The big items to take away from the example:
CONDITIONS are evaluated each moment they are called inside of the page. They are not evaluated ahead of time. So the result of a condition can actually change and be processed immediately by the next page that matches.

All pages are evaluated, from the first page to the last page. (I read somewhere that the numbering of PAGES is just a human label -- so be very careful to always keep your pages in order, and also never skip a number.)

If multiple pages match, they will all be processed. Variable assignments from each page will be processed. Commands to removing and add inventory items will always be processed.

But if multiple pages display text, only the final text box will be the one displayed.

Some commands will behave differently, depending. If you set STAR 0 to explode in 2 days, then set STAR 0 to explode in 200 days, it will explode in 200 days.

If you set STAR 0 to explode in 2 days, and STAR 1 to explode in 2 days, and STAR 0 again to explode, this time in 200 days, then STAR 0 will explode in 200 days (you LAST instruction for that star) and STAR 1 will explode in 2 days.

I think this goes a long ways to explain why people are running into some really strange quest bugs. They can be executing multiple PAGEs and not even know it, because only the text/box from the final PAGE will display, but everything else in between (mostly) still processes.

Here is the code I used for this test. You should be able to plug it into a vanilla mod with no tweaking other than putting it into the game.ini file. NOTE: RUN ON A MEDIUM MAP OR LARGER. THIS WILL CRASH (because of two created stars) ON A SMALL MAP!

Code:

FLAG event always
KEYS unstablestar2

STAR 0
STRT msq_yellow
STRN Omni0
PLNC grassland
FLAG nearby
END STAR

STAR 1
FLAG nearby
END STAR

CONDITION 0
TYPE explore
STR0 0
END CONDITION

CONDITION 1
TYPE haveitem
STR0 it_brain
END CONDITION

CONDITION 2
TYPE haveitem
STR0 it_brasstc
END CONDITION

CONDITION 3
TYPE haveitem
STR0 it_toyrobot
END CONDITION

CONDITION 4
TYPE haveitem
STR0 lf_lookfrog
END CONDITION

PAGE 0
REQ0 0
ITEM it_brain
ITEM it_brasstc
ITEM it_cenotaph
ITEM it_codex
END PAGE

PAGE 1
REQ0 0
ITEM lf_lummox
NOVA 0 2 0 msq_yellow toxic1
TITL PAGE 1 Global
TEXT Match on Condition 0 - adding a lummox!
SCOR 200 strategic
ACTN break
END PAGE

PAGE 2
REQ0 0
REQ1 1
REMV it_brain
ITEM lf_lookfrog
NOVA 0 2 0 msq_yellow toxic1
TITL PAGE 2 Global
TEXT Match on conditions 0 and 1 - removing a brain, adding a lookfrog!
SCOR 200 strategic
ACTN break
END PAGE

PAGE 3
REQ0 0
REQ1 2
REMV it_brasstc
ITEM lf_piranbee
NOVA 1 2 0 msq_yellow toxic1
TITL PAGE 3 Global
TEXT Match on conditions 0 and 2 - removing a brain, adding a piranabee!
SCOR 200 strategic
ACTN break
END PAGE

PAGE 4
REQ0 0
REQ1 3
REMV it_toyrobot
ITEM lf_windbag
NOVA 0 2 0 msq_yellow toxic1
TITL PAGE 4 Global
TEXT Match on conditions 0 and 3 - this should not happen, but if it does, adding a windbag.
SCOR 200 strategic
ACTN break
END PAGE

PAGE 5
REQ0 0
REQ1 4
REMV lf_lookfrog
ITEM lf_threep
NOVA 0 200 0 msq_yellow toxic1
TITL PAGE 5 Global
TEXT Match on conditions 0 and 4 - removing a lookfrog, adding a threep!
SCOR 200 strategic
ACTN break
END PAGE



You wouldn't believe how frustrating, but how educational the process of trial and error (getting to this point) was.
 

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 01:30 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2024, Shrapnel Games, Inc. - All Rights Reserved.