question

Peter Jones avatar image
0 Likes"
Peter Jones asked Adrian Haws edited

Flexscript Errors preventing roller coaster model from compiling and running properly

Im running the Roller coaster model and it loads ok and runs but will not compile properly.

The GUI reports do not update as expected with no riders loading and the av waiting time not updating.

I get this error in compiler console:

Flexscript ErrorMODEL:/RollerCoaster>variables/messagetrigger Line 65Pointer cast to an integer will lose its value in 64-bit. Use a double or preferrably a more type-safe method. for quite a few lines.

Plus this comment at the bottom:

Could not finish parsing because of previous errors.

FlexSim 16.0.1
flexscript errorroller coaster
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

·
Arun Kr avatar image
1 Like"
Arun Kr answered Adrian Haws commented

Hi Peter Jones,

I have not looked at the model, most probably the error is because of initializing a variable as int instead of double in line 65.

For instance, the similar error can occur if you assign the number equivalent of an object to an integer variable. In those situations, assign the number equivalent as a double variable.

The number equivalent is made using tonum() command.

treenode object = node("Queue",model());// for example

int objectnum = tonum(object); // wrong way

double objectnum = tonum(object); // right way

Also, check the attached models. error-1.fsm error-removed.fsm

Regards,

Arun KR


error-1.fsm (13.5 KiB)
error-removed.fsm (82.1 KiB)
· 5
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Peter Jones avatar image Peter Jones commented ·

Arun

Thanks for your response I understand what to do but not where I can get to the script editor to fix the issue in the code.

I'm running on the free download EXPRESS and have no access to the script command console. Do I need to upgrade to enterprise to achieve this edit?

Regards

PJ

0 Likes 0 ·
Arun Kr avatar image Arun Kr Peter Jones commented ·

Hi Peter,

You should be able to view and change the code in the on message trigger of the roller coaster object. But you will not be able to save the model since flexsim express is having an object limit of 30 objects.

Also, in flexsim express version you won't be able to access any of the advanced features of flexsim(Eg.Script Console). So if you want to really modify the model and work you must use an enterprise license.

Regards,

Arun KR

0 Likes 0 ·
Peter Jones avatar image Peter Jones Arun Kr commented ·

Hi Arun

Thanks for sticking with me on this. Your suggestions have helped me find where to edit the script.

However, when I edit the offending lines from "int" to "double" as per your previous post it still has issues.

Ive asked teh local reseller for help. If I get the solution I'll post the answer.

Thanks again - PJ

0 Likes 0 ·
Show more comments

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.