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
[quote="Bobert-Rob"]Okay, a new question. Lets say I have enemies (NPCs) on the map and they cause a fight to happen when you talk to them. They're in the way, you have to fight them. Well, once the battle is won, a script is called and the NPC is teleported to a position on the map where they can't be accessed by the hero anymore (1,1), effectively making them 'vanish'. My problem is I'm not sure of how to target the enemy NPC. One way of doing it is to use [b]NPC at spot[/b] and, depending on what way the hero is facing, the NPC right in front of the hero will be the one that vanishes. In fact, that's what I'm doing now, and it SORT OF works. But what if the enemy NPC is moving? If they're moving and you trigger the script, they're suddenly out of range. Or if the enemy NPC is pushable, they're now one space ahead. So I was wondering [b]if there was a way to target the NPC that calls the script from inside the script[/b]? That way, all I would have to do is reference whoever called the script and make that NPC disappear. Would this be possible, or am I just going to have to figure out some other method of doing this? The 'only once' setting on NPCs effect each one, not just the individual copy. Individual copy targeting would be key. ...almost makes one wish the 'only once' setting were an array so it could effect the individual copy.[/quote]
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: Fri Jun 18, 2010 8:24 pm
Post subject:
There is also a "delete NPC" command that sounds like it would be identical to moving the NPC off the screen, for your purposes.
And, I've come to realise that we really need to mention the script arguments
inside
Custom.
Bobert-Rob
Posted: Thu Jun 17, 2010 7:19 pm
Post subject:
Hey, that actually works! Glad it actually turned out to be pretty simple. I'll have to keep this in mind, thanks!
Rimudora
Posted: Tue Jun 15, 2010 6:37 pm
Post subject:
Whenever you have an npc run a script, it returns two variables. The first is something you can set inside custom through 'edit npcs...'. The second one is a reference to the npc that called the script. So you could do something like this:
Code:
plotscript, battle, var1, npcref, begin
battle(var1)
setnpcposition(npcref,1,1)
end
Bobert-Rob
Posted: Tue Jun 15, 2010 5:54 pm
Post subject: Targetting the NPC that calls the script
Okay, a new question. Lets say I have enemies (NPCs) on the map and they cause a fight to happen when you talk to them. They're in the way, you have to fight them. Well, once the battle is won, a script is called and the NPC is teleported to a position on the map where they can't be accessed by the hero anymore (1,1), effectively making them 'vanish'.
My problem is I'm not sure of how to target the enemy NPC. One way of doing it is to use
NPC at spot
and, depending on what way the hero is facing, the NPC right in front of the hero will be the one that vanishes. In fact, that's what I'm doing now, and it SORT OF works. But what if the enemy NPC is moving? If they're moving and you trigger the script, they're suddenly out of range. Or if the enemy NPC is pushable, they're now one space ahead.
So I was wondering
if there was a way to target the NPC that calls the script from inside the script
? That way, all I would have to do is reference whoever called the script and make that NPC disappear. Would this be possible, or am I just going to have to figure out some other method of doing this? The 'only once' setting on NPCs effect each one, not just the individual copy. Individual copy targeting would be key.
...almost makes one wish the 'only once' setting were an array so it could effect the individual copy.
Powered by
phpBB
© 2001, 2005 phpBB Group