View unanswered posts | View active topics
|
Page 1 of 1
|
[ 11 posts ] |
|
| Author |
Message |
|
Faceless_Soldier
|
Post subject: Gump Questions. Posted: Tue Jul 01, 2008 6:28 am |
|
Joined: Mon Jun 30, 2008 9:07 pm Posts: 7
|
|
Ok, I am familiar with eScript to a lesser degree and have a little experience with programming in general and understand most concepts. My question does not relate to logic but to syntax.
Background Info:
- Using 97 Core with 97 Distro.
- Making a gump. (Current questions regard aesthetics)
Ok my question is that Ive dabbled a little with GumpStudio so that I can plan my gump neatly. What Ive noticed is that the GFTileGump with the gumppack is to display and actually tile, thats fine, however, what If I want to 'tile' a pic? Asin, it keeps placing the same ID next to, above and below (tiling) for a certain size, eg. (x, y, id, width, length) sort of thing? Is this supported? I attempted to use resizepic however it crashes as expected.
The next, I know this is not POL, but hoping someone could help me out, the text in GumpStudio which is white with a black border. ID=0, is plain black in UO. Any suggestions to get a similar colour. Note this is just if someone can save me some time looking!
The last actual question is change the font of my writing (on the gump), at the moment its pretty plain, I would like it to be like font #3 (Ref: InsideUO: Fonts), is there anyway of doing that?
Thanks for your time.
|
|
| Top |
|
 |
|
ncrsn
|
Post subject: Posted: Thu Jul 03, 2008 3:10 am |
|
Joined: Fri Feb 10, 2006 12:15 am Posts: 223
|
Faceless_Soldier wrote: what If I want to 'tile' a pic? Asin, it keeps placing the same ID next to, above and below (tiling) for a certain size, eg. (x, y, id, width, length) sort of thing? Is this supported?
No, you cannot do that easy way.
If you want to do it, you have to do it manually, placing every tilepic carefully next to each other.
--
Sorry, to other questions I'm unable to answer right now.
|
|
| Top |
|
 |
|
Faceless_Soldier
|
Post subject: Posted: Sat Jul 05, 2008 12:33 am |
|
Joined: Mon Jun 30, 2008 9:07 pm Posts: 7
|
Thanks for clearing that up, the other two are non-issues.
I do require a little more help however. I intended to build a race system, so I looked at the ZH scripts for inspiration. I decided that instead of the walkon_racegate system I would implement it into a gump.
Code: program RacePickGump(who) if(!who.title_race) //Initialize racegump var racegump := GFCreateGump(0, 0, 800, 600); GFDisposable(racegump, 0); GFClosable(racegump, 0); GFMovable(racegump, 0);
GFPage(racegump, 1); GFAddButton(racegump, 540, 467, 5601, 5605, GF_PAGE_BTN, 9);
GFPage(racegump, 9); GFAddButton(racegump, 520, 505, 2119, 2120, GF_PAGE_BTN, 1); GFTextLine(racegump, 580, 505, 1071, "Return to race menu"); GFTextLine(racegump, 155, 557, 37, "IMPORTANT:"); GFTextLine(racegump, 235, 557, 1071, "Please choose wisely as you cannot change your race if you continue"); //--Confirm button GFTextLine(racegump, 250, 505, 1071, "I wish to join the undead legions"); var pick_Undead := GFAddButton(racegump, 455, 505, 2128, 2129, GF_CLOSE_BTN);
var input := GFSendGump(who, racegump); if (input[pick_Undead]) AssignRace(who, RACEID_UNDEAD, RACE_COLOR_UNDEAD); endif
endif endprogram
Code: function AssignRace(who, racename := RACEID_DEFAULT, colour) if(!who.title_race) who.title_race := racename; who.color := colour; who.truecolor := colour; endif endfunction
The theory...
So obviously I have trimmed it down ALOT. Its actually 10 pages but there is no need for the same thing over and over. Pg0 background, Pg1 is the selection screen which leads you to 1 of 8 other pages, each page has a picture of each race, description, cancel (takes you back to page 1), or confirm.
If you confirm its supposed to call the function AssignRace with the parameters defined by the IF statement at the end. Race/color CONSTs are defined in raceID.inc.
My problem is, that this all operates well as a command (thats how i test my gumps, just make them commands), however I cannot use it as for example, a logon.src... I know this is critical and thats why im going to ask about it. Basically I want this gump to jump up as soon as you log in (without a race [who.title_race]) and force you to choose one... 800x600 nonclosable nondisposable gump, later it will also tele you to a start location.
At first I had it as a function, with logon.src calling it if you had no title_race, worked well apart from the fact that the gump didnt work... How can I make it so it will call the gump if you log in without a race? If theres any logical errors let me know as this is my first real attempt at a gump...
Thanks for your time.
|
|
| Top |
|
 |
|
CWO
|
Post subject: Posted: Sat Jul 05, 2008 1:21 am |
|
Joined: Sat Feb 04, 2006 5:49 pm Posts: 772 Location: Chicago, IL USA
|
|
If its due to the critical nature of the logon script, rename your race script to something else then do Start_Script() from logon.src.
|
|
| Top |
|
 |
|
ncrsn
|
Post subject: Posted: Sat Jul 05, 2008 5:18 am |
|
Joined: Fri Feb 10, 2006 12:15 am Posts: 223
|
|
Yeah, because the logon runs critical POL just sends the gump packet and, instead of sleeping until it gets the answer to it, keeps going ahead. Later on, when player has done the choice and gump results are received, POL does not know anymore where it's supposed to belong, because the process is already killed.
Same thing applies with targetting and other player activity requiring actions.
So what CWO said had it all and this post is useless.
|
|
| Top |
|
 |
|
Faceless_Soldier
|
Post subject: Posted: Sat Jul 05, 2008 5:56 pm |
|
Joined: Mon Jun 30, 2008 9:07 pm Posts: 7
|
|
Ah yes... It works just as I intended it to now!
I had a feeling it might have something to do with the critical state of logon, however I didn't know how to call a program, only a function.
Thanks for the help!
|
|
| Top |
|
 |
|
Faceless_Soldier
|
Post subject: Posted: Tue Jul 08, 2008 7:41 am |
|
Joined: Mon Jun 30, 2008 9:07 pm Posts: 7
|
So Ive got most of this gump worked out, it takes a start location (via radio boxes), then you navigate through the pages to choose a race. Once you have chosen a race, it reads a configuration file and modifies your character accordingly, as well as moving you to your specified town.
An observation, when setting the radio group, anything prior to it will be displayed as if it were background (although its page 1). It should be declared after the page is declared. If it said this somewhere I didn't read it
A couple of minor hicups, not related to gumps but still this system so Ill post them in here, don't need another thread.
A.
One part of the AssignRace() function is for particular races it changes the hair layer to a specific mask (ie. undead, bonehelm etc) and deletes the beard. Oddly, I cannot seem to change (hair.graphic) to the orcmask, it remains as short hair for some reason. I've tried both orc masks, even the one that is assigned to the actual orc mask in the game, which works... Any ideas?
[Note: I know I need to disable things like hair dye for orcs because I know some smartarse will dye his head blue]
B.
Not a huge problem at the moment, but I cannot seem to change to the elven body. For example, my elf race will be invisible (walking shorts!) when I set who.graphic to 430/431 (Elf M/F IDs)... I actually haven't investigated this yet, I suspect it has something to do with enabling the ML expansion? Just thought Id mention it in case someone else has already encountered this obstacle.
I think there was more, but I don't remember now... I'll add it in if I comes back!
|
|
| Top |
|
 |
|
OldnGrey
|
Post subject: Posted: Tue Jul 08, 2008 4:38 pm |
|
Joined: Sat Feb 04, 2006 6:26 pm Posts: 561
|
|
A note on radio groups in gumps.
Different client versions handle it better than others.
Hopefully you have a v5 client. In that you seem to be able to have multiple radio groups on different pages.
The v4 and below seem to have more limitations - one is that the older clients handle less gump data before they simply display nothing.
|
|
| Top |
|
 |
|
Faceless_Soldier
|
Post subject: Posted: Wed Jul 09, 2008 8:08 am |
|
Joined: Mon Jun 30, 2008 9:07 pm Posts: 7
|
|
Ok well:
A. The orc mask problem was an error on my part, an error that I overlooked (over and over again).
B. My UO is patched to the latest version, however I am using a different modified client (4.0.0c) through injection. This is why there is a elf art problem. The 4.0.0c client is too old.
When I'm using the default 6.0.6.2 client I receive an 'Undefined message type 36' and 'Unexpected message message type 36' ... I'm not entirely sure what this means... My race script also crashes, however I can see my elves body... Is this an encryption issue?
Any suggestions appreciated. I think my current options are to either stay with the 4.0.0c client and ditch the elven bodies (not preferred) or to work out why my 6.0.6.2 client is not working, I would like to use the newer artwork. Thanks for your time.
|
|
| Top |
|
 |
|
OldnGrey
|
Post subject: Posted: Wed Jul 09, 2008 3:58 pm |
|
Joined: Sat Feb 04, 2006 6:26 pm Posts: 561
|
|
I suggest you get and use the 5.0.9.1 client.
It's the last of the v5 clients and to me seems to be pretty good.
I stopped trying to make my shard v6 compliant when they started breaking things.
|
|
| Top |
|
 |
|
Faceless_Soldier
|
Post subject: Posted: Thu Jul 10, 2008 8:18 pm |
|
Joined: Mon Jun 30, 2008 9:07 pm Posts: 7
|
|
I removed my UO, then grabbed a fresh copy of 'Eighth Age' and patched it upto 5.0.9.1(Patch 46). I had to move my 'GFSetRadioGroup' back to the end of the page (before the radio buttons) because it was giving me an empty page. Everything seems to run fine, however on odd occasions I get an error 'unidentified packet 0xbf'(I think thats what it was). I got that twice while making about 12 different character... It didn't seem to affect anything...(Note that was using No_Crypt - UO RICE, also Note: All I did was create, open paperdoll, run to an inn and log off)
Could using a modified Hues.mul be a factor? (ZH Hues file)
---
Ok next question.
Like I said before, I got my inspiration for this from ZuluHotel. So I've decided that I will make two systems in the one package. RACES_CLASSIC, which will be the classic ZH system with racegates etc. and RACES_ADV which will be with my races which is sent via a gump and specific races have different mobile.graphic and 'masks' assigned to hair etc. Both systems work fine.
The theory --
The way ive done it is logon.src/reconnect.src will run raceSelection script if !who.cmdlevel (Staff don't have a race). raceSeletion.src will check race_Core.inc which contains CONST that ive used as switches.
if(who.title_race)
if(RACES_CLASSIC && !RACES_ADV)
...classic stuff, send to racegate area etc.
elseif(!RACES_CLASSIC && RACES_ADV)
...sends the player the race gump and to the town they select from it.
else
...Error message (either both are enabled, or neither are - and the pkg should be disabled)
else
if(!RACES_CLASSIC && !RACES_ADV)
Has a race and neither system is enabled, runs RemoveRace.
endif
endif
etc.
I'm not really sure I am supposed to use CONSTants for that sort of role, however, I don't think the system should be changed without a recompile. Is this the right way to do it? I know with scripting theres a wrong way, the right way and the righter way.
Thanks for your time.
|
|
| Top |
|
 |
|
Page 1 of 1
|
[ 11 posts ] |
|
Who is online |
Users browsing this forum: No registered users and 0 guests |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum
|
|