Available global variables/parameters?

This forum is for the Lua scriptable clone of DM/CSB called Dungeon Strikes Back by Sophia. Use DSB to build your own highly customised games.

Moderator: Sophia

Forum rules
Please read the Forum rules and policies before posting.
Post Reply
User avatar
Gambit37
Should eat more pies
Posts: 13714
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Available global variables/parameters?

Post by Gambit37 »

I don't really understand the "global" parameters listed on most functions.

There's a lot of stuff passed into functions such as where, ppos, sel_ppos, mx, my, etc. Are these global variables that are always available to every function?

I used the mx and my variables without really understanding where they came from to detect the current mouse position, and it "just worked" :-) But I don't fundamentally understand how these really work, and what variables might actually be available for use. Could you explain this and perhaps also provide a list of these globals? (if I've understood that concept correctly, anyway!)

The more I tinker in DSB, the less I realise I understand...
User avatar
Sophia
Concise and Honest
Posts: 4239
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: Available global variables/parameters?

Post by Sophia »

No, they aren't global at all. :)

Those are simply parameters passed to the function. So, the answer as to what is available is-- whatever is being passed. If you were using a rendering function or something that took mx and my parameters, then the function would of course work because it had those parameters.

What I think you're really asking is, "Is there a coherent list of the formal parameters for each of DSB's functions?" and the answer is "not exactly; the wiki has a fairly decent reference, but I'm sure some stuff is missing."

By the way, please don't use yellow text. I use a light background and I can barely read it. :)
Post Reply