i must be bad at scripting to be posting in help with scripts so much :I anyway i have a yeti sprite and a controlled charatcer, when you press space the character thrusts his sword and bright yellow action lines appear, the yeti is scripted to lose health when he touches this yellow. also the character can buy swords with different coloured action lines and different damages. ill try to make the scripts here
[scratchblocks]
when i recieve (broadcast)
forever
if <touching colour []>
change health by [-1]
wait [0.05] secs
end
if <touching colour []>
change health by [-1]
wait [0.05] secs
end
if <touching colour []>
change health by [-1]
wait [0.05] secs
end
if <touching colour []>
change health by [-1]
wait [0.05] secs
end
end
Offline
XXtitaniumfangXX wrote:
i must be bad at scripting to be posting in help with scripts so much :I anyway i have a yeti sprite and a controlled charatcer, when you press space the character thrusts his sword and bright yellow action lines appear, the yeti is scripted to lose health when he touches this yellow. also the character can buy swords with different coloured action lines and different damages. ill try to make the scripts here
when i recieve (broadcast) forever if <touching colour []> change health by [-1] wait [0.05] secs end if <touching colour []> change health by [-1] wait [0.05] secs end if <touching colour []> change health by [-1] wait [0.05] secs end if <touching colour []> change health by [-1] wait [0.05] secs end end[/quote]
when i recieve (broadcast) forever if <touching colour []> change health by [-1] wait [0.05] secs end if <touching colour []> change health by [-1] wait [0.05] secs end if <touching colour []> change health by [-1] wait [0.05] secs end if <touching colour []> change health by [-1] wait [0.05] secs end end
Offline
of course the colours and damages will be different
if it is essential i can upload the first 2 (buggy) levels
Offline
bump
someone hurry up and answer i cant figure this out and im not moving on in the game until this level is flawless >
Offline
oh of course no1s answering i didnt post the problem *slaps self*
anyway now i have new scripts that work better. but they still sometimes glitch out and even when im not attacking his health keeps dropping for a while, then stops
[scratchblocks]
when i recieve [begin mountains]
repeat until <(distance to [character] < [0.0001]
if <touching colour []>
change health by [-1]
wait [0.05] secs
end
if <touching colour []>
change health by [-1]
wait [0.05] secs
end
if <touching colour []>
change health by [-1]
wait [0.05] secs
end
if <touching colour []>
change health by [-1]
wait [0.05] secs
end
if <touching colour []>
change health by [-1]
wait [0.05] secs
end
end
Offline
when I receive "begin mountains"
repeat until ((distance to s[your] ) < "0.0001")
if (touching color c[FFFF00]?)
change "health" by -1
wait 0.05 secs
end
if (touching color c[66004C]?)
change "health" by -3.5
wait 0.05 secs
end
if (touching color c[CCD9FF]?)
change "health" by -5
wait 0.05 secs
end
if (touching color c[001966]?)
change "health" by -50
wait 0.05 secs
end
end
Offline
when I receive "begin mountains"
repeat until ((distance to s[your] ) < "0.0001")
if (touching color c[FFFF00]?)
change "health" by -1
wait 0.05 secs
if (touching color c[66004C]?)
change "health" by -3.5
wait 0.05 secs
if (touching color c[CCD9FF]?)
change "health" by -5
wait 0.05 secs
if (touching color c[001966]?)
change "health" by -50
wait 0.05 secs
end
Offline
ok that didnt work ill upload my first level if anyone wants to help they can download it and see
Offline
First, lets fix your blocks.
It's nice how you have everything indented here.
when I receive [begin mountains v]
repeat until <(distance to [player v] ) < [0.0001]>//put whatever ends it here
if <touching color [#FFFF00]?> //weak sword
change [health v] by [-1]
wait [0.05] secs
end
if <touching color [#66004C]?> //medium sword
change [health v] by [-2]
wait [0.05] secs
end
if <touching color [#CCD9FF]?> //strong sword
change [health v] by [-3]
wait [0.05] secs
end
if <touching color [#001966]?> //powerful sword
change [health v] by [-4]
wait [0.05] secs
end
wait until <not<touching [sword v]?>> // this will make it only decrease once
end
Or you can do it sprite/costume-based instead of colors.
when I receive [begin mountains v]
repeat until <(distance to [player v] ) < [0.0001]>//put whatever ends it here
wait until <touching [sword v]?>
change [health v] by (()- ([costume# v] of [sword v]))
wait until <not<touching [sword v]?>> // this will make it only decrease once
end
Personally, I think this is easier. Just make the strong sword costume #4 and the weak sword #1
Last edited by thebriculator (2012-07-26 17:25:11)
Offline
thx u helped alot
Offline
Or you could just have
wait until <not <touching [sword v]?>>for only one sword.
Offline