Dear forum users! In compliance with the new European GDPR regulations, we'd just like to inform you that if you have an account, your email address is stored in our database. We do not share your information with third parties, and your email address and password are encrypted for security reasons.

New to the forum? Say hello in this topic! Also make sure to read the rules.

What is the difference between "ID" and "Id"

Here you can find answered ScriptAPI topics.
Forum rules
By using the forum you agree to the following rules.
Locked
jamisco
Superfighter
Superfighter
Posts: 67
Joined: Sun Nov 06, 2016 11:34 pm
Title: Da God
SFD Account: Jamisco
SFD Alias: Jamisco
Started SFD: either late 2015 or early 2016
Location: Somewhere in the east of the United states
Gender:
Age: 103

What is the difference between "ID" and "Id"

Post by jamisco » Sat Jun 24, 2017 5:07 am

There are methods that allow you to get single or multiple objects by their ID

Code: Select all

IObject Gunner_ID = Game.GetSingleObjectByCustomID("The_Gunner");
//or
IObject Gunner_ID = Game.GetSingleObjectByCustomId("The_Gunner");

IObject Gunner_ID = Game.GetObjectsByCustomID("The_Gunner");
//or 
IObject Gunner_ID = Game.GetObjectsByCustomId("The_Gunner");
as you notice there are 2 "id's" ... ID and Id ... what is the difference if I were to use the method with this "Id" instead of this "ID"\

Additionally this applies for every method, property etc that uses the term id. For example there is "UniqueId" and "UniqueID"
0 x
Is it better to be feared or respected... please, is it too much to ask for both?

User avatar
KliPeH
Moderator
Moderator
Posts: 914
Joined: Sat Mar 19, 2016 3:03 pm
Title: [happy moth noises]
SFD Account: KliPeH
Started SFD: Pre-Alpha 1.4.2
Gender:
Contact:

Post by KliPeH » Sat Jun 24, 2017 12:33 pm

Aren't these just aliases for the same function? "You can write it this way or this way", considering programming is case-sensitive?
0 x
 
Image

User avatar
Gurt
Lead Programmer
Lead Programmer
Posts: 1884
Joined: Sun Feb 28, 2016 3:22 pm
Title: Lead programmer
Started SFD: Made it!
Location: Sweden
Gender:
Age: 34

Post by Gurt » Sat Jun 24, 2017 1:28 pm

No difference. ID with upper case is the supported names - the "Id" ones are from earlier versions and kept for backwards compatibility.
2 x
Gurt

User avatar
Motto73
Superfighter
Superfighter
Posts: 316
Joined: Mon May 09, 2016 7:35 am
Title: Lazy ass
SFD Account: Motto73
Started SFD: Multiplayer Test Demo
Location: Sunny City
Gender:
Age: 24

Post by Motto73 » Wed Aug 16, 2017 1:02 pm

Oh nice, I have been testing this earlier. I was about to ask on forums but forgot it.
0 x
Image

User avatar
KliPeH
Moderator
Moderator
Posts: 914
Joined: Sat Mar 19, 2016 3:03 pm
Title: [happy moth noises]
SFD Account: KliPeH
Started SFD: Pre-Alpha 1.4.2
Gender:
Contact:

Post by KliPeH » Wed Aug 16, 2017 9:59 pm

Motto73 wrote:
Wed Aug 16, 2017 1:02 pm
Oh nice, I have been testing this earlier. I was about to ask on forums but forgot it.
I'm glad this two-month old thread helped you with your issue.

Solved, locked.
1 x
 
Image

Locked