Commonwealth ID proof of concept

A place to discuss mods in development and concepts for new mods.
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

This is a proof of concept mod using custom picker and lnkRemove.

It gives the basic commonwealth station an identification screen. (identifies things in the station for a cost)

one small issue is that you can go one off the list but it still works fine (the blank one is a sentential).

http://xelerus.de/index.php?s=mod&id=176

any questions or comments?
Crying is not a proper retort!
User avatar
Periculi
Fleet Officer
Fleet Officer
Posts: 1282
Joined: Sat Oct 13, 2007 7:48 pm
Location: Necroposting in a forum near you

I think you can fix the list with a quick check- is it getting a nil value?

You can check for that and add a little code-

(setq choice (item (scrGetListEntry gScreen) 3))
(if (not choice)
(scrSetDesc gScreen "Whoops, nothing! Choose again.")
)
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

I just get rid of the actions (other than done) so that isn't a problem, its just an oddity. I think you should look at it to see what it does.
Crying is not a proper retort!
User avatar
Periculi
Fleet Officer
Fleet Officer
Posts: 1282
Joined: Sat Oct 13, 2007 7:48 pm
Location: Necroposting in a forum near you

I did look at it.

Why do you append nil to showList?

Code: Select all

					   (setq showList (lnkAppend showList nil))
User avatar
Periculi
Fleet Officer
Fleet Officer
Posts: 1282
Joined: Sat Oct 13, 2007 7:48 pm
Location: Necroposting in a forum near you

I killed the line where nil is added to the list and there is no more blank entry on the list.
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

if you do that it crashes when you try to identify the last item on the list.

the whole point of the blank spot was due to the cursor going off the list
Crying is not a proper retort!
User avatar
Periculi
Fleet Officer
Fleet Officer
Posts: 1282
Joined: Sat Oct 13, 2007 7:48 pm
Location: Necroposting in a forum near you

Well, I found that out, and that's not a very nice way to do it.

I expected more sophistication from you.
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

there is no way to control the cursor so my hands are tied (that I know of) :cry:
would be glad to hear a better solution
Crying is not a proper retort!
User avatar
Periculi
Fleet Officer
Fleet Officer
Posts: 1282
Joined: Sat Oct 13, 2007 7:48 pm
Location: Necroposting in a forum near you

Wrong, I got it working!

:lol:

I'll give you a hint for the action:

(if (not scrGetListEntry)

For the list:

(if (not showList)
(block nil
(setq showList noneList)
(scrShowAction gScreen 0 nil)
)
)
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

eer what?

why are you messing with scrShowAction in list?

and what was I wrong about? that you can't control the cursor?

(not scrGetListEntry) crashes if off the list
Crying is not a proper retort!
User avatar
Periculi
Fleet Officer
Fleet Officer
Posts: 1282
Joined: Sat Oct 13, 2007 7:48 pm
Location: Necroposting in a forum near you

You are wrong that you're hands are tied.

I just played around with the code, and rather than thinking through a better solution I just found a combination of checks that stops the crash and replaces the list with "No Items To ID" if there isn't an item to ID.

I can see a better way to do it, but it's your mod.

No blank list entry needed, no crashing. You can get the list to work without adding the nil value.

Oh, and keep in mind that <List> gets updated if you move the cursor, use an action or even just click the mouse on the area- and (scrShowAction works in the code block, yes.

I do get an error at the end of the list- because I didn't add item 3 and a way to detect that there aren't anymore items.

Just out of curiousity- why update the list but not the screen? Did you know that the credits don't change- so I go in with 600, spend 400 on the identification and the whole time I am spending money the credits continue to state 600.

Is it really such a bad thing to update the screen?
Last edited by Periculi on Sun Aug 24, 2008 9:06 pm, edited 1 time in total.
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

...

what is going on?

I understand you have a solution to my problem and even better ways of going at it but you don't want to share it?

I don't see what you are trying to do.

List is called if you move the cursor? I know initialize is but not list will see if that is true.
Crying is not a proper retort!
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

I can't reproduce List being called if you move the cursor. :?
Crying is not a proper retort!
User avatar
Periculi
Fleet Officer
Fleet Officer
Posts: 1282
Joined: Sat Oct 13, 2007 7:48 pm
Location: Necroposting in a forum near you

It might not be updating, now that I am playing around with it more.

And the solution is so simple:

You have to update gCustomList with a blank entry if the list goes to nil.

But- I don't like how the credits don't get updated anyhow.

Updating the screen is good.
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

just saw your edit:

the reason I don't want to update the screen is due to when you navigate to the screen the cursor goes to the top again and I want to avoid that behavior (heh everything is about the cursor)
Crying is not a proper retort!
Post Reply