![]() |
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?
|
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
|
2 Attachment(s)
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. |
1 Attachment(s)
Quote:
|
Quote:
|
Quote:
|
1 Attachment(s)
Quote:
NPC Code: Ive attached the level so you can see it in action |
Quote:
|
1 Attachment(s)
Quote:
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. |
Quote:
And whats the npc code for a healing thing? |
An easier method for the setshape bit would be
NPC Code: 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. |
Quote:
example: NPC Code:if (playertouchsme) When the player touches the NPC, their hearts increase by one (++). NPC Code: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) At least I think that's what it is. Haven't done GS1 in a while. |
Quote:
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. |
1 Attachment(s)
Quote:
Quote:
NPC Code: 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: 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: NPC Code: 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 ^^ |
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.
|
| All times are GMT +2. The time now is 12:00 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.