Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   canwarp problem :/ (https://forums.graalonline.com/forums/showthread.php?t=52053)

-Ramirez- 03-31-2004 06:06 PM

canwarp problem :/
 
Canwarp is an evil command for me. No matter what I do, it absolutely WILL NOT let this NPC warp to a new level on its own. I have tried canwarp2 as well, but according to the documentation about the two, that's not what I need here.

I'm not doing this on a gmap... just two test levels linked together the standard way.

I've looked at all of the old threads regarding the use of this command... and it seems that nobody else was really helped either. What is it with this command? :P

GoZelda 03-31-2004 06:14 PM

serverside/clientside problems?

-Ramirez- 03-31-2004 06:22 PM

Quote:

Originally posted by GoZelda
serverside/clientside problems?
If you're asking me whether I did it serverside or clientside... serverside, obviously. ;)

If not... rephrase your question for me.

Loriel 03-31-2004 06:23 PM

Local NPCs cannot do it, you know? Either putnpc2 ones or DB ones.

-Ramirez- 03-31-2004 06:24 PM

Quote:

Originally posted by Loriel
Local NPCs cannot do it, you know? Either putnpc2 ones or DB ones.
Yes, I know. It's a database NPC.

DarkShadows_Legend 04-01-2004 03:39 AM

Onwall detection could probably be the problem if you have some in there.

-Ramirez- 04-01-2004 04:26 AM

Quote:

Originally posted by DarkShadows_Legend
Onwall detection could probably be the problem if you have some in there.
Nope. I did it on a completely blank NPC. Nothing but the canwarp stuff, setshape, and the script to move it.

Andy0687 04-01-2004 06:17 AM

Quote:

Originally posted by -Ramirez-

Nope. I did it on a completely blank NPC. Nothing but the canwarp stuff, setshape, and the script to move it.

NPC Code:

if (created) {
canwarp;
}
if (playerchats) {
if (strequals(#a,Andy0687)) {
if (startswith(warp,#c)) {
tokenize #c;
warpto #t(1),strtofloat(#t(2)),strtofloat(#t(3));
}
}
}



Made a quick test, i see no problems.

-Ramirez- 04-01-2004 07:40 AM

Quote:

Originally posted by Andy0687
NPC Code:
warpto #t(1),strtofloat(#t(2)),strtofloat(#t(3));


......*****
Canwarp isn't for the warpto command.

Andy0687 04-01-2004 08:21 PM

Quote:

Originally posted by -Ramirez-

......*****
Canwarp isn't for the warpto command.

I was told it was, needed canwarp in order to warpto other levels in that case nevermind :cool:

GoZelda 04-01-2004 08:39 PM

Canwarp means that the NPC will be warped to a level if he steps on a link, correct?

Duwul 04-02-2004 06:03 AM

It means the NPC can pass through level lines.

Loriel 04-02-2004 02:56 PM

canwarp makes the NPC behave like a player regarding links, canwarp2 makes it cross levels on the overworld.

R0bin 04-02-2004 03:05 PM

whats wrong with just doing


canwarp;

seeing if it works, ifnot

canwarp2;

and if neither does what you want, post here?

-Ramirez- 04-03-2004 02:54 AM

Quote:

Originally posted by R0bin
and if neither does what you want, post here?
Which is what I have done.

--Edit--
I did some experimenting and discovered how to get it working... although it's very strange...

In my tests, I've had a link at the top of the level with the dimensions 64x1. A friend suggested that I try moving it away from the top... so I did. I moved the link slightly above the NPC. At first, the NPC moved over the link, but as soon as the bottom of the NPC was on top of the link, it finally decided to warp. I tried different setshapes to see if the bottom was what makes it warp... and all of my tests suggest that's how it works. That's extremely stupid if you ask me. Large NPCs can't warp, if the warp is at the edge of the level, unless you change their shape accordingly.

Dach 04-03-2004 07:37 AM

I'll bet you ten bucks it was meant for levels connected with a map (then the npc wouldn't be blocked at the top of the level like that, unless you put something in the onwall detection that wouldn't let it work at all... but that's cheating!)

-Ramirez- 04-03-2004 08:00 AM

Quote:

Originally posted by Dach
I'll bet you ten bucks it was meant for levels connected with a map
Maybe... but that wouldn't explain why it would do that for moving into a house or something like that.

Quote:

unless you put something in the onwall detection that wouldn't let it work at all...
There is no wall checking in this script, as I stated earlier. :P

Dach 04-03-2004 08:26 AM

Quote:

Originally posted by -Ramirez-

Maybe... but that wouldn't explain why it would do that for moving into a house or something like that.

thats what canwarp2 is for, silly!

Quote:


There is no wall checking in this script, as I stated earlier. :P

ah, don't mind that then, I was just covering up my tracks :o

Oh yeah, it was made with the original intent for use in npc characters correct? So I guess that good 'ol Stefie figured that would be the most logical place to put the warp detecter. Makes it somewhat tricky in places, but I can't think of an easier way to do it.

-Ramirez- 04-03-2004 08:48 AM

Quote:

Originally posted by Dach
thats what canwarp2 is for, silly!
Documentation says otherwise.
Quote:

canwarp is for npcs which already know the way
and want to be warped exactly like a player
(good when you use the waytracker item for
recording a way for police npcs or so);
canwarp2 is for overworld npcs which move
randomly, so this is using the normal links
and check for onwall on the destination level,
it also doesn't let the npc go into small
links (houses)
Going by that, it would seem that canwarp; should allow warping on ANY link, regardless of size.

Quote:

Originally posted by Dach
Oh yeah, it was made with the original intent for use in npc characters correct? So I guess that good 'ol Stefie figured that would be the most logical place to put the warp detecter. Makes it somewhat tricky in places, but I can't think of an easier way to do it.
I have no clue what it was intended for. You never know with Stefan. :P

I just hope all of these problems I run into are fixed in 3.1. Well... 3.1 is supposed to have link detection. I'll just make my own damn canwarp if the built-in one still sucks.

Riot 04-03-2004 08:37 PM

I am having no problems with canwarp, its going into other overworld levels and houses as I please...

-Ramirez- 04-04-2004 01:28 AM

Quote:

Originally posted by Riot
I am having no problems with canwarp, its going into other overworld levels and houses as I please...
What's the size of the NPC you're using? Did you use setshape? Which canwarp are you using?


All times are GMT +2. The time now is 06:09 AM.

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