Flexscript Errors preventing roller coaster model from compiling and running properly

Flexscript Errors preventing roller coaster model from compiling and running properly

schnauzervillage
Enthusiast Enthusiast
22 Views
6 Replies
Message 1 of 7

Flexscript Errors preventing roller coaster model from compiling and running properly

schnauzervillage
Enthusiast
Enthusiast

[ FlexSim 16.0.1 ]

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.

0 Likes
Accepted solutions (1)
23 Views
6 Replies
Replies (6)
Message 2 of 7

arunTTT2P
Explorer
Explorer
Accepted solution

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

Message 3 of 7

schnauzervillage
Enthusiast
Enthusiast

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
Message 4 of 7

arunTTT2P
Explorer
Explorer

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
Message 5 of 7

schnauzervillage
Enthusiast
Enthusiast

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
Message 6 of 7

schnauzervillage
Enthusiast
Enthusiast

Arun

Actually - it worked! I just needed to close the editing panels after editing!

Brilliant - many thanks - I've even learnt something about advanced topics!

:-)) PJ

0 Likes
Message 7 of 7

schnauzervillage
Enthusiast
Enthusiast

rollercoaster-pj-v1.fsm

Fixed if anyone wants it