Outerra forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Outerra Tech Demo download. Help with graphics driver issues

Author Topic: Script includes  (Read 4935 times)

giucam

  • Full Member
  • ***
  • Posts: 171
  • It's an ugly pile of bones... like me.
Script includes
« on: November 23, 2012, 10:21:37 am »

Well, i'm pretty blown off... i wanted to put the engine implementation in a different js file but i found out javascript doesn't have any #include like thing.
Google says there are workarounds but they are for js files used in web pages. Is there an Outerra way to do that?
Logged
ResidualVM 0.1.1 is OUT! www.residualvm.org

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6721
  • No sense of urgency.
    • outerra.com
Re: Script includes
« Reply #1 on: November 23, 2012, 10:49:27 am »

Normally html files can contain multiple script statements so you don't necessarily need includes, but in our case it's a problem. We can attach multiple scripts into JS context, but so far there's no way how to specify which ones should be attached. Looks like we'll have to add support for it by allowing some #include statements in the root script and then, before loading, parsing the script header and attach the referred scripts, removing the #include lines as we do it.

Maybe not #include but something else.
Logged

giucam

  • Full Member
  • ***
  • Posts: 171
  • It's an ugly pile of bones... like me.
Re: Script includes
« Reply #2 on: November 23, 2012, 11:45:24 am »

mmh... it amazes me how can a language not have such a basic thing builtin...

i can leave without it without problems for now but yeah, it will be needed in the future.
Logged
ResidualVM 0.1.1 is OUT! www.residualvm.org