Difference between default and load?

Fill this out this info to make it easier for the community to help you! If you don’t fill out this information, your post may be deleted or removed.

What Wick Editor Version are you using?
1.19

Describe the Problem
i think default and load are the same thing… it’s just that default runs first.

What have you tried so far?
there’s not really anything to try.

Do you have a Wick Editor File that we can see? Optional*

My Project5-10-2021_17-40-39.wick (4.2 KB)
this shows how the mechanic works. sort of. it’s probably a bit confusing.

2 Likes

Default: Happens once before ALL scripts
Load: Loads code once every frame
Get it?

i know, but the only difference is which runs first. default also runs every time you enter the frame.

Default - How everything is meant to be when the project starts

Load - What occurs after loading everything

The only difference - Default runs first
Yes, there’s no other difference that I know of.

However, both scripts are highly useful. The default script is meant to have the project set to the default state for the frame (set variables, position, everything to default), while the load script is meant to overwrite the default state of the frame.

Yes, we can use one of these scripts instead of both, but we can also use both instead of one

1 Like

Here is an example with the execution order:
image

It seems that for one frame with multiple layers, all the default scripts run first and then the Load scripts. This is useful when you have dependency problems in your game/app. Example if you need your engine to run first, but it is in a lower layer, then you could put your engine in that default script, and then the rest of the code in the Load script.

3 Likes