Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 04-10-2006, 02:05 AM
colin012 colin012 is offline
That never happened...
colin012's Avatar
Join Date: Feb 2006
Location: Under your bed.....
Posts: 321
colin012 is on a distinguished road
How do i do warping scripts?

I think its a npc. like when you go in a door or hit a certent spot you go to another level you made? What npc do i use and what is the scripting for it?
__________________
Dude! It's a skirt...
Quote:
Originally Posted by Elizabeth View Post
Good lord it looks potent...
Reply With Quote
  #2  
Old 04-10-2006, 02:15 AM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
Well, on a level, use the warps. All you have to do is highlight an area (or know it's x+y) and hit the Blue arrow button to set the warp info. for an NPC you would use setlevel2("newlevelname",playerx,playery) (in GS@, for online scripts) or setlevel2 newlevelname,playerx,playery; actually enter info in for playerx and y like 13, 31 etc
Reply With Quote
  #3  
Old 04-10-2006, 02:25 AM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
As excaliber said, for level warps, you want to use links.

1) Select area of level where you want a Link.
2) Push the blue arrow (See attachment 1).
3) Input link info in window that pops up (See attachment 2).
4) Push OK.
3) Tada! Your link is done. You can also edit links by pushing the button next to the blue arrow.
Attached Thumbnails
Click image for larger version

Name:	example1.png
Views:	160
Size:	23.0 KB
ID:	36022   Click image for larger version

Name:	example2.png
Views:	154
Size:	7.1 KB
ID:	36023  
__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.
Reply With Quote
  #4  
Old 04-10-2006, 03:29 AM
colin012 colin012 is offline
That never happened...
colin012's Avatar
Join Date: Feb 2006
Location: Under your bed.....
Posts: 321
colin012 is on a distinguished road
Quote:
As excaliber said, for level warps, you want to use links.

1) Select area of level where you want a Link.
2) Push the blue arrow (See attachment 1).
3) Input link info in window that pops up (See attachment 2).
4) Push OK.
3) Tada! Your link is done. You can also edit links by pushing the button next to the blue arrow.
Wow this helps alot! I have something else to ask. How do you make an passable object unpassable? I made this one spar with a viewer and lava. But the player can swim up the lava water falls. I will atach it in this message.
Attached Files
File Type: nw hnd-fire-spar.nw (9.7 KB, 140 views)
__________________
Dude! It's a skirt...
Quote:
Originally Posted by Elizabeth View Post
Good lord it looks potent...

Last edited by colin012; 04-10-2006 at 03:32 AM.. Reason: I forgot to put my level in it.
Reply With Quote
  #5  
Old 04-10-2006, 03:35 AM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
Quote:
Originally Posted by colin012
How do you make an passable object unpassable? I made this one spar with a viewer and lava. But the player can swim up the lava water falls. I will atach it in this message.
You can't. You will either have to use tiles are are blocking, or find images to replace those waterfalls with.
__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.
Reply With Quote
  #6  
Old 04-10-2006, 03:54 AM
colin012 colin012 is offline
That never happened...
colin012's Avatar
Join Date: Feb 2006
Location: Under your bed.....
Posts: 321
colin012 is on a distinguished road
Quote:
You can't. You will either have to use tiles are are blocking, or find images to replace those waterfalls with.
This is kinda off topic but how do you add images? Also do you know how i can get the lave falls that realy fall and are anamated?
__________________
Dude! It's a skirt...
Quote:
Originally Posted by Elizabeth View Post
Good lord it looks potent...
Reply With Quote
  #7  
Old 04-10-2006, 03:57 AM
Andy0687 Andy0687 is offline
Enigma
Join Date: Feb 2002
Posts: 1,072
Andy0687 is on a distinguished road
Quote:
Originally Posted by colin012
Wow this helps alot! I have something else to ask. How do you make an passable object unpassable? I made this one spar with a viewer and lava. But the player can swim up the lava water falls. I will atach it in this message.
Use setshape to put an npc over the falls you want to block
NPC Code:

if (created) {
setshape 1,322,110;
}



Ive attached the level so you can see it in action
Attached Files
File Type: nw hnd-fire-spar.nw (9.8 KB, 128 views)
Reply With Quote
  #8  
Old 04-10-2006, 04:18 AM
colin012 colin012 is offline
That never happened...
colin012's Avatar
Join Date: Feb 2006
Location: Under your bed.....
Posts: 321
colin012 is on a distinguished road
Quote:
Use setshape to put an npc over the falls you want to block
Sweet thanks!. Whats the npc code for starting a spar?
__________________
Dude! It's a skirt...
Quote:
Originally Posted by Elizabeth View Post
Good lord it looks potent...
Reply With Quote
  #9  
Old 04-10-2006, 06:20 AM
Andy0687 Andy0687 is offline
Enigma
Join Date: Feb 2002
Posts: 1,072
Andy0687 is on a distinguished road
Quote:
Originally Posted by colin012
Sweet thanks!. Whats the npc code for starting a spar?
Sorry I dont quite understand what you mean.
Starting the spar by laying a bomb? Or what.

You could set an npc where you want and use playerchats, and putbomb.
Not very hard but i attached the level so you can see if that was what you needed. Commented so you will see what it does.
Attached Files
File Type: nw hnd-fire-spar.nw (10.0 KB, 162 views)
Reply With Quote
  #10  
Old 04-10-2006, 02:51 PM
colin012 colin012 is offline
That never happened...
colin012's Avatar
Join Date: Feb 2006
Location: Under your bed.....
Posts: 321
colin012 is on a distinguished road
Quote:
Sorry I dont quite understand what you mean.
Starting the spar by laying a bomb? Or what.
Kind of. but you can't fight befor you say start and it doesn't add to your deaths.

And whats the npc code for a healing thing?
__________________
Dude! It's a skirt...
Quote:
Originally Posted by Elizabeth View Post
Good lord it looks potent...
Reply With Quote
  #11  
Old 04-10-2006, 04:03 PM
Omini Omini is offline
Millenium Owner
Join Date: Feb 2006
Location: N.Ireland
Posts: 293
Omini is on a distinguished road
Send a message via AIM to Omini Send a message via MSN to Omini Send a message via Yahoo to Omini
An easier method for the setshape bit would be

NPC Code:

setshape 1,16*x,16*y;



Replace the x with the amount of Graal tiles horizontal and the y with the amount of Graal tiles vertical, this stops you having to calculate the amount of pixels since each Graal tile is 16x16 pixels.
Reply With Quote
  #12  
Old 04-10-2006, 09:14 PM
Bl0nkt Bl0nkt is offline
Era Developer
Bl0nkt's Avatar
Join Date: Mar 2005
Location: Pennsylvania
Posts: 1,589
Bl0nkt will become famous soon enough
Send a message via AIM to Bl0nkt
Quote:
Originally Posted by colin012
Kind of. but you can't fight befor you say start and it doesn't add to your deaths.

And whats the npc code for a healing thing?
Depends on the system. Classic worlds use playerhearts (I think).

example:

NPC Code:
if (playertouchsme)
playerhearts++;



When the player touches the NPC, their hearts increase by one (++).

NPC Code:
playerhearts+=1;
playerhearts=playerhearts+1;



These would also do the same.

In a lot of systems, though, it uses custom HP that use client/clientr strings.

Example:

NPC Code:
if (playertouchsme)
setstring clientr.hp,strtofloat(#v(clientr.hp))+1;



At least I think that's what it is. Haven't done GS1 in a while.
Reply With Quote
  #13  
Old 04-11-2006, 10:19 AM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
Quote:
Originally Posted by Bl0nkt
Example:

NPC Code:
if (playertouchsme)
setstring clientr.hp,strtofloat(#v(clientr.hp))+1;



At least I think that's what it is. Haven't done GS1 in a while.

Example of why old script is evil .

Should be:
NPC Code:
setstring clientr.hp,#v(strtofloat(#s(clientr.hp)) + 1);



Not your fault. Old gscript's fault.
__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.
Reply With Quote
  #14  
Old 04-11-2006, 05:41 PM
Andy0687 Andy0687 is offline
Enigma
Join Date: Feb 2002
Posts: 1,072
Andy0687 is on a distinguished road
Quote:
Originally Posted by Omini
An easier method for the setshape bit would be
Hadnt really thought of doing that for some reason. Sounds like that could be a good plan but make sure that the x or y is greater then one tile otherwise you might have trouble grabbing the npc in the level editor again :P

Quote:
Kind of. but you can't fight befor you say start and it doesn't add to your deaths.
all you put in an npc to make it a "sparringzone" is just that
NPC Code:

sparringzone



It appears its still picky in editor what you have there, and Ive always done it that way online also.

And you want it not to start before you say fight? Now you are getting into bigger scripts, you wanna check where the players are at, and have their weapons disabled first!

NPC Code:

if (playerenters) {
disableweapons;
}



Next we need to expand the playerchats block to make sure only people inside the spar zone can say "start" and then anyone in the block, enable their weapons.

NPC Code:

if (playerx in |21,42| && playery in |25,40|) {
...
}


NPC Code:

for (i=0;i<playerscount;i++) {
if (playerx in |21,42| && playery in |25,40|) {
enableweapons;
}
}



All its doing is checking the |start,end| and seeing if your x and y are in those numbers, if you are in the sparring zone, you should be in them. Otherwise you cant start the spar, or get your weapons enabled.

Of course youll need to combine this with everything else, to make a complete script, go ahead and check the level. The healer is in there too.

Hope you are learning something
Attached Files
File Type: nw hnd-fire-spar.nw (10.8 KB, 132 views)
Reply With Quote
  #15  
Old 04-12-2006, 12:09 AM
Prozac Prozac is offline
one of the good guys
Prozac's Avatar
Join Date: Jan 2006
Posts: 245
Prozac is on a distinguished road
Send a message via AIM to Prozac
i just have to say how wonderful it is to see people actually helping new players learn things. Has Lance been removed as a moderator? Or have the scripting forums rules changed? Keep up the good work, its great to see the open sharing of basic code principles come back to this part of the forums again.
Reply With Quote
Reply


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 10:35 PM.


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