Graal Forums  

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

Closed Thread
 
Thread Tools Search this Thread Display Modes
  #1  
Old 06-20-2004, 01:35 PM
Salaisuus Salaisuus is offline
Registered User
Join Date: Mar 2004
Posts: 68
Salaisuus is on a distinguished road
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
  #2  
Old 06-20-2004, 01:52 PM
dlang dlang is offline
Yoshi!
dlang's Avatar
Join Date: Oct 2002
Location: Houston, Texas
Posts: 406
dlang is on a distinguished road
Send a message via AIM to dlang Send a message via MSN to dlang
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?
__________________
Where do I take this pain of mine?
I run but it stays right by my side.
So tear me open, pour me out,
there's things inside that scream and shout.
And the pain still hates me, so hold me until it sleeps.

---------------
  #3  
Old 06-20-2004, 02:55 PM
Salaisuus Salaisuus is offline
Registered User
Join Date: Mar 2004
Posts: 68
Salaisuus is on a distinguished road
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.
  #4  
Old 06-20-2004, 03:04 PM
Salaisuus Salaisuus is offline
Registered User
Join Date: Mar 2004
Posts: 68
Salaisuus is on a distinguished road
Oh nevermind, solved.
Stupid me...
Just:
setimg pfft.gif; x=playerx; y=whatever;

  #5  
Old 06-20-2004, 03:15 PM
Salaisuus Salaisuus is offline
Registered User
Join Date: Mar 2004
Posts: 68
Salaisuus is on a distinguished road
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?
  #6  
Old 06-20-2004, 03:43 PM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
-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.
  #7  
Old 06-21-2004, 12:59 AM
Salaisuus Salaisuus is offline
Registered User
Join Date: Mar 2004
Posts: 68
Salaisuus is on a distinguished road
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.
  #8  
Old 06-21-2004, 01:04 AM
Xecutor Xecutor is offline
Former UN Manager
Join Date: Apr 2004
Posts: 117
Xecutor is on a distinguished road
Just use
NPC Code:
x = position;
y = position;


where position is a number.

Edit: or something which reflects a number.
  #9  
Old 06-21-2004, 01:30 AM
Salaisuus Salaisuus is offline
Registered User
Join Date: Mar 2004
Posts: 68
Salaisuus is on a distinguished road
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.
  #10  
Old 06-21-2004, 02:04 AM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
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.
  #11  
Old 06-21-2004, 03:28 AM
Salaisuus Salaisuus is offline
Registered User
Join Date: Mar 2004
Posts: 68
Salaisuus is on a distinguished road
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?

Last edited by Salaisuus; 06-21-2004 at 03:32 AM.. Reason: Typo
  #12  
Old 06-21-2004, 03:58 AM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
http://forums.graal2001.com/forums/s...ad.php?t=53241
Closed Thread


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 03:01 PM.


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