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?
Plotscripts and Vehicles...
Moderators: Bob the Hamster, marionline, SDHawk
- Bob the Hamster
- Liquid Metal King Slime
- Posts: 7460
- Joined: Tue Oct 16, 2007 2:34 pm
- Location: Hamster Republic (Ontario Enclave)
- Contact:
Re: Plotscripts and Vehicles...
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.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?
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: Select all
plotscript, each step example, begin
if(hero X(me) == 37 && hero Y(me) == 72) then(
trigger some other script
)
end
- Master K
- King Slime
- Posts: 1899
- Joined: Sat Jun 11, 2011 9:40 pm
- Location: A windswept rock in the Atlantic Ocean
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: Select all
plotscript, hydra trigger, begin
if (check tag(tag:Hydra Attack == OFF) and
hero X(me) == 45 && hero Y(me) == 89) then(
hydra attack
)
end - Spoonweaver
- Liquid Metal King Slime
- Posts: 6247
- Joined: Mon Dec 08, 2008 7:07 am
- Location: Home
- Contact:
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.
Code: Select all
if ( (check tag (tag:Hydra Attack == OFF)) and
(hero X(me) == 45 && hero Y(me) == 89) ) then(I am Srime
- Bob the Hamster
- Liquid Metal King Slime
- Posts: 7460
- Joined: Tue Oct 16, 2007 2:34 pm
- Location: Hamster Republic (Ontario Enclave)
- Contact:
Code: Select all
plotscript, hydra trigger, begin
if (check tag(tag:Hydra Attack == OFF) and
hero X(me) == 45 && hero Y(me) == 89) then(
hydra attack
)
end Code: Select all
check tag(tag:Hydra Attack == OFF)Code: Select all
check tag(tag:Hydra Attack) == OFF"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)
Last edited by Bob the Hamster on Wed Aug 17, 2011 7:23 pm, edited 3 times in total.