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

0 Members and 3 Guests 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 ]