Freelancer Community Network
Reminder: Internet Explorer 6 or below are NOT supported.
HomeHome
ForumForum
WikiWiki
DownloadsDownloads
ForgeForge
Multiplayer Connection Tutorial
Collapse/Expand Login
Username:

Password:

Remember me



Lost Password?

Register now!
Collapse/Expand Chat
Collapse/Expand Who's Online
33 user(s) are online (12 user(s) are browsing Forum)

Members: 0
Guests: 33

more...
Collapse/Expand Donations
Monthly costs: -30€
Income (ads): +5€
Donations (last month): +0€

Current balance: 60€
(last updated 03/2020)

Please make a donation if you want to help keeping The-Starport online:

Bitcoin address:
Thanks!
Collapse/Expand Links
Collapse/Expand Advertisement
There are currently 48 users playing Freelancer on 45 servers.
May. 28, 2020

Browsing this Thread:   1 Anonymous Users



 Bottom   Previous Topic   Next Topic  Register To Post



BaseDestroyed() event & BaseID

Joined:
2009/8/19 22:31
Group:
Registered Users
FLServer Admins
Posts: 22
Offline
Hello everyone,

I'm currently doing some code for our bases, and I have a little problem :

The BaseDestroyed() function use a iObject var which correspond to the SpaceID of the Base.

I would like to get the iBaseID of a base from the iObject var, but I don't know how to do this ?

(I didn't find the correct function to do this)

Thanks

Posted on: 2010/3/20 11:07
Top
Re: BaseDestroyed() event & BaseID
Just can't stay away
Joined:
2008/2/25 6:48
Group:
Registered Users
Trusted Speciality Developers
Senior Members
Posts: 252
Offline
Have you taken a look at the code in BaseDestroyed()?

Code:
//...
uint iID;
pub::SpaceObj::GetDockingTarget(iObject, iID);
Universe::IBase *base = Universe::get_base(iID);

pub::SpaceObj::GetDockingTarget is what you're after.

Posted on: 2010/3/20 13:17
Top
Re: BaseDestroyed() event & BaseID

Joined:
2009/8/19 22:31
Group:
Registered Users
FLServer Admins
Posts: 22
Offline
Ok, thanks for it !

But I was also looking for a function which did the reverse thing :

How can I get the spaceID (iObject) from iBaseID ?

I would have a look to the function, but can't find FLCore SDK.


Sorry to bother you, but I would really know it

Posted on: 2010/3/20 16:17
Top
Re: BaseDestroyed() event & BaseID
Just can't stay away
Joined:
2008/2/25 6:48
Group:
Registered Users
Trusted Speciality Developers
Senior Members
Posts: 252
Offline
Code:
Universe::IBase *base = Universe::get_base(iBaseID);
base->lSpaceObjID;

And no problem.

Posted on: 2010/3/20 22:52
Top
Re: BaseDestroyed() event & BaseID

Joined:
2009/8/19 22:31
Group:
Registered Users
FLServer Admins
Posts: 22
Offline
This is very very odd, but this function wasn't working all the time
(maybe my code is wrong), so I used iDamageToSpaceID to do what I need.

Thanks a lot for your quick answers, and Bravo for your work, the more I know FLHook, the more I say "Waow !"

Posted on: 2010/3/21 9:49
Top
Re: BaseDestroyed() event & BaseID
Just can't stay away
Joined:
2008/2/25 6:48
Group:
Registered Users
Trusted Speciality Developers
Senior Members
Posts: 252
Offline
Yeah, I remember that there was some weirdness with it - I believe that someone actually needed to visit the base for it to work, or something like that.

Posted on: 2010/3/21 21:11
Top