Twinconclusive's scripting issues
Posted: Thu Feb 04, 2010 8:43 pm
After pressing the spacebar, the script 'Activation' is supposed to see if the hero is close enough to an NPC to activate it.
If the conditions are met, then the script 'Check' is run to toss out the result of such an interaction.
Right now, the loop compares the locations of the hero and NPC's 0-17.
[edit]The script actually doesn't display properly on the forums for some reason. Leaving the posted text version here in case it's actually relevant.

However, even when the conditions are met, the script doesn't seem to acknowledge it.

NPC 0 should be activated from the pixel x-coordinates of 810-850 and pixel y-coordinates of 1350-1390.
Any insight would be appreciated, thanks.
[edit]
Tried testing 'Activation' with a true statement in place of the huge 'if' condition, and the rest of the scripts worked fine.
So the issue is most probably in there.
[edit]
Tried changing the 'if' condition to:
Now it's always true 
Am thinking X<<Y<<Z doesn't mean what I think it means.
If the conditions are met, then the script 'Check' is run to toss out the result of such an interaction.
Right now, the loop compares the locations of the hero and NPC's 0-17.
[edit]The script actually doesn't display properly on the forums for some reason. Leaving the posted text version here in case it's actually relevant.

Code: Select all
script, Activation, begin
variable(counter)
for (counter, 0, 17, 1)
do(
if(
(hero pixel X (me) + 10) >> (npc pixel x (counter) -- 10) , and,
(hero pixel Y (me) + 10) >> (npc pixel y (counter) -- 10) , and,
(hero pixel X (me) + 10) <<npc>> (npc pixel y (counter) + 30)
)
then(
Check (counter, current map)
counter := 17
)
)
endCode: Select all
script, Check, npc, map, begin
if(map == 1)
then(
if(npc == 0)
then(
show text box (16)
wait for text box
)
)
end
NPC 0 should be activated from the pixel x-coordinates of 810-850 and pixel y-coordinates of 1350-1390.
Any insight would be appreciated, thanks.
[edit]
Tried testing 'Activation' with a true statement in place of the huge 'if' condition, and the rest of the scripts worked fine.
So the issue is most probably in there.
[edit]
Tried changing the 'if' condition to:
Code: Select all
if(
(npcpixelx(counter) -- 10) << (hero pixel X (me) + 10) << (npcpixelx(counter) + 30)
&&
(npcpixely(counter) -- 10) << (hero pixel Y (me) + 10) << (npcpixely(counter) + 30)
)Am thinking X<<Y<<Z doesn't mean what I think it means.
