Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Something that might be difficult... o.o (https://forums.graalonline.com/forums/showthread.php?t=20079)

PlasmaDestroyer 01-01-2002 07:58 AM

Something that might be difficult... o.o
 
Ok, I think you know that the Hat Change Item makes you able to choose a hat out of a list of variables and shows that hat on the screen. How difficult would it be to do that with something other than hats, say a Morphing NPC that let's you select what you want to morph into. If I had the Hat Trading Script, maybe it wouldn't be so hard! =P

LiquidIce00 01-01-2002 01:53 PM

Re: Something that might be difficult... o.o
 
Quote:

Originally posted by PlasmaDestroyer
Ok, I think you know that the Hat Change Item makes you able to choose a hat out of a list of variables and shows that hat on the screen. How difficult would it be to do that with something other than hats, say a Morphing NPC that let's you select what you want to morph into. If I had the Hat Trading Script, maybe it wouldn't be so hard! =P
not that hard actually ..

LiquidIce00 01-01-2002 02:11 PM

maybe this can help

NPC Code:

// NPC made by LiquidIce for some guy in the forum
this.numbers={0,3,4,1,673,203};
if (playerenters) {
toweapons Morpher;
}
if (playerhurt) {
setplayerprop #c,ouch!;
quit();
}
if (weaponfired&&this.on=0) {
disabledefmovement;
this.on=1;
this.pos=0;
timeout=.05;
}
if (timeout) {
this.count=(this.count+1)%3;
if (this.count=0) {
if (keydown(1)) {
this.pos-=1;
play nextpage.wav;
if (this.pos<0) { this.pos=arraylen(this.numbers)-1; }
}
if (keydown(3)) {
play nextpage.wav;
this.pos=(this.pos+1)%arraylen(this.numbers);
}
if (keydown(5)) { this.on=0; }
}
this.current=this.numbers[this.pos];
showimg();
if (this.on=1) { timeout=.05; }
else { quit(); }
}

function quit() {
hideimg 200;
enabledefmovement;
this.on=0;
}

function showimg() {
//here u can put whatever u want as img
//for example if u have hat2093.png and u want the 2093
// to come out of the array then u would put
// hat#v(this.current).png .. ok?
showimg 200,shadoworb.gif,screenwidth/2,screenheight/2;
changeimgvis 200,4;
}



All times are GMT +2. The time now is 11:59 PM.

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