Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible example of usage? nothing major just a small dimonstration #4

Closed
VaasKahnGrim opened this issue Dec 8, 2018 · 2 comments
Closed
Assignees

Comments

@VaasKahnGrim
Copy link

pretty much what the title says. like something that would demonstrate how to put two separate things running on separate threads with this

@VaasKahnGrim
Copy link
Author

VaasKahnGrim commented Jan 10, 2019

currently going off of this link to try and figure out how to use this module http://lualanes.github.io/lanes/#creation

currently I have the following code from that page inside the init file for a gamemode at the very top of it:
require'lanes' local f = lanes.gen(function(n) return 2 * n end) local a = f(1) local b = f(2) print(a[1],b[1])
the issue I'm running into is:
[ERROR] gamemodes/mygamemode/gamemode/init.lua:2: attempt to call field 'gen' (a nil value)

  1. unknown - gamemodes/mygamemode/gamemode/init.lua:2

Couldn't Load Init Script: 'mygamemode/gamemode/init.lua'

my guess is I'm not using the correct way of using gen but I am unsure of what exactly I am doing wrong here.
I currently have gmsv_lanes.core_win32 inside my garrysmod/garrysmod/lua/bin/ and lanes.lua inside garrysmod/garrysmod/lua/includes/modules/

So everything SHOULD be in the correct place to my knowledge.

EDITE: I got it to work with the code, needed to use the configure function after require. I am still interested in a demonstration but I'm going to also practice aswell on my own. thank you for creating this btw :)

@danielga
Copy link
Owner

danielga commented Feb 2, 2019

The best source of information is definitely that website, http://lualanes.github.io/lanes, since this module is just a port to Garry's Mod.

@danielga danielga closed this as completed Feb 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants