Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Realy simple setshape question (https://forums.graalonline.com/forums/showthread.php?t=53267)

Salaisuus 06-20-2004 01:35 PM

Realy simple setshape question
 
Uhm I dont know if Im too tired to think right now but isnt setshape supposed to
block movement on its area?

if (playersays(moo)){
setshape 1,32,32;
showimg 1,door.png,playerx,playery;
}

When I use that the door png wont block the player and it can walk right trough

dlang 06-20-2004 01:52 PM

A few things:
#1. Don't use playersays, instead use:
NPC Code:
if (playerchats && strequals(#c,moo))



#2. If you want it to block, use:
NPC Code:
if (created || playerenters) {
setimg door.png;
setshape 1,32,32;
}


Normaly, if you don't use setshape, it will be the shape of the image.
If you're making it to a shape of tiles, you can use setshape 1,2*16,2*16;
Where the 2's are the width and height in tiles. It is easier that way, if you're making it large that is.

#3. If you don't want it to block, use:
NPC Code:
if (created || playerenters) {
setimg door.png;
dontblock;
}



Did that help at all?

Salaisuus 06-20-2004 02:55 PM

Nope.
Its part of a bigger script.
I need to use showimg not setimg because I need it at specified x & y.

if (playersays(plah)) {

setimg whatever.png;

setshape 1,32,32;

}

That wont do because it will simply display at where ever the image is on the level.
So I need to use showimg but I need to make it block also.

Salaisuus 06-20-2004 03:04 PM

Oh nevermind, solved.
Stupid me...
Just:
setimg pfft.gif; x=playerx; y=whatever;

>_<

Salaisuus 06-20-2004 03:15 PM

I wonder tho...

if (playersays(moo)){
setshape 1,32,32;
showimg 1,door.png,playerx,playery;
}
if (playertouchsme) { destroy;}

Before I used this script.
Mostly I couldnt touch the door image, but sometimes it was destroyed when the player walked trough it.

So is it possiple to "touch" pictures displayed by showimg?

Lance 06-20-2004 03:43 PM

-Playersays is deprecated. That means don't use it.

-A showimg image is just a displayed image. A showimg image is _not_ an NPC that you can interact with.

Salaisuus 06-21-2004 12:59 AM

Guess I have to go back to my putnpc2 studies.
There has to be some bug in showimg tho, because sometimes it did react to touching, or maybe Im just insane.

Xecutor 06-21-2004 01:04 AM

Just use
NPC Code:
x = position;
y = position;


where position is a number.

Edit: or something which reflects a number.

Salaisuus 06-21-2004 01:30 AM

Yeaahh but dosent realy cut it for what I need it for.
I'll do it with putnpc2 when I learn to use it one of these days.

Lance 06-21-2004 02:04 AM

Quote:

Originally Posted by Salaisuus
Guess I have to go back to my putnpc2 studies.
There has to be some bug in showimg tho, because sometimes it did react to touching, or maybe Im just insane.

If you touched the actual NPC (the displayed image is irrelevant), of course it would react.

Salaisuus 06-21-2004 03:28 AM

No, it disapeared when I touched the image or so I believe.
I also believe that there are demons inside my computer and that they mess with my mind.

Anyhow does this look ok:

NPC Code:

if (playerchats && strequals(c#,moo)) {

triggeraction 0,0,serverside,#p(moomoo),v#(playerx,v#(playery);}

if (actionserverside && strequals(#p(0),moomoo)) {

putnpc2 playerx,playery,{

if (created) {setimg door.png;}

if (wa****) {destroy;}};
}



Thats how I would try it but I cant test it right now online,
and it probaply doesnt work anyway, sooo.... What did I do wrong?

Python523 06-21-2004 03:58 AM

http://forums.graal2001.com/forums/s...ad.php?t=53241


All times are GMT +2. The time now is 02:07 PM.

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