Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 03-13-2002, 09:46 AM
haunter haunter is offline
Registered User
haunter's Avatar
Join Date: Mar 2001
Posts: 7,989
haunter is on a distinguished road
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
if (playerenters) {setmap quest.png,quest.txt,playerx,playery;}
if (playerenters) {toweapons -questmap;

}
if (isweapon && startswith(#L, quest_)) {setmap quest.png,quest.txt,playerx,playery;
}
else if (isweapon) {setmap overworld.png,overworld.txt,playerx,playery;
}



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.
Reply With Quote
  #2  
Old 03-13-2002, 10:05 AM
darkriders_p2p darkriders_p2p is offline
Registered User
Join Date: Jan 2002
Location: Canada
Posts: 690
darkriders_p2p is on a distinguished road
not to sure if it matters but isn't it:
NPC Code:

if (isweapon && startswith(quest_,#L)) {
setmap quest.png,quest.txt,playerx,playery;
}

__________________
maximus_asinus
Reply With Quote
  #3  
Old 03-13-2002, 10:22 AM
happyme happyme is offline
Registered User
Join Date: Mar 2002
Location: Toronto, Ontario, Canada
Posts: 142
happyme is on a distinguished road
Send a message via AIM to happyme
Quote:
// NPC made by Shadowless Warrior
if (playerenters) {setmap quest.png,quest.txt,playerx,playery;}
if (playerenters) {toweapons -questmap;

}
if (isweapon && startswith(#L, quest_)) {setmap quest.png,quest.txt,playerx,playery;
}
else if (isweapon) {setmap overworld.png,overworld.txt,playerx,playery;
}
ehh... wouldnt it be simpler to put setmap quest.png,quest.txt,playerx,playery; in the quest lv and then on the first outside lv put
setmap overworld.png,overworld.txt,playerx,playery;
__________________
Reply With Quote
  #4  
Old 03-13-2002, 10:25 AM
haunter haunter is offline
Registered User
haunter's Avatar
Join Date: Mar 2001
Posts: 7,989
haunter is on a distinguished road
i tried

Quote:
Originally posted by happyme

ehh... wouldnt it be simpler to put setmap quest.png,quest.txt,playerx,playery; in the quest lv and then on the first outside lv put
setmap overworld.png,overworld.txt,playerx,playery;
i tried that, but it wouldn't work, i hadta put it in a weapon 0.o
Reply With Quote
  #5  
Old 03-13-2002, 03:39 PM
neomaximus2k neomaximus2k is offline
Registered User
Join Date: Feb 2002
Location: UK
Posts: 324
neomaximus2k is on a distinguished road
Send a message via ICQ to neomaximus2k
Re: i tried

Quote:
Originally posted by haunter


i tried that, but it wouldn't work, i hadta put it in a weapon 0.o
i had that prob with tiledefs but online they worked fine
__________________
Beware of thy Inner self
NPC Code:

_.,.__
((o\\o\))
.-. ` \\``
__( )___.o"".,___
=== ~~~~~~~~
==
= Neo

Reply With Quote
  #6  
Old 03-13-2002, 05:49 PM
konidias konidias is offline
Old Bee
konidias's Avatar
Join Date: Jul 2001
Location: Orlando, FL
Posts: 7,222
konidias will become famous soon enough
Send a message via AIM to konidias
Re: problem w/ setmap & startswith()

NPC Code:

if (playerenters) {
setmap quest.png,quest.txt,playerx,playery;
toweapons -questmap;
}
if (isweapon && startswith(quest_,#L)) {
setmap quest.png,quest.txt,playerx,playery;
}else if (isweapon && !startswith(quest_,#L)) {
setmap overworld.png,overworld.txt,playerx,playery;
}



"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.
__________________

Put this image in your sig if you support Bomy Island! (g2k1 revision)
play bomberman while you wait!


Reply With Quote
  #7  
Old 03-13-2002, 07:16 PM
cell424 cell424 is offline
Registered User
Join Date: Mar 2001
Location: USA/PA
Posts: 184
cell424 is on a distinguished road
Send a message via AIM to cell424
Talking

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;
}
__________________
Trunks
Reply With Quote
  #8  
Old 03-14-2002, 03:13 AM
haunter haunter is offline
Registered User
haunter's Avatar
Join Date: Mar 2001
Posts: 7,989
haunter is on a distinguished road
Re: Re: problem w/ setmap & startswith()

Quote:
Originally posted by konidias
NPC Code:

if (playerenters) {
setmap quest.png,quest.txt,playerx,playery;
toweapons -questmap;
}
if (isweapon && startswith(quest_,#L)) {
setmap quest.png,quest.txt,playerx,playery;
}else if (isweapon && !startswith(quest_,#L)) {
setmap overworld.png,overworld.txt,playerx,playery;
}



"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.
Thanks alot! That worked... I'm sure some of the other things the others suggested would've worked as well, thanks to them too...
Reply With Quote
  #9  
Old 03-14-2002, 02:06 PM
konidias konidias is offline
Old Bee
konidias's Avatar
Join Date: Jul 2001
Location: Orlando, FL
Posts: 7,222
konidias will become famous soon enough
Send a message via AIM to konidias
I love being good enough at scripting to have things work that I never actually tested once.
__________________

Put this image in your sig if you support Bomy Island! (g2k1 revision)
play bomberman while you wait!


Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 07:45 PM.


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