Castle Paradox
FAQ
Search
Memberlist
Usergroups
Register
Profile
Log in to check your private messages
Log in
Gamelist
Review List
Song List
All Journals
Site Stats
Search Gamelist
IRC Chat Room
Castle Paradox Forum Index
->
HELP!
Post a reply
Username
Who is the engine's mascot? *
Answer the Textual Confirmation question to prove you are not a spambot.
Subject
Message body
Emoticons
View more Emoticons
Font colour:
Default
Dark Red
Red
Orange
Brown
Yellow
Green
Olive
Cyan
Blue
Dark Blue
Indigo
Violet
White
Black
Font size:
Tiny
Small
Normal
Large
Huge
Close Tags
Options
HTML is
ON
BBCode
is
ON
Smilies are
ON
Disable HTML in this post
Disable BBCode in this post
Disable Smilies in this post
All times are GMT - 8 Hours
Jump to:
Select a forum
Castle Paradox
----------------
The Soapbox
The Arcade
Creative Corner
HELP!
Paradox Lounge
Site Suggestions
Topic review
Author
Message
TMC
Posted: Sat Jul 21, 2007 4:23 am
Post subject:
Oh, my mistake. After battle, the map is reloaded, and though tile data is reloaded, npc data is not.
So there's no need to use the new mapstate remembering features.
DukeofDellot
Posted: Fri Jul 20, 2007 3:32 pm
Post subject:
huh... I did not know that... I guess I've got more reading to do then.
Thanks, Cacti.
TMC
Posted: Fri Jul 20, 2007 4:17 am
Post subject: Re: Also something neat...
There's no reason to pass the NPC id number to your script: it is passed the npc reference automatically as the 2nd argument, so you can delete the right NPC. See '
Plotscripting Tutorial#Other Ways to Start a Script
'
Code:
Script, Tikar Battle, Dummy, Who, begin
alter NPC (who,NPCstat: activation, NPCactivation: use)
wait (2)
If (fight formation (random (0,3))
then (destroy NPC (who))
else (wait (50)
alter NPC (who,NPCstat: activation, NPCactivation: touch))
end
Also, realise that every time you fight a battle, the map is reloaded, so all deleted npcs come back. (Incidentally, this is because for the DOS versions there wasn't enough memory to keep the map loaded, but it could be changed now (according to an option))
If you're using a WIP, you can delete the NPCs as you are doing, set the map to remember NPCs, and reset the NPC data when you enter the map.
DukeofDellot
Posted: Thu Jul 19, 2007 7:56 pm
Post subject: oops...
Now there's a new bug, and I realize what happened... which is pretty funny. The destroy NPC command only targets the first copy of it... so... heh... you know, I just thought of that as I was typing. Either way, it was kind of funny that it took winning two fights to get the opponents to disappear. (Switching back from GML is messing with my head...)
And since I don't know the real answer to my problem... I'm going with "brute force" and making it say "Destroy NPC (who)" a number of times adjusted for the dungeon. In this case, the opening dungeon only needs two...
I guess if I wasn't so stubborn, I would switch over to tags... but... I'm a jerk like that...
In short, the script shown in my previous post does not allow the use of the same NPCs in different rooms of the map. Though if you do not use duplicate NPCs, it should still work fine.
EDIT: I take it back...
SHAZAM!!!
Code:
Script, Tikar Battle, Who, begin
alter NPC (who,NPCstat: activation, NPCactivation: use)
wait (2)
If ((fight formation (random (0,3)))==1)
then (while (NPC copy count (who)>>0)
do (destroy NPC (who))
else (wait (50)
alter NPC (who,NPCstat: activation, NPCactivation: touch))
end
I fixed it... heh... ... ... I really should wait and post at this point, shouldn't I?
Either way, the code I put here should produce the results I promised on my first post, including the ability to reuse NPCs under the conditions stated without it appearing to have them reused. ... ... ... I feel special now. Sorry about me being a little slow...
Moogle1
Posted: Thu Jul 19, 2007 4:16 pm
Post subject:
This is essentially what I did for Scary Game 2, except it wasn't as clean since the fight screen was a different map. You can choose to remember NPC states now, though, which would've solved that problem.
Out of curiosity, is there a plotscripting command to reset NPC states? There should be.
DukeofDellot
Posted: Thu Jul 19, 2007 3:53 pm
Post subject: Also something neat...
You know, it took me a while to figure this out, but you can also do this without tags. "Destroy NPC" only removes the NPC until the player uses a door, so I messed around with it a bit, and made a script that uses no tags, and keeps the NPC on the map if you run away from combat.
This is the exact script I'm using:
Code:
Script, Tikar Battle, Who, begin
alter NPC (who,NPCstat: activation, NPCactivation: use)
wait (2)
If ((fight formation (random (0,3)))==1)
then (destroy NPC (who))
else (wait (50)
alter NPC (who,NPCstat: activation, NPCactivation: touch))
end
A few things to note:
The variable "Who" is set in Custom.exe in the NPC options and should be the same as the NPC number.
Edit (this sentence was a mess):Because the NPCs are no longer "destroyed" when you use a door, the same few NPCs can be used multiple times in a dungeon. You just must make sure that seeing extra copies of an NPC requires the use of a door.
I'm going to be "customizing" the script for different enemy sets so that certain NPCs get battle formations determined by the party's levels, and others may have that second wait command shortened so that they seem to pursue the player a little more aggressively (in which case I will also make them switch between "stand still" and "follow player" in movement types).
Also, I think I've gotten rid of it by including the first "alter NPC" command and that little wait (2) at the beginning, but there was this really nasty bug for a while that caused the NPC to trigger and send the player into an infinite number of battles from time to time, but I think I've got it.
And, Camdog, I'd like to say that I had never thought to use the tags above 1000 in my scripts... I might have to keep that in mind for later.
NeoForce
Posted: Thu Jul 19, 2007 2:40 pm
Post subject: Thanks
Wow, very cool
Thanks everyonKeep your eyes out for my soon-to-be-released (Hopefully)!
Camdog
Posted: Thu Jul 19, 2007 5:56 am
Post subject:
Setting NPCs to "use only once" actually associates them with a tag that, when turned on, causes them to no longer appear. You can see the tag number in Custom.exe next to their usability setting in the edit NPC screen. (It will look something like "Usable only once (tag 1002)".)
Though this tag is assigned automatically by Custom, you can still manipulate like any other tag in a plotscript. In other words, all you have to do is call a script that resets all the "use only once tags" whenever you want to respawn enemies on a map. The easiest way to do this (assuming you want enemies on a map to respawn whenever a player leaves that map) is to set that script as that map's autorun script (which can be found in Edit Map Data -> Edit General Map Data). The script would look something like this:
Code:
script, respawn enemies in first cave, begin
set tag(1002, off)
set tag(1003, off)
set tag(1004, off)
#etc
end
Where those numbers are the tag numbers shown after the "use only once option" in custom.
AdrianX
Posted: Wed Jul 18, 2007 7:02 pm
Post subject:
..no,in Crescent Dream,i did NOT set the NPCs to be used only once.
..i assigned specific tags to them,and once activated by the hero,the assigned tag will be turned on.i made it so that they will appear only if their tag is off,so there.
..in the map autorun script for maps where there are ememies,i made it so that all the enemy-assigned tags will be turned off again so that they will again appear for you to fight.
..oh,and you can re-use the "enemy tags" in all the enemy - infested maps you have.
NeoForce
Posted: Wed Jul 18, 2007 6:33 pm
Post subject: Respawning Enemies
My game has the monsters walking around and when the player approaches them, the battle starts. Of course, their NPC's are set to "use only once", but once their defeated (Or ran away from), how can I get them to repsawn once the player has left the area and then came back. "Cresent Dream" also uses this battle system for anyone who needs an expampe. PLEASE HELP!
Powered by
phpBB
© 2001, 2005 phpBB Group