Hard Light Productions Forums

Modding, Mission Design, and Coding => The Scripting Workshop => Topic started by: Shivan Hunter on August 16, 2025, 10:30:40 am

Title: How to pass in a Container as a parameter to a script?
Post by: Shivan Hunter on August 16, 2025, 10:30:40 am
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?
Title: Re: How to pass in a Container as a parameter to a script?
Post by: Goober5000 on August 18, 2025, 11:41:18 pm
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.)
Title: Re: How to pass in a Container as a parameter to a script?
Post by: karajorma on August 19, 2025, 04:29:56 am
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.