Create your own Interactive Fiction

ADRIFT - Interactive Fiction  
Home   |   News ADRIFT News RSS   |   Screenshots   |   Download   |   Games ADRIFT Reviews RSS   |   Forum   |   Help   |   Links
Welcome Guest Register | Login
Popular Games
Skybreak v. 1.4
The Fortress of Fear
Skybreak v 1.2
Lost Coastlines
The Lost Labyrinth of Lazaitch
the virtual human
The Dwarf of Direwood Forest
Classic Adventure
Starship Quest
The Lost Children
 
Latest Forum Posts
ParserComp 2024 site is up
HAPPY BIRTDAY RoozdenScoot!
Copyright limitations?
Search Function Not Working In Windows 11
errors
Forum site error
The Book of Jax - The Adventures of Alaric Blackmoon # 10
HAPPY BIRTHDAY DazaKiwi
HAPPY BIRTHDAY ralphmerridew
An' anuvver fing....
 
Latest Reviews
Classic Adventure
Private Eye
Roozden's Color Code Module
Wumpus Hunt
Lost Coastlines
The Lost Labyrinth of Lazaitch
October 31st (Post comp.)
The Euripides Enigma
AI
Hint System Library - Release 1

Make a donation

Cursor  Setting score variable to an array element reference with a variable results in errormessage

Issue Type: Status: Priority: Date Submitted: Votes:
Bug Open Low Fri 21st Jun 2013 2 votes Vote Up Vote Down
 
Found in version: Last Updated: Completed in version: Date Completed: Track Changes:
5.0.30.1 Mon 24th Jun 2013 Log In
 
Fri 21st Jun 2013 12:07
Using a task and setting the score like this:

Set Score to %Score%+%Array[%Index%]%

yields an out-of-bounds array error if %Index% is initialized as 0 in the game. This happens even if the game itself changes the %Index% before the score setting task is run. This can be a pain when making a lot of use of the %number% argument to set scores.

I created the following work around to stop the beeping error messages:

Set Score to %Score%+%Array[max(%Index%,1)]%

But it shouldn't happen in the first place :).
 
saabieSat 22nd Jun 2013 05:49
%Score% is a special system variable that contains special logic to prevent it being updated more than once by any given task, and to sum all of the score's to calculate the value of %MaxScore%.
Whenever you enter an equation like %Score%+%Array[%Index%]%, ADRIFT will immediately calculate Set MaxScore to %MaxScore%+%Array[%Index%]%, and as the array index is wrong then you should be getting an error.
If you add anything other than a constant to %Score% then %MaxScore% will be wrong anyway.
You should create your own variable and use that instead of %Score% if you are going to do anything different than what it was intended for.
 
Sat 22nd Jun 2013 14:25
Ah saabie, thanks. I'll think of a way to work around this. But I actually like the only-one-trigger-aspect of the score system.
 
saabieMon 24th Jun 2013 01:18
You can do the same thing with your own score variable by putting each score increase in a specific task that is set to only run once.
© 2013 Campbell Wild. All rights reserved. | Contact the Webmaster