A WAY TO ADD CUSTOM "PARTY" STATUS PANE & MANY OTHER LITTLE PROBLEMS

Soo, I come up with another problem. Also, I'm sorry if it's not clear enough. I'm bad at explaining things.
First of all, here is what I'm trying to do:

  1. I want to create a customized status pane (and customized command pane, which doesn't really matter but I'd prefer to fix it if it's possible and if you don't mind).
  • I tried setting JS.setCustomStatus on the start script on the game object as it's written in the tutorial and I did visit several other related posts but I am still lost.
  1. So I planned to have the customized status pane to actually be a list of the members in the player's party.
  • I found a post about "How to make a party" which seemed to be related, but as far as I read, it was about characters following the player. I did fix the following player problem soon after that, though. I tried to make a new object list called as player.party, and the NPCs, when they decide to "follow" the player, will be added to this party. I also made a boolean attribute in which the player, or the characters will be added to the list if the attribute is true (I deleted the code for this though, since I don't know if this whole thing can be operated. Hesitant, hesitant).
    Here is the part of start script:
JS.setCustomStatus ("Party:" + player.party)
player.party = NewObjectList()

I tried to switch the order but it became messed up. The code above is also not working when I tried to do it last time.
(Most of the posts mention HTML. I think I really should learn it soon lol)

  1. If it's possible, I hope I can run a script when I click the party members. Showing commands also do.
  • The only thing I can think of to do this is to use a command, but then the commands won't be connected to the list anymore, will it?
  1. Not really important, but can I actually imitate the status pane? Like, making it a drop-down-list-like...
  2. Next, I also plan to have the GetInput being limited. I mean, related to my previous post, I wanted to have the players input only alphabets for their name and not including symbols or numbers. Tried using an asterisk (*) (since that's what you do in microsoft access) but seems like it doesn't work here in the coding world hehe~
  3. Another thing in my mind - not so important is, how can I hide panes? I wish to only make the party pane visible only after the first time the player has a member.

I'm sorry for the troubles and the many questions. Just wish I don't have to create new topics many times. (._.)
Either way, I'm sorry if I can't check or reply anytime soon due to my current schedule. Wish the holiday is a bit longer~


Io

Hmm, I don't know enough about JScript to help with this, sorry.

Also, I'm not SURE, but I don't know if object attributes can be object lists? The game doesn't give it as an option, I know that much.


JS.setCustomStatus ("Party:" + player.party)
player.party = NewObjectList()

The first thing I notice is that you're casting an objectlist to a string. This will probably make your status pane look something like: "Party: List: Object: Dave, Object: John, Object: Rick". - I'm pretty sure that isn't what you want.

Secondly, do you really want to set player.party to an empty list every time it's displayed?

Oh, you're doing this in the start script. Are you calling setCustomStatus again when a party member is added or removed later? The contents of the custom status pane only change when you call it manually.

Next, I also plan to have the GetInput being limited. I mean, related to my previous post, I wanted to have the players input only alphabets for their name and not including symbols or numbers.

if (IsRegexMatch ("[^A-Za-z ]", result)) {
  msg ("That isn't a valid name!")
}

Or if you want to be a little more fancy, you could use the jquery mask plugin, which allows you to put restrictions on the textbox so that disallowed characters don't even appear.

Not really important, but can I actually imitate the status pane? Like, making it a drop-down-list-like...

Do you mean putting party members in a different box that works like the "inventory" and "placesobjects" panes?
I wrote a script a while back to make a 3rd pane for a spellbook, which I think should be adaptable.

It's a pretty large chunk of code, though.


A little thought about restricting input.

How about:

JS.eval("$('#txtCommand').on('input', function () {$(this).val($(this).val().replace(/[^A-Za-z ]/, ''));});")

Removes all characters except from A-Z, a-z, and space from the command bar every time the user changes its contents.

Can be reverted by using:

JS.eval("$('#txtCommand').off('input')");

if you want to allow numbers at some point.


Thanks. I'm sorry for the late reply. I will try as soon as I can!


Sorry for the late reply.
@mrangel thanks for the help, though. It's all working. Just a little question, though, for the list in the JS.setCustomStatus. I did try recalling the javascript every time I want it to update, but it doesn't seem to be working, as expected. Any idea about adding the list of party members in the status pane?
Also, what should I do if I want to convert library code in notepad into a format readable by Quest?


._.


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums