View previous topic :: View next topic |
Author |
Message |
Raekuul Delicious!

Joined: 31 Mar 2004 Posts: 641 Location: Nowhere
|
Posted: Thu Nov 09, 2006 4:35 pm Post subject: Contrary to popular belief, I'm NOT dead! |
|
|
Modified
Code: | include,plotscr.hsd
include,colora.hsi
definescript(autonumber,writeEL,none)
definescript(1,afterbattlescript,none)
globalvariable(1,eventlocation)
#-- this first script is supposed to set the global "event location"
#-- to one tile above the hero.
script,writeEL,begin
#-- declare variable "hero y - 1"
variable(heroy-1)
#-- check current event location
readglobal(eventlocation)
#-- now check our location
heroy(me)
#-- check to see if hero is at top of map
if (heroy(me) >=1), then, begin
heroy-1:=(heroy(me)--1))
writeglobal(1,heroy--1)
end
end |
_________________ A broken clock is still right twice a day.
Last edited by Raekuul on Mon Mar 17, 2008 10:34 am; edited 4 times in total |
|
Back to top |
|
 |
Moogle1 Scourge of the Seas Halloween 2006 Creativity Winner


Joined: 15 Jul 2004 Posts: 3377 Location: Seattle, WA
|
Posted: Thu Nov 09, 2006 4:39 pm Post subject: |
|
|
You don't need to declare globals if you never refer to them by name. In other words, you could change this to this Code: | readglobal(eventlocation) | if you uncommented the global variable declaration. _________________
|
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Thu Nov 09, 2006 9:36 pm Post subject: |
|
|
In addition,
Code: | #-- check current event location
readglobal(1)
#-- now check our location
heroy(me)
|
This does nothing. What is the intent?
Code: | heroy-1:=(heroy(me)-1)) |
I think you have an extra closing parenthesis here? Also, write -- 1 instead of -1
Code: | heroy-1 := heroy(me) -- 1 |
_________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
Raekuul Delicious!

Joined: 31 Mar 2004 Posts: 641 Location: Nowhere
|
Posted: Mon Mar 17, 2008 10:37 am Post subject: |
|
|
Code edited (finally), but I think I screwed it up again. _________________ A broken clock is still right twice a day. |
|
Back to top |
|
 |
Moogle1 Scourge of the Seas Halloween 2006 Creativity Winner


Joined: 15 Jul 2004 Posts: 3377 Location: Seattle, WA
|
Posted: Mon Mar 17, 2008 12:50 pm Post subject: |
|
|
Yeah.
I'm not sure what you're trying to do, but readglobal(whatever) doesn't do anything. You'd have to use the value. For example, you might say something like--
set hero stat(who, stat:hp, read global(whatever))
--which would set some hero's HP to the value in global #whatever. _________________
|
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Mon Mar 17, 2008 2:20 pm Post subject: |
|
|
????
Code: | include, plotscr.hsd
include, colora.hsi
globalvariable(1,eventlocation)
#-- this first script is supposed to set the global "event location"
#-- to one tile above the hero.
plotscript, writeEL, begin
#-- check to see if hero is at top of map
if (heroy(me) >= 1) then, begin
eventlocation := heroy(me) -- 1
end
end |
_________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
|