Pepsi Ranger Reality TV Host

Joined: 05 Feb 2003 Posts: 493 Location: South Florida
|
Posted: Wed Aug 20, 2008 4:59 pm Post subject: Strange Happenings |
|
|
This post is more for the developers, but anyone who can figure this out deserves a cookie.
I'm trying to figure out why these scripts are misaligning my NPC.
Initial script triggered at the stage entrance:
Code: | script,Squatter Automations,begin
variable (d)
variable (m)
variable (y)
set variable (d,hero direction (0))
set variable (m,current map)
set variable (y,hero y (0))
if (m==68) then(
if (y==60) then(
if (d==north) then(
set timer (4,1,10,@swamp bath)
))
if (y==61) then(
if (d==south) then(
stop timer (4)
))
)
if (m<>68) then(
stop timer (4)
)
end |
Script triggered when NPC stands at the right edge of the swamp shore facing west (or is standing in the swamp ready to exit to the east).
Code: | script,swamp bath,begin
variable (x,y,d,m,hx,hy)
set variable (x,npc x (3))
set variable (y,npc y (3))
set variable (d,npc direction (3))
set variable (hx,hero x (0))
set variable (hy,hero y (0))
if (x==49) then(
if ((y==13),or,(y==14),or,(y==15)) then(
if (d==west) then(
suspend npcs
suspend npc walls
if
(((hx>=38),and,(hy>=8)),and,((hx<=50),and,(hy>=8)),and,((hx>=38),and,(hy<=20)),and,((hx<=50),and,(hy<=20))) then(
play sound (104,true)
)
walk npc to x (3,48)
npc animation (3,467)
wait for npc (3)
resume npc walls
alter npc (3,npcstat:movetype,0)
resume npcs
alter npc (3,npcstat:picture,466)
walk npc to x (3,47)
wait for npc (3)
alter npc (3,npcstat:movetype,1)
set timer (5,5,18,@hippie scrub)
)))
if (x==48) then(
if ((y==13),or,(y==14),or,(y==15)) then(
if (d==east) then(
suspend npcs
suspend npc walls
stop timer (5)
walk npc to x (3,49)
npc animation (3,468)
wait for npc (3)
resume npc walls
alter npc (3,npcstat:movetype,0)
resume npcs
stop sound (104)
alter npc (3,npcstat:picture,454)
walk npc to x (3,50)
wait for npc (3)
walk npc to y (3,17)
wait for npc (3)
alter npc (3,npcstat:movetype,1)
)))
set variable (m,current map)
if (m==68) then(
set timer (4,1,10,@swamp bath)
)
if (m<>68) then(
stop timer (4)
)
end |
When NPC is already in the swamp and spends a moment scrubbing his back. I put the pound signs behind lines I experimented with to see if I could break this misaligning behavior (which obviously I didn't).
Code: | script,hippie scrub,begin
variable (d)
variable (m)
set variable (m,current map)
set variable (d,npc direction (3))
if (m==68) then(
if ((read npc (3,npcstat:picture))==466) then(
#suspend npcs
alter npc (3,npcstat:movetype,0)
#resume npcs
npc animation (3,469)
alter npc (3,npcstat:picture,466)
set npc direction (d)
alter npc (3,npcstat:movetype,1)
set timer (5,5,18,@hippie scrub)
)
if ((read npc (3,npcstat:picture))<>466) then(
stop timer (5)
)
)
end |
A basic argument-driven script I use for straightforward NPC animations.
Code: | script,npc animation,who,picture,begin
alter npc (who,npcstat:picture,picture)
set npc direction (who,north)
set npc frame (who,0)
wait (2)
set npc frame (who,1)
wait (2)
set npc direction (who,east)
set npc frame (who,0)
wait (2)
set npc frame (who,1)
wait (2)
set npc direction (who,south)
set npc frame (who,0)
wait (2)
set npc frame (who,1)
wait (2)
set npc direction (who,west)
set npc frame (who,0)
wait (2)
set npc frame (who,1)
wait (2)
end |
If anyone can tell me why my NPC is out of whack once he crosses that shore, and if there's a solution, I'd appreciate it. Thanks. _________________ Progress Report:
The Adventures of Powerstick Man: Extended Edition
Currently Updating: General sweep of the game world and dialogue boxes. Adding extended maps.
Tightfloss Maiden
Currently Updating: Chapter 2 |
|