MRAD Probe distance

Post ideas & suggestions you have pertaining to the game here.
Post Reply
sdw195
Militia Captain
Militia Captain
Posts: 779
Joined: Wed Nov 18, 2009 1:01 am
Location: Still looking for the csc Antarctica
Contact:

how does the MRAD Probe display the distence form it to the player
and how do i ues the func if possible
Image
Image
Image
Image
"Dash_Merc - George is a genius, in that he created this game engine that is infinitely extendable"
"<@sheepluva>Good night everybody, may the source be with you." <-- FOSG dev
"You only need THREE tools in life - WD-40 to make things go, Duct Tape to make things stop And C-4 to make things go away"
User avatar
alterecco
Fleet Officer
Fleet Officer
Posts: 1658
Joined: Wed Jan 14, 2009 3:08 am
Location: Previously enslaved by the Iocrym

The MRAD Probe dockscreen uses (sysVectorDistance ...) to display distance between two objects. Look at the function mradDisplay in Heretic.xml line 5943 for details.

Please post general modding questions in Shipyards, not Bugs and Brainstorms.
sdw195
Militia Captain
Militia Captain
Posts: 779
Joined: Wed Nov 18, 2009 1:01 am
Location: Still looking for the csc Antarctica
Contact:

i am talking about the little green arrow with the distance form the player to the probe under it
Image
Image
Image
Image
"Dash_Merc - George is a genius, in that he created this game engine that is infinitely extendable"
"<@sheepluva>Good night everybody, may the source be with you." <-- FOSG dev
"You only need THREE tools in life - WD-40 to make things go, Duct Tape to make things stop And C-4 to make things go away"
sdw195
Militia Captain
Militia Captain
Posts: 779
Joined: Wed Nov 18, 2009 1:01 am
Location: Still looking for the csc Antarctica
Contact:

ok i answered my own question

Code: Select all

(setq theTarget (sysCreateShip &scPhobos; targetPos &svAres;))
	(objSetShowAsDestination thetarget True)
will make an ares phobos, a arrow pointing to the phobos and will display the distance form the phobos to the player under the arrow :D

(incase any one was interested)
Image
Image
Image
Image
"Dash_Merc - George is a genius, in that he created this game engine that is infinitely extendable"
"<@sheepluva>Good night everybody, may the source be with you." <-- FOSG dev
"You only need THREE tools in life - WD-40 to make things go, Duct Tape to make things stop And C-4 to make things go away"
sdw195
Militia Captain
Militia Captain
Posts: 779
Joined: Wed Nov 18, 2009 1:01 am
Location: Still looking for the csc Antarctica
Contact:

now when i use this

Code: Select all

(setq arescap (sysFindObject gSource "T:arescap"))
(objSetShowAsDestination arescap True)
(objSetIdentified arescap)

i get the "interger expected" error.

and i also found out that in the intro if a ship has a error with its <ondestroy> it prints it (the error) in the log :?
Image
Image
Image
Image
"Dash_Merc - George is a genius, in that he created this game engine that is infinitely extendable"
"<@sheepluva>Good night everybody, may the source be with you." <-- FOSG dev
"You only need THREE tools in life - WD-40 to make things go, Duct Tape to make things stop And C-4 to make things go away"
User avatar
Prophet
Militia Captain
Militia Captain
Posts: 826
Joined: Tue Nov 18, 2008 6:09 pm

Code: Select all

(setq arescap (sysFindObject gSource "T:arescap")) 
(objSetShowAsDestination arescap True) 
(objSetIdentified arescap)
The error is with arescap.
sysFindObject returns a list of spaceObjects, in your example, a list of stations with the attribute arescap.
objSetIdentified only works with spaceObjects, not a list of space objects so you need to identify the list individually in an enum.

Code: Select all

(enum (sysFindObject gSource "T:arescap") spaceObj  (block Nil
  (objSetShowAsDestination spaceObj True)
  (objSetIdentified spaceObj)
))
Coming soon: The Syrtian War adventure mod!
A Turret defense genre mod exploring the worst era in Earth's history.
Can you defend the Earth from the Syrtian invaders?
Stay tuned for updates!
sdw195
Militia Captain
Militia Captain
Posts: 779
Joined: Wed Nov 18, 2009 1:01 am
Location: Still looking for the csc Antarctica
Contact:

there should only be on station with the "arescap" attribute in the system


but whats weird is that

Code: Select all

(enum (sysFindObject gSource "T:arescap") spaceObj  (block Nil 
  (objSetShowAsDestination spaceObj True) 
  (objSetIdentified spaceObj) 
))
still gives me the "interger expected" error but it makes an arrow pointing to the station i want it to :)
Image
Image
Image
Image
"Dash_Merc - George is a genius, in that he created this game engine that is infinitely extendable"
"<@sheepluva>Good night everybody, may the source be with you." <-- FOSG dev
"You only need THREE tools in life - WD-40 to make things go, Duct Tape to make things stop And C-4 to make things go away"
User avatar
alterecco
Fleet Officer
Fleet Officer
Posts: 1658
Joined: Wed Jan 14, 2009 3:08 am
Location: Previously enslaved by the Iocrym

even when there only is one result returned from sysFindObject it is still wrapped in a list. The only exception to that rule is when the criteria include 'N'; then there is only returned the nearest matching object, not wrapped in a list

The easiest thing to do would just be

Code: Select all

(block (aresCap)
  (setq aresCap (sysFindObject Nil "N T:arescap;"))
  (if aresCap (block Nil
    (objSetShowAsDestination aresCap True)
    (objSetIdentified aresCap)
  ))
)
sdw195
Militia Captain
Militia Captain
Posts: 779
Joined: Wed Nov 18, 2009 1:01 am
Location: Still looking for the csc Antarctica
Contact:

i found what was making the error

Code: Select all

(setq F4 (lambda nil
(block nil
(enum (sysFindObject gSource "T:arescap") spaceObj  (block Nil 
(objSetShowAsDestination spaceObj True) 	
; (objSetIdentified spaceObj) 
	)))
	test4
	))
i deleted the (dbglog and forgot to delete the test4 text
Image
Image
Image
Image
"Dash_Merc - George is a genius, in that he created this game engine that is infinitely extendable"
"<@sheepluva>Good night everybody, may the source be with you." <-- FOSG dev
"You only need THREE tools in life - WD-40 to make things go, Duct Tape to make things stop And C-4 to make things go away"
Post Reply