Author Topic: How to pass in a Container as a parameter to a script?  (Read 425 times)

0 Members and 1 Guest are viewing this topic.

Offline Shivan Hunter

  • 210
  • FRED needs lambdas!
How to pass in a Container as a parameter to a script?
When defining a custom sexp via scripting - you can have paramateres be ships, numbers, variables etc. Is there a way to pass in a container (Map of string to int)? Otherwise, how do I access containers in a mission (or campaign file) given e.g. the name of the container?

 

Offline Goober5000

  • HLP Loremaster
  • 214
    • Goober5000 Productions
Re: How to pass in a Container as a parameter to a script?
There is currently no scripting support for containers.  So, unfortunately, containers cannot be used in scripted sexps.  It's a good idea though, so you should lobby a coder to add scripting support.  (If you posted a GitHub issue, it can be put on the feature request list.)

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: How to pass in a Container as a parameter to a script?
I have no idea how scripting works, so I never coded it and even if JG18 does know, I couldn't test it. But if scripting can access variables, we should be able to make it access containers too.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

  

Offline mjn.mixael

  • Cutscene Master
  • 212
  • Chopped liver
    • Steam
    • Twitter
Re: How to pass in a Container as a parameter to a script?
I'm very familiar with the Lua API code and not very familiar with containers. I'm guessing they are some kind of unordered map internally? I'd bet it'd be pretty trivial to add scripting support. +1 to putting the request on the ever-growing and ever-ignored issue tracker.
Cutscene Upgrade Project - Mainhall Remakes - Between the Ashes
Youtube Channel - P3D Model Box
Between the Ashes is looking for committed testers, PM me for details.
Freespace Upgrade Project See what's happening.