Author Topic: UnLoad (script) vs. DisposeScript  (Read 3912 times)

0 Members and 1 Guest are viewing this topic.

Offline gumby

UnLoad (script) vs. DisposeScript
« on: February 15, 2011, 02:14:53 PM »
Is there any difference between these two commands in this context?

Code: [Select]
  UnLoad(rsSCRIPT 100)
  DisposeScript(100)

According to the Studio help file:
UnLoad - Unloads a resource from memory. If the resource is rsMEMORY, it frees the allocated memory specified by it's pointer.
DisposeLoad - Unloads a script from memory, including all it's classes, instances, variables, etc.


Just curious.



In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline Cloudee1

Re: UnLoad (script) vs. DisposeScript
« Reply #1 on: February 15, 2011, 06:41:38 PM »
Somewhere if you track down the dispose script, it makes an unload call, Skip the middle man I say. i unload the resources i use in each script. i don't trust enough i guess
Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition

Offline gumby

Re: UnLoad (script) vs. DisposeScript
« Reply #2 on: February 15, 2011, 09:10:57 PM »
I wasn't able to find a 'Dispose' script.  Might you be thinking of the 'DisposeLoad' script?  Here is the procedure:

Code: [Select]
(procedure public (DisposeLoad rsType rsNumbers)
(var i, num)
= paramTotal (- paramTotal 2)
(for (= i 0) (<= i paramTotal) (++i)
= num rsNumbers[i]
(if(rsType)
Load(rsType num)
)(else
DisposeScript(num)
)
)
)

As a side note, I don't quite understand why we would be calling the Load() function (sometimes) if we are calling a script which I would think would be 'unloading'.  I see that in the Main.sc we call this procedure with a NULL value for rsType, so the Load() in this case never gets called...
In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline Cloudee1

Re: UnLoad (script) vs. DisposeScript
« Reply #3 on: February 16, 2011, 04:56:41 PM »
Yeah I'm pretty sure there is a template bug fix post, maybe somewhere else, mines had an unload there for years, forgot it said load... and yeah thats the script I was talking about.

* apparantly that was way back in the Mega-Tokyo days... not seeing it anywhere now.
« Last Edit: February 17, 2011, 07:11:48 PM by Cloudee1 »
Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition

Offline gumby

Re: UnLoad (script) vs. DisposeScript
« Reply #4 on: February 16, 2011, 09:26:28 PM »
So why the difference in the releasing of resources (Unload vs. DisposeScript)?  That would seem to suggest that you 'Unload' some resources, like pics & texts.  But when it comes to a script, one should unload via DisposeScript?  Perhaps to ensure all the variables, etc. get removed as suggested in the Studio help file?  Worth some more investigation, I suppose. 
In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline Cloudee1

Re: UnLoad (script) vs. DisposeScript
« Reply #5 on: February 17, 2011, 11:38:51 AM »
There's also a FlushResources...  I use UnLoad exclusively, maybe it was the only one I got measurable results from, or it's the only one I got to run without errors, can't remember now.
Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition


SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.041 seconds with 23 queries.