Author Topic: How does the truck se work?  (Read 4330 times)

How does the truck se work?
« on: August 28, 2017, 10:53:42 pm »
Hey guys. You must know the truck SE where you can find a vertie. I took a look at the map and I studied the initialization code that runs. Everything is clear and well written. Except one thing. How does that code gets called? I couldn't find that in the map source nor could I find it in the location. I tried to look through all the scripts for the function name or map name. No dice.

Just out of curiosity - where is the bond between the map and the script. I have a suspicion that it's somewhere where the SE gets called. I didn't find that yet.

Re: How does the truck se work?
« Reply #1 on: August 28, 2017, 11:30:12 pm »
its in the map "source"
something like
__rip_Fun_

my memory is hazy so i can't remember the letters to fill that in.
« Last Edit: August 28, 2017, 11:32:06 pm by devis »

Re: How does the truck se work?
« Reply #2 on: August 29, 2017, 01:09:01 am »
Quote
You must know the truck SE where you can find a vertie.
No, never had it :(

Quote
Just out of curiosity - where is the bond between the map and the script.
In se_truck_cave.fomap:
Code: [Select]
ScriptModule         map_se_truck
ScriptFunc           warehouseInit

Re: How does the truck se work?
« Reply #3 on: August 30, 2017, 08:32:14 pm »
Yeah, I saw it in se_truck_cave before exploring the code of the function. But it doesn't make any sense. The code affects the se_truck map, which is the entry map. I was expecting it to be executed by the map that it affects.

Wait...

So am I understanding this correctly that any initialization script in any map of the location has access by reference to all maps of the location and gets executed once the location is initialized?

This adds a lot of freedom in my scripting. A lot of freedom. Now I can store variables from one maps in other maps' space or I can create technical maps that would be used only to store map variables, some npcs, lockers, etc. Well in case I need it. Not that I will ever need it, but it's good to know. Thanks!