![]() |
problem w/ setmap & startswith()
I'm having some trouble with this map code i made for a quest, i want the quest "complex" to have a map, but i don't want it to affect the main overworld map. here is what is have, the filenames are just examples
overworld.png & overworld.txt are the files for the overworld quest.png & quest.txt are the files for the quest complex. NPC Code:// NPC made by Shadowless Warrior When ever i try it, it sets the map to the overworld map... even when im in a level that the file name starts with "quest_". I hope someone can help. |
not to sure if it matters but isn't it:
NPC Code: |
Quote:
setmap overworld.png,overworld.txt,playerx,playery; |
i tried
Quote:
|
Re: i tried
Quote:
|
Re: problem w/ setmap & startswith()
NPC Code: "else if (isweapon && !startswith(quest_,#L)) {" You had it basically saying "If you have the weapon, set the map to overworld.png" that is why it kept setting to overworld.. you have to define that it only sets overworld.png when you have the weapon and the levels dont start with quest. You could simplify this by having something like "if (isweapon)" then have an "if startswith blahblah" here and then just have an else for it instead of having an else if !startswith blahblah" but what I posted should work fine lol. |
Here is what I did, in the system NPC of the server I made a mini system inside it. I only have 2 maps, the Mining Caves and the Overworld. SO this is what you do.
if (isweapon) { //Map Systems if (!startswith(quest_,#L)) { setmap quest.png,quest.txt,playerx,playery; } else setmap overworld.png,overworld.txt,playerx,playery; } |
Re: Re: problem w/ setmap & startswith()
Quote:
|
I love being good enough at scripting to have things work that I never actually tested once. :)
|
| All times are GMT +2. The time now is 05:33 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.