So, I want a script to trigger when the hero steps on this certain invisible NPC script trigger point. However, the hero will be riding a vehicle. I tested it out, but no go. I can't trigger the script.
How can I trigger the script while riding the vehicle? Also, is it possible to move the hero with Walk Hero commands while he is on the vehicle?
Master K wrote:
So, I want a script to trigger when the hero steps on this certain invisible NPC script trigger point. However, the hero will be riding a vehicle. I tested it out, but no go. I can't trigger the script.
How can I trigger the script while riding the vehicle? Also, is it possible to move the hero with Walk Hero commands while he is on the vehicle?
How can I trigger the script while riding the vehicle? Also, is it possible to move the hero with Walk Hero commands while he is on the vehicle?
NPCs can't be activated in the normal ways when you are riding on a vehicle. Maybe the ability to do that should be added.
For now, I think the easiest way would be to put an "each step" script on the map, and have it do something special by checking the hero's X and Y position.
Code:
plotscript, each step example, begin
if(hero X(me) == 37 && hero Y(me) == 72) then(
trigger some other script
)
end
plotscript, each step example, begin
if(hero X(me) == 37 && hero Y(me) == 72) then(
trigger some other script
)
end
As for your other question, yes, you can move a vehicle with "walk hero" while the hero is riding it. (if you want to move the vehicle when the hero is NOT riding it, you have to use "walk NPC")
Thank you James. But now, how do I configure it to go off if a certain tag is off, and the hero stepped on that spot? You see, this script triggers a script that has the hero fight a Hydra. Here is the way I edited it:
It compiles, but won't work.
Code:
plotscript, hydra trigger, begin
if (check tag(tag:Hydra Attack == OFF) and
hero X(me) == 45 && hero Y(me) == 89) then(
hydra attack
)
end
if (check tag(tag:Hydra Attack == OFF) and
hero X(me) == 45 && hero Y(me) == 89) then(
hydra attack
)
end
It compiles, but won't work.
I think the problem is having two "and"s in a row like that. If you have 3 conditions that you need to check, I think it needs to be:
I don't really know for certain though.
I am Srime
Code:
if ( (check tag (tag:Hydra Attack == OFF)) and
(hero X(me) == 45 && hero Y(me) == 89) ) then(
(hero X(me) == 45 && hero Y(me) == 89) ) then(
I don't really know for certain though.
I am Srime
Code:
plotscript, hydra trigger, begin
if (check tag(tag:Hydra Attack == OFF) and
hero X(me) == 45 && hero Y(me) == 89) then(
hydra attack
)
end
if (check tag(tag:Hydra Attack == OFF) and
hero X(me) == 45 && hero Y(me) == 89) then(
hydra attack
)
end
Read the code again. The problem is in the "check tag" command. You wrote:
Code:
check tag(tag:Hydra Attack == OFF)
When you meant to write:
Code:
check tag(tag:Hydra Attack) == OFF
Also, this isn't related to your problem, but I strongly suggest using "&&" instead of "and"
"and" still works for backwards compatibility, but unless you are trying to do bitwise binary operations, && is always better.
The same goes for "||" which is better than using "or"
@msw188: two or more && in the same condition does work fine. (two or more "and" works too, but "&&" is still better)



