View previous topic :: View next topic |
Author |
Message |
cavemanerick

Joined: 03 Aug 2008 Posts: 74
|
Posted: Thu Jul 23, 2009 1:07 pm Post subject: Set battle on tile location |
|
|
Well i really hate to keep coming abck and asking for help because i feel like i'm leaching off you guys but i do need help again grrr...
I need a simple script that allows a battle to show up or whatever commands i want in there when a player named michael steps on a certain part of the map. I tried useing the scripts they have in archieves and such but none of them worked this is what i have so far see if you can help thanks.
Code: |
If(check tag(tag:celler)==off) then (
If ((hero X (hero:michael))==67 and (hero Y (hero:michael))==20)
then (suspend player
show textbox(63)
fight formation(52)
resume player
set tag(tag:celler,on)
)))
end
|
Last edited by cavemanerick on Thu Jul 23, 2009 3:24 pm; edited 1 time in total |
|
Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Thu Jul 23, 2009 1:51 pm Post subject: |
|
|
Code: |
If(check tag(tag:celler)==off) then (
If ((hero X (rank in caterpillar(hero:michael)))==67 and (hero Y (rank in caterpillar((hero:michael)))==20)
then (suspend player
show textbox(63)
fight formation(52)
resume player
set tag(tag:celler,off)
)))
end
|
I think the problem here is that you are using a hero ID "hero:michael" when the "hero X" and "hero Y" commands expect a hero's position in the walkabout party. Use "rank in caterpillar" to get that.
Although, a much easier way to make a script run when the hero steps on a specific spot is to trigger the script using an invisible step-on NPC |
|
Back to top |
|
 |
cavemanerick

Joined: 03 Aug 2008 Posts: 74
|
Posted: Thu Jul 23, 2009 3:25 pm Post subject: |
|
|
Well i figured that but i was trying to save either scripts, or npcs by trying this out, but ehh i guess i'l resort to that still just trying to get as much time working with diffrent ways to do stuff with plot scripting as possible. Since i'm rusty with programming in general. |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Fri Jul 31, 2009 1:23 am Post subject: Re: Set battle on tile location |
|
|
cavemanerick wrote: | Code: |
If(check tag(tag:celler)==off) then (
If ((hero X (hero:michael))==67 and (hero Y (hero:michael))==20)
then (suspend player
show textbox(63)
fight formation(52)
resume player
set tag(tag:celler,on)
)))
end
|
|
As well as too many closing brackets, there's another mistake in that script: you forgot to put commas around 'and'. HSpeak won't mention what the problem is because of a bug, but that script fragment should not compile. _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
Spoon Weaver

Joined: 18 Nov 2008 Posts: 421 Location: @home
|
Posted: Fri Jul 31, 2009 6:52 am Post subject: Re: Set battle on tile location |
|
|
Code: |
If (check tag(tag:celler)==off)
then (
If ( (hero X (hero:michael)==67) ,and , (hero Y (hero:michael)==20) )
then (
suspend player
show textbox(63)
fight formation(52)
resume player
set tag(tag:celler,on)
)
)
|
went ahead and fixed that for you. You seemed to have bracket/comma issuses in the line
If ( (hero X (hero:michael)==67) ,and , (hero Y (hero:michael)==20) )
I wasn't sure about the ending, because this isn't a full script, so I removed the parts that didn't effect this script part directly.
Also, as mentioned, the variables used for tags and/or hero might also be at fault.
Other then those things, I don't see why this wouldn't work.
I have a question about it though. Is it suppose to trigger when the character steps on the tile. Like, if he was 3rd in caterpillar mode, it would trigger when HE stepped on it? Because, that's most likely possible, but would take other steps to achieve. |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Sat Aug 01, 2009 4:04 pm Post subject: |
|
|
Oh, and one more thing: You probably want to add 'plot:wait for text box' after showtextbox, otherwise you won't be able to read it until after the battle. _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
|