Search found 825 matches

by Bugala
Thu Oct 03, 2019 8:47 am
Forum: General programming
Topic: Any way to save current eventhandler option?
Replies: 9
Views: 390

Re: Any way to save current eventhandler option?

I still don't see how I can get it if I don't know it? That lets put it like this, first there is this part of code that I cant access nor know: rando = rnd(2) if rando=0 InstallEventHandler({OnMouseUp=func1}) else InstallEventHandlet({OnMouseUp=func2}) endif supposing I have no access to "rando", I...
by Bugala
Wed Oct 02, 2019 10:58 pm
Forum: General programming
Topic: Create tables
Replies: 8
Views: 349

Re: Create tables

Actually it is possible to affect Global variables names in Hollywood since all variables are stored in table "_G":

Code: Select all

_G["test"] = 1
DebugPrint(test)
However, I do recommend sticking on multiple dimension table rather.
by Bugala
Wed Oct 02, 2019 9:55 pm
Forum: General programming
Topic: Any way to save current eventhandler option?
Replies: 9
Views: 390

Re: Any way to save current eventhandler option?

Thats what I think too, but how?

for when using command:

Code: Select all

InstallEventHandler(  {  OnMouseUp = function  }  )
There is clearly table going there, but where is the table?

it looks like it could be accessible through TableX.OnMouseUp, but what is the TableX?
by Bugala
Wed Oct 02, 2019 4:25 pm
Forum: General programming
Topic: Any way to save current eventhandler option?
Replies: 9
Views: 390

Re: Any way to save current eventhandler option?

Otherwise yeah, but then my class wouldnt be independent anymore. I am trying to keep that class independent so I can move it from one program to another. If I have to keep track of it manually, then I might forget to do that one time, and will have great difficulty in figuring out why something isn...
by Bugala
Wed Oct 02, 2019 11:35 am
Forum: General programming
Topic: Any way to save current eventhandler option?
Replies: 9
Views: 390

Any way to save current eventhandler option?

What I would like to do is following: InstallEventHandler(OnMouseUp, Function () Resume EndFunction) What however worries me is that maybe I have another Eventhandler already done and now this would be replacing the old one, even I didnt mean to, since this one is meant to be in use only temporarily...
by Bugala
Sat Sep 28, 2019 9:01 am
Forum: General programming
Topic: Anyone done script system that is written to a file?
Replies: 14
Views: 699

Re: Anyone done script system that is written to a file?

Almost forgot to comment back. Yes I took a look at your code and it was useful look. I decided to take for my current script system a different approach, mainly because in your script system there was need to having defined each command as keywords for it to recognise them, and this was problematic...
by Bugala
Fri Sep 27, 2019 3:45 pm
Forum: General programming
Topic: why table.function doesnt pass var while table:function does?
Replies: 3
Views: 241

Re: why table.function doesnt pass var while table:function does?

Yes, you are right on that. Now I see why it does that. Because I use: function table:Function(string) It always assume I have self when calling it. If I use table.function(string) then it is actually expecting to get two variables, where the first one will work as "self". Now that I am sending only...
by Bugala
Fri Sep 27, 2019 1:17 pm
Forum: General programming
Topic: why table.function doesnt pass var while table:function does?
Replies: 3
Views: 241

why table.function doesnt pass var while table:function does?

I encountered a strange situation and I have no idea why. Function s_Intro:Parser_RemoveUnwantedChars(string) DebugPrint("string on arrival: "..string) endfunction using: self:Parser_RemoveUnwantedChars("asd") works. But using: self.Parser_RemoveUnwantedChars("asd") (difference being using . or : fo...
by Bugala
Thu Sep 26, 2019 9:40 am
Forum: General programming
Topic: Anyone done script system that is written to a file?
Replies: 14
Views: 699

Re: Anyone done script system that is written to a file?

@jalih, yes I would like to take a look at that. Maybe I can use parts of it for my own parser. @Samuraicrow Well, Idea is to make things easier for me as well as readable, and possibly even usable by other people, so tables are not the way to go. I have done before with Tables and it is quite much ...
by Bugala
Wed Sep 25, 2019 1:26 pm
Forum: Showcase
Topic: json.hollywood
Replies: 8
Views: 1215

Re: json.hollywood

Okay, then JSON in its current state is not answer to my problem. By the way, i made mistake on that table example: script = { [1] = { command = "EnemyGenerator", enemytype="thieves", chance = 10}, [2] = { command = "EnemyGenerator", enemytype="orcs", chance = 1}, [3] = { command = "AddEvent, eventt...