Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 12-28-2001, 10:33 PM
Mortur Mortur is offline
Registered User
Join Date: Dec 2001
Location: USA, Utah
Posts: 5
Mortur is on a distinguished road
Send a message via ICQ to Mortur Send a message via AIM to Mortur
Post Q weapons list replacement

I am trying to make a new menuing system for a playerworld that is comming up.. and i have run into a snag, i cannot find any threads on it either, i wouldnt know where to look.

i am trying to create a list of items in a sub-menu similar to how the layout of the original Q list works, images getting cut off on the bottom, but stil showing at least a little bit. i know how to get the rest of it done, but its the image cutting off that is giving me a hard time, can anyone help with maybe either a sample script or some commands that would work?

thank you, i would post what i have so far, except i am too afraid they would get stolen and put on other playerworlds.

Thanks in advance!

Mortur
__________________
Fear is the path that leads to the dark side, Fear leads to Anger, Anger leads to Hate, Hate - leads to Suffering...
Reply With Quote
  #2  
Old 12-28-2001, 10:35 PM
Androk2k1 Androk2k1 is offline
Banned
Androk2k1's Avatar
Join Date: Dec 2001
Posts: 1,336
Androk2k1 is on a distinguished road
Andor has same thing their NAts might help
Reply With Quote
  #3  
Old 12-28-2001, 10:35 PM
grim_squeaker_x grim_squeaker_x is offline
Retired Oldbie
grim_squeaker_x's Avatar
Join Date: Mar 2001
Posts: 3,084
grim_squeaker_x will become famous soon enough
You could be able to use changeimgpart, although there's no way of finding out the height and width of an image, so you'd probably have to make all of them the same size.
__________________

Reply With Quote
  #4  
Old 12-28-2001, 10:37 PM
Mortur Mortur is offline
Registered User
Join Date: Dec 2001
Location: USA, Utah
Posts: 5
Mortur is on a distinguished road
Send a message via ICQ to Mortur Send a message via AIM to Mortur
Thats what i was afraid of.. making them all the same size... either that or just do a text scroll.. and showing the image on the side... when the cursor comes on it...
__________________
Fear is the path that leads to the dark side, Fear leads to Anger, Anger leads to Hate, Hate - leads to Suffering...
Reply With Quote
  #5  
Old 12-28-2001, 10:55 PM
kittygirl765 kittygirl765 is offline
tapatapatapa
kittygirl765's Avatar
Join Date: Dec 2001
Location: Caught in a tree
Posts: 70
kittygirl765 is on a distinguished road
Send a message via ICQ to kittygirl765
Quote:
Originally posted by Androk2k1
Andor has same thing their NAts might help
*cough* *cough* all of Andor's NATs quit *cough* *cough*
__________________
I <3 UN
I <3 Shadow Strip Entertainment City Shangri-La
I <3 gscript2
Reply With Quote
  #6  
Old 12-29-2001, 06:24 AM
LiquidIce00 LiquidIce00 is offline
RadioActive Monkeeh
LiquidIce00's Avatar
Join Date: Apr 2001
Location: dirty south
Posts: 2,112
LiquidIce00 is on a distinguished road
Send a message via ICQ to LiquidIce00 Send a message via AIM to LiquidIce00 Send a message via Yahoo to LiquidIce00
Here is an example for a custom one .. if you want to make the bags (like sub menus ill xplain after the script)

NPC Code:

// NPC made by LiquidIce - PM MY RC plz
timeout=.05;
if (playerenters&&!isweapon) {
toweapons -Backpack;
}
if (isweapon) { disableselectweapons; }
if (timeout&&isweapon) {
this.timer=(this.timer+1)%3;
if (keydown(9)&&this.timer=2) {
if (this.inmenu=1) {
hideimg();
this.inmenu=0;
}
else { this.inmenu=1; }
}
if (this.inmenu=1) { disabledefmovement;
if (this.timer=2) {
checkkey();
}
draw();
}
}

function draw() {
//gain weapons count w/o hidden weapons
this.count=0;
for (this.i=0;this.i<weaponscount;this.i++) {
if (!startswith(-,#w(this.i))) { this.count++; }
}
//player has no weapons. shut down
if (this.count=0) { setplayerprop #c,You have no weapons; this.inmenu=0;hideimg(); return;}
//check if the current weapon is the first non hidden
this.notfirst=0;
for (this.i=0;this.i<selectedweapon;this.i++) {
if (!startswith(-,#w(this.i))) { this.notfirst=1 }
}
if (selectedweapon>0&&this.notfirst=1) { showimg 100,@<,screenwidth/2-20,screenheight/2; }
else { hideimg 100; }
showimg 101,#W,screenwidth/2,screenheight/2;
showimg 102,@#w,screenwidth/2-strtofloat(#v(strlen(#w)))*2,screenheight/2-30;

if (selectedweapon<this.count) {
showimg 103,@>,screenwidth/2+40,screenheight/2;
}
else { hideimg 103; }
for (this.i=0;this.i<4;this.i++) { changeimgvis this.i+100,4; }
}

function hideimg() {
for (this.i=0;this.i<4;this.i++) { hideimg this.i+100; }
enabledefmovement;
}

if (playerhurt&&this.inmenu=1) {
this.inmenu=0;
hideimg();
}
function checkkey() {
if (keydown(1)) {
//find index of before non hidden weapon
for (this.i=selectedweapon-1;this.i>-1;this.i--) {
if (!startswith(-,#w(this.i))) { selectedweapon=this.i; return;}
}
play nextpage.wav;
}
if (keydown(3)) { selectedweapon+=1; play nextpage.wav; }
}



thats like a custom weapon inv.

if u want the bag its simple .. you would do like

NPC Code:

if (playertouchsme) {
toweapons Tools/Hammer;
}


that would make a bag called Tools with a weapon called Hammer in it .. but when you use stuff like if (hasweapon(Tools/Hammer)) make sure to include the subdir..
ok have fun (btw my weapon system doesnt work with sub dirs .. i should make something like it ..I would but im not going to use it so I would just waste my time .. ;P)
__________________
LiquidIce *Owner* (UnholyNation)
-UN Website
http://www.unholynation.com
-UN Forum
http://forums.unholynation.com
-
-the thinker
-

-
onwall2 for nonp2p (i suck at onwall)
Reply With Quote
  #7  
Old 12-31-2001, 12:21 AM
kyle0654 kyle0654 is offline
-. .`
kyle0654's Avatar
Join Date: Mar 2001
Posts: 1,000
kyle0654 will become famous soon enough
Your problem probably isn't that images are getting cut off, but that they're all drawing on the same layer. Try using a lower layer for the background of the menu and higher layers for the weapon images.

(by layers I mean using changeimgvis of course)
Reply With Quote
  #8  
Old 12-31-2001, 02:01 AM
Mortur Mortur is offline
Registered User
Join Date: Dec 2001
Location: USA, Utah
Posts: 5
Mortur is on a distinguished road
Send a message via ICQ to Mortur Send a message via AIM to Mortur
The problem is that i WANT them to get cut off at a certin point... just like the Q menu...

but i dont think it can be done....

not at least without some super major scripting....

i could do it, but is it worth it? i dont know.

I think i will stick with another idea, and have it with text and have the icon of the weapon apear on the side of it.
__________________
Fear is the path that leads to the dark side, Fear leads to Anger, Anger leads to Hate, Hate - leads to Suffering...
Reply With Quote
  #9  
Old 12-31-2001, 05:03 AM
BocoC BocoC is offline
Registered User
BocoC's Avatar
Join Date: Jun 2001
Location: Washington State, USA
Posts: 980
BocoC is on a distinguished road
Send a message via AIM to BocoC Send a message via Yahoo to BocoC
You CAN'T make a custom Q menu like the current one. There is no way to get the width and height of the NPC Image. You CAN however make the NPC's cut off. Just loop through each weapon and if it is below or above a certain point, find how much it extends out and use changeimgpart to correct it.
__________________
-Boco

FLKJH$TRFG*$(&%>FMG >REN<>F ;.kjsd
Reply With Quote
  #10  
Old 12-31-2001, 02:27 PM
LiquidIce00 LiquidIce00 is offline
RadioActive Monkeeh
LiquidIce00's Avatar
Join Date: Apr 2001
Location: dirty south
Posts: 2,112
LiquidIce00 is on a distinguished road
Send a message via ICQ to LiquidIce00 Send a message via AIM to LiquidIce00 Send a message via Yahoo to LiquidIce00
Quote:
Originally posted by BocoC
You CAN'T make a custom Q menu like the current one. There is no way to get the width and height of the NPC Image. You CAN however make the NPC's cut off. Just loop through each weapon and if it is below or above a certain point, find how much it extends out and use changeimgpart to correct it.
he can make all the img's the same width and height. that be a pain if he has alot of npc's already w/ imgs and needs to change all of them though ..
__________________
LiquidIce *Owner* (UnholyNation)
-UN Website
http://www.unholynation.com
-UN Forum
http://forums.unholynation.com
-
-the thinker
-

-
onwall2 for nonp2p (i suck at onwall)
Reply With Quote
  #11  
Old 12-31-2001, 04:55 PM
LordMatt LordMatt is offline
V Avatar
LordMatt's Avatar
Join Date: Jun 2001
Location: Texas
Posts: 954
LordMatt is on a distinguished road
Send a message via AIM to LordMatt
Quote:
Originally posted by kittygirl765


*cough* *cough* all of Andor's NATs quit *cough* *cough*
you were the only nat and nat cheif and you quit for unknown reasons now we're stuck with a person who rarely comes on and listens.
__________________
-Matt
Reply With Quote
  #12  
Old 12-31-2001, 11:04 PM
Mortur Mortur is offline
Registered User
Join Date: Dec 2001
Location: USA, Utah
Posts: 5
Mortur is on a distinguished road
Send a message via ICQ to Mortur Send a message via AIM to Mortur
Post

There is away to do it with a 2 layer menu, and the menu items apear between sandwiched and can only be seen through the hole in the upper one. but i think that would be too buggy, and i dont believe anyone has tried that before, so i am not going to waste my time on making it and find out it lags like crazy.

Thanks for all the help everyone!
__________________
Fear is the path that leads to the dark side, Fear leads to Anger, Anger leads to Hate, Hate - leads to Suffering...
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 10:45 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.