Jump to content


Photo

Extension help


  • Please log in to reply
6 replies to this topic

#1 NukeTheCat

NukeTheCat

    Isaiah 11:6

  • GMC Member
  • 553 posts
  • Version:GM:Studio

Posted 06 April 2012 - 11:24 AM

I don't whether this is the correct topic to post this, if it isn't please move to the proper topic.

When making an extension there are 4 methods of importing a code or resource: DLL, script, action library and others. It's mentioned that the 'other' can import sprite and resources.
But how do I interact with it, such as, when my script want to get a sprite or sound from it?

Also can you also explain to me how to use the 'menu' argument in the Lib maker? Does it work like this or what? : if argument0 == 'menu1'

Edited by Jlm07, 08 April 2012 - 08:47 AM.

  • 0

#2 IsmAvatar

IsmAvatar

    Good Samaritan

  • GMC Member
  • 2411 posts
  • Version:GM8

Posted 08 April 2012 - 06:06 AM

The menu argument will contain a numerical value. 0 indicates the first selection, 1 indicates the second selection, and so on.

As for the extension question, I do not know. Perhaps they are external resources?
  • 1

#3 NukeTheCat

NukeTheCat

    Isaiah 11:6

  • GMC Member
  • 553 posts
  • Version:GM:Studio

Posted 08 April 2012 - 08:51 AM

Thanks alot. +1 rep. But I'm still wondering how to get resources from the 'others' though script. Is there a function for it?
  • 0

#4 IsmAvatar

IsmAvatar

    Good Samaritan

  • GMC Member
  • 2411 posts
  • Version:GM8

Posted 09 April 2012 - 10:52 PM

After reading the Extension Maker manual, it says Other gets exported to a directory of your choosing (typically "temp"). This means that if you wanted to store, say, sound resources, in your extension, they will get exported where your extension can further access them using External Resource functions, like sound_add.
  • 1

#5 NukeTheCat

NukeTheCat

    Isaiah 11:6

  • GMC Member
  • 553 posts
  • Version:GM:Studio

Posted 10 April 2012 - 07:01 PM

But what happens when I transfer the extension in a different computer? Does the sound get saved in the same directory in the different pc? or does it just loads up? Rep +1
(This is all getting clear to me!)

Edited by Jlm07, 10 April 2012 - 07:01 PM.

  • 0

#6 IsmAvatar

IsmAvatar

    Good Samaritan

  • GMC Member
  • 2411 posts
  • Version:GM8

Posted 10 April 2012 - 07:59 PM

Yes, the resource gets exported to the same directory on the different PC. Again, typically the location is the temp directory. The temp directory is very easy to locate on different computers (and even different operating systems), so you just set your resource to export to a location relative to temp, and it will be there when you need it.

On first run, the resource is exported to said directory. Resources in the temp directory are pretty much guaranteed to exist for as long as the game is running. Afterwards, stuff in the temp directory tends to get cleaned up (especially after a system reboot), so it will just be re-created the next time the game is run.

The temp directory is also a nice place to externally store sprites and sounds because it's not a place that a normal user will look, so it's kind of hidden. Meaning that it's unlikely for honest users to steal your sprites or sounds. Especially since they tend to disappear when the game isn't running.

Edited by IsmAvatar, 10 April 2012 - 08:01 PM.

  • 1

#7 NukeTheCat

NukeTheCat

    Isaiah 11:6

  • GMC Member
  • 553 posts
  • Version:GM:Studio

Posted 10 April 2012 - 08:07 PM

Ok, thank you very much. This will help my extension become more awesomer!
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users