Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Curious about internal names.
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#1
Curious about internal names.

Alright so this is not exactly something I need help with, it's just something I'm kinda curious about.

When you use a script like AddTimer or most callbacks, you can input an internal name for this script (pretty much always being the first parameter). These internal names are used to reference the callback in the script if you are gonna use it for anything. For example a looping timer that you want to stop; you need to use RemoveTimer with the internal name of the timer you want to stop.

I think I know all I need to know about internal names and how to use them, but what actually happens when you leave that string blank?

Often when I define timers, I leave the name empty just because I won't need it. If the timer is only ran once, I see no need to use the internal name, therefore I just keep things simple and don't name it anything. Is this bad practise? Should I name it something even if I don't use it? Does it make any difference?

I suspect that when the name is empty, the engine uses a placeholder type of name for the timer (like timer001 for example). If not, then I suppose it doesn't name it anything at all, but how does it reference itself internally?


I'm not really depending on an answer. As I said, I'm just a bit curious about this. If you know anything, I'd be interested to know =)

02-11-2014, 11:40 AM
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#2
RE: Curious about internal names.

It depends on what you use it for. Since I'm always gonna remove and add timers I usually assign the internal names. But that's up to you. I do that to find out which does what and what to remove and add.

If it doesn't have an internal name? I have no clue.
Also, try not to be me and make the internal names overly weird. One of my timers is named "ILoveD*cks". True story.

"Veni, vidi, vici."
"I came, I saw, I conquered."
02-11-2014, 12:40 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#3
RE: Curious about internal names.

Hehe, some of the script functions I name are sometimes slightly exaggerated. I had a record player spin vinyls until it broke, and when it did, I had it be set on fire and break the vinyl so I named the function F*ckSh*tUp.

Anyways, yeah I don't think there's anything wrong with keeping the name blank, I'm just not sure if it's recommended to use a name at all times. So far I've had no issues of course, but perhaps there's something internal that happens that I'm not aware of, kinda like using non-pow^2 textures. They work sometimes, but they report a warning.

I suppose what I'm wondering is similar to the use of f after a float value. Instead of writing 1.0f I just write 1 because it's simpler. As far as I know it's unnecessary in this case because the script already knows what the data type is. In something like Java it has a bigger role, and generally coders just like to use them as a reference that it is a float and not an integer.
I heard something about the f being more important if you're using doubles along with floats, in a way to distinguish them, but I'm not sure.

Well, I guess this is just general scripting behaviour and something I should look up somewhere... when I can be bothered to.

(This post was last modified: 02-11-2014, 02:50 PM by Mudbill.)
02-11-2014, 02:49 PM
Find




Users browsing this thread: 1 Guest(s)