The Daily Click ::. Projects ::. Asunder
 

Project: Asunder
Project Started: 24th June, 2009 Last Update: 20th September, 2012
Project Owner: Pixelthief Project Members: Pixelthief
Project Type: WIP Project Progress:

Riddle me this:
Posted 26th Aug 10, by Pixelthief  
Magic deque object in expression editor:


GetElementArray( "SoundArray", LoopIndex("Reverse Sounds")+1, 2)-Frames_Elapsed

returns 430


Abs(GetElementArray( "SoundArray", LoopIndex("Reverse Sounds")+1, 2)-Frames_Elapsed)

returns 1091567616

Floor(GetElementArray( "SoundArray", LoopIndex("Reverse Sounds")+1, 2)-Frames_Elapsed)

returns 1077936128


What, the devil, is going on here?

Posted by Toasty 27th August, 2010

Looks like its maybe a problem with the data type returned from the GetElementArray() function. I gather you are trying to convert to an integer? You may have to cast the returned value into the right type first. Maybe try the val() function?

Technically the floor of 430 should be 430. It should be used for rounding floating decimal numbers eg: floor(430.2) is 430, at least thats what I think its for.

Abs() is used for returning the unsigned value of a number so -430 would become just 430.

Haven't used Magic Deque before, how reliable is it?
 
Posted by Pixelthief 27th August, 2010

After some discussion on the clickteam forums, I found out that the "Change Value" function on the magicdeque object has a typo in it- it returns a string (and this is somehow forcibly type converted). As a result the bad stuff cascades down.

Besides this I've never had any issues with magic deque. It can crash a program if you do illogical things with it, like try to reference an element on a stack that doesn't exist (it *should* just throw errors like the xLua object!).


But yeah, theres a few typos it seems. Can't use those functions at all. If you watch carefully, it says "string" in the input box instead of "value" for the dialog:

Imagehttp://img153.imageshack.us/img153/6140/say.png></img>
 
Posted by Pixelthief 27th August, 2010

make that:

http://img153.imageshack.us/img153/6140/say.png
 


 



Project Forums


Favourite

Advertisement

Worth A Click