I am new to PureBasic and am working on an idle game. I'm creating a function to initialize all gadget structures so that I can build the necessary gadgets from the widget structure data. I'm getting the error "structure Widget not found," even though I've included the file and confirmed the name is correct, including capitalization. Any help would be greatly appreciated.
Link to code: https://www.dropbox.com/scl/fi/b6sjbiqy ... p60q7&dl=1
Structure Not Found
Re: Structure Not Found
A module is isolated so you need an extra include inside of the module:
Code: Select all
DeclareModule Widgets
IncludeFile "Structures.pb"
Dim PetGadget.Widget(6)
Dim ContGadget.Widget(6)
Declare InitGadgets()
EndDeclareModule
Re: Structure Not Found
Hello, and welcome to the forums. Modules are encapsulated, so they are not being modified with codes (or structures can't be used) that are outside a module. There are tricks to do it though. For a small idle game, you can add the structures to all of your modules that needs them.
(I like modules and they are powerful, but for learning experience and for a small little game, they are not absolutely necessary.)
Anyway, don't worry. First steps are always like that. Feel free to ask (there will be more questions, but also there will be someone who will happily answer it).
(I like modules and they are powerful, but for learning experience and for a small little game, they are not absolutely necessary.)
Anyway, don't worry. First steps are always like that. Feel free to ask (there will be more questions, but also there will be someone who will happily answer it).