- This topic has 3 replies, 2 voices, and was last updated 4 years, 1 month ago by BorgDog.
-
AuthorPosts
-
March 6, 2020 at 3:22 am #165949
Hi,
I have a little problem with my skillshot-routine. There are 3 targets, one of them is lit. Hitting this one first leads to an award.
All targets drop after any target is hit:
for my 3 targets the code looks like this:
Sub TargetSkill1_Hit()
stopsound “Drum Roll”
if lightPrim1.state=1 then
awardskillshot
else
skillshotmiss
end if
End Sub
My subs “skillmiss” and “awardskillshot” drop all targets and also set them all collidable=false
Sub skillshotmiss() Targetskill1.isdropped=true:Targetskill2.isdropped=true:Targetskill3.isdropped=true   Targetskill1.collidable=false:Targetskill2.collidable=false:Targetskill3.collidable=false
               other lights, videos, things
End Sub
Sub AwardSkillshot()      Targetskill1.isdropped=true:Targetskill2.isdropped=true:Targetskill3.isdropped=true   Targetskill1.collidable=false:Targetskill2.collidable=false:Targetskill3.collidable=false
other lights, videos and things
End Sub
Well, it happens regularly that both actions take place, those in “skillmiss” AND those in “awardskillshot”.
The Targets are relatively (maybe 40-50 vpx-units) close to each other; it seems like its possible to hit two targets exactly at the same time?
Is my system too slow? Are the targets too slow?
I also sometimes have strange effects with my “rotatelanelights”:
Sub RotateLaneLightsLeft()
Dim wave
wave = l1.State
l1.state = l2.State
l2.State = l3.State
l3.State = l4.State
l4.State = wave
End Sub
Sub RotateLaneLightsRight()
Dim wave
wave = l4.State
l4.state = l3.State
l3.State = l2.State
l2.State = l1.State
l1.State = wave
End Sub
Sometimes l3 stays lit (or unlit) all the time, although not all lights are lit altready. There is no other code doing anything to the lights except:
sub kickerleft_hit()
kickerleft.kick 0,55:Timerkickerleft.enabled=true:playsound “yahoo”
PuPlayer.playlistplayex pBackglass,”videoballsaved”,””,0,1
l1.state=0:l2.state=0:l3.state=0:l4.state=0:light_kickback.state=0
kickerleft.enabled=false
end sub
sub Timerkickerleft_timer() ‘*** sets l1 in the kickerlane back to off after ball is kicked back
timerkickerleft.enabled=false:l1.state=0
end sub
arent both “problems” somewhat strange?
Any ideas? Thanks!!
You need to login in order to like this post: click here
March 8, 2020 at 11:12 am #166323Are these targets using VP drop target objects or walls or something else?
The reason I ask is that the drop targets have two seperate events, a dt_hit and a dt_dropped. in almost all cases it is much better to use the _dropped for things like this. the _hit event happens when the ball hits the target, the _dropped event happens when the animation is complete, ie when the target is all the way down.
Also I’m pretty sure your .collideable statements are redundant for most things as when object.isdropped=true then it is not collideable.
not sure on the l3 staying lit, what you have should work, but it could maybe get confused with rapid left-right direction calls. does it act weird if you just go one direction?
You need to login in order to like this post: click here
1 user thanked author for this post.
March 9, 2020 at 4:54 am #166447Thanks BorgDog, I know it was redundant to drop the targets AND set them colibale=false – that was my reaction on things going wrong. With collidable command being faster, I initially thought this was the better way to use for the skillshot to prevent two actions being triggered at the same time. But I will try out dropped-function only, if that is your suggestion. Right now I have just made the targets halfway smaller (they are invisible anyway cause you aim at primitives…), which made it happen less frequently, but with the consequence you might „hit“ the edge of a primitive (they are not collidable cause they will drop below the playfiled after the skillshot (see #160606  ) and think you should have been awarded but in fact you just missed the invisible target. Again not satisfactory…
For the rotatelanelights – it happened to be strange both ways. I tend to believe it was a corrupt USB-stick…!?! (although I did not use it to load tables from it). I threw it away now with this thing getting more slowly every time i wrote a file on it. Is it possible a defective USB-stick can have caused this??
At the same time I deleted some vpmtimer.addtimer calls. Could this have been the cause???
Anyway, since both actions I did not notice it again. I will have an eye on it…
You need to login in order to like this post: click here
March 9, 2020 at 7:25 am #166452I wouldn’t think the usb nor the vpmtimer would cause the issues
i’m pretty sure I’ve only used the _dropped since it was added some time back, just less glitches.
You need to login in order to like this post: click here
-
AuthorPosts
Forums are currently locked.