Lua request : acceleration zone (for shoppa and techracer)
So,
what if we could have some zone that would act as acceleration zone like in construction mode you have an healing zone.
Imagine you play the last new shoppa map which present some acceleration zone at certain x;y;radius location
You go with your rope/flying saucer/or even walking and jumping, and when you are in this zone your speed rise !
I tried to code it myself, but ... i need someone to either help, either code it completly
I also wonder if it is better as map.lua (mission's map) or to add this in the Mask.png (would need to use one of the few remaining color in mask.png)
Anyway here is what i tried :
if (player ~= nil) then
if (gearIsInBox(player, 0, 0, 4000, 2048) then
SetGearVelocity(player, 150, 150)
end
end
not sure it is the correct function...
I placed it in ongametick ;
i know one of the problem might be the gear UID... currenthedgehog didnt work neither.
If you can and if you like the idea please contribute
Weee !!!
I Will make it for you m8
Let me do it :DDD
BUT !
My Only problem in this also ATM is Internet !!!
If i late and someone else make it before me, sorry, its doesn't easy to get it ;/
Hope can help you
╓──────────────────╖ ╓──────────────────╖
⠀HP: ██████████ 1E9/1E91E9/1E9 ██████████ :MP
╙──────────────────╜ ╙──────────────────╜
awesome !
No worry about the time
so, little update,
Nemo helped me and now it is working,
i still have some adjustemnt to do but it is in a good way, here it is in case you are interested :
include this at the beginning : HedgewarsScriptLoad("/Scripts/Utils.lua")
and then include this :
function onGameTick20()
if CurrentHedgehog ~= nil then
dx, dy = GetGearVelocity(CurrentHedgehog)
if (gearIsInBox(CurrentHedgehog, 1, 1, 4000, 2000)) then
SetGearVelocity(CurrentHedgehog, dx*2, dy*2) --ultra speed ! careful !
end
end
end
edit : result : http://i.imgur.com/o3x7Wvy.gifv
For the record, I did recommend adding ±10 to dx for a speed booster, not doubling speed every 20ms ☺
--
Oh, what the heck. 1PLXzL1CBUD1kdEWqMrwNUfGrGiirV1WpH <= tip a hedgewars dev
Oh... Grateful, its solved ^_^
I Have workin' on it for roughly 3-4 Hours (+more ?) yesterday
And have (almost) complete (at least) of your Great Idea !!!
[ Sleep Time : 2.30 - 3.00 AM ]
I Create a Function :
Accelzone(mode, AccelZoneID, x, y, circle, zoneradius, w, h, accelfollow, xacceleration, yacceleration, xpercentaccel, ypercentaccel, unlimitedstock, speedingstock, interval, effectvgt, opacity1, opacity2, frame, radius, tick, colour)
Which allow me to create Virtual Zone which can come in Square Area or Circle Area, Complete with its Radius...
We can customize how it will work.
How
Its visual gear as effect, colour, etc of its properties
Its Accelerating Power in Direct Number or in Percent, its Following angel, etc
Its also let us to "Limit" and "How" the hog effected will receive the effect, either its have boosting limit, or not, and its also compiled with Interval Rules, where a hog CAN ONLY Receive Speedup in every timer we set...
And some little more things inside
PS : Not just created, but can be Modified as well (use mode)
Even it still WIP
I See its worth it )
So, i think this Library, even wasn't used at all, still worthy to keep and continue :DDD
EDIT : [
To Sphrix :
If wanna write codes like you do for codes from nemo's help above...
You can use "[code*]" to open and "[/code*]" -Without Quotes ("") and Without * (For Example Purpose Only) to close the Codes Text Formatting in forum...
* Example :
which showing :
PS : Not trying to be something better, i just share. Nothing More )
Ok then, I hope that would help for future things ^^
╓──────────────────╖ ╓──────────────────╖
⠀HP: ██████████ 1E9/1E91E9/1E9 ██████████ :MP
╙──────────────────╜ ╙──────────────────╜
Hey !
Awesome man !
And thank for the advice on formatting on forum :p i think i tried to do ^^
So, how does one use your function ? it look awesome, it even draw the zone right ?
I hope you don't give up because it looks really good !
ps :
Nemo doesnt want to be held for responsible in case hedgehogs are thrown too fast into wall, he doesnt want to hurt them ! :p
so :
https://www.youtube.com/watch?v=dNp3E8zLL8I
Small video showing the acceleration zone and a visual zone to show where it is (note, the bright red cicle is not corresponding to the pink dot on the map, i should have deleted this dot and adjust the zone but...)
edit thank to : TheAnachron and to UltiMaxKom !