![]() |
Need Simple Help!
Ok Well, I'm not that good at scripting -_- I was wondering how you would script like a... NPC When you walk under it it goes clear so you can see your self then sets back. i know this is probably a simple seteffect but im just asking for help =)
|
PHP Code:
Works in theory, didnt test it. |
Hm, Cant Seem To Get It To Work.
Does The Img Height,Width go: this.imgheight = #;HERE OR this.imgheight = #HERE; |
Uh. Change # to the value of i.e. the imgage height. (Say its a block.png, then change both the imgheight and imgwidth value to 32).
|
hm, ok now i understand
|
What Im Using Is The Following, Maybe It Doesnt Work Because Im In Editor Mode? Maybe It's Because Im Missing Something.
//#CLIENTSIDE function onCreated() { setImg( "block.png"); this.imgwidth = 32; this.imgheight = 32; drawoverplayer(); dontblock(); setTimer( .05); } function onTimeOut() { if (player.x in |x, x + (this.imgwidth/32)| && player.y in |y, y + (this.imgheight/32)|) { setcoloreffect( 1, 1, 1, .4); } else setcoloreffect( 1, 1, 1, 1); setTimer( .05); } |
Quote:
|
Quote:
Thanks. |
you could also do: this.imagewidth = getImgWidth("filename"); (might be able to use this.image instead of filename, but I'm not sure)
|
Ah, THATS why imgwidth() never worked for me in GS2, its supposed to be getImgWidth()! :D
|
Quote:
^^ Something he doesnt know! :p |
Bored, might aswell improve it with getImgWidth/Height:
PHP Code:
|
Thanks, Ziro :o
|
what is up with the space you put between the opening parenthesis and the first parameter? x_x It's really ugly IMO. If you're going to do that, atleast put a space between the last parameter and the closing parenthesis.
Also, I forgot about this before, but because you are setting the image of the NPC you can use the 'this.width' and 'this.height' variables to get the width/height instead of using getImgWidth()/getImgHeight() |
:o
|
Quote:
|
Quote:
|
Quote:
imgwidth(imagename) will work, imgwidth("imgname") won't. |
Quote:
|
| All times are GMT +2. The time now is 08:33 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.