Login

russian armor

Lua Scripting for Vehicles getting Stuck in mud

27 Jun 2016, 17:08 PM
#1
avatar of Von_Smedman

Posts: 108

Hi I need help with some coding,

My Idea is that a Vehicle moves in to a Top_layer in this case mud, it will have a chance of either damage its engine or excuses pipe.

Track vehicle like tanks and halftrack would have a less chance of getting stuck then a wheeled vehicle such as jeep or kubelwagen.

So a wheeled vehicle would have a 30% chance of getting damage to its excuses pipe

Halftracks and light and medium tanks would have a 20% of getting a overloaded engine

Heavy tanks would get a 35% chance of engine break down in the mud.

1. So in the code I need the following , to Identifier top_layer texture and make it react to vehicles entering such areas on the map where the above would happen.

2. I need a % calculator to calculate the % chance of vehicles and tanks getting stuck in the mud and it would run randomly between ever 2-5 min to contest Vehicle, driving around in the mud.

So this is the coding I am trying to made.

I need your help and Ideas to how to make such a code..

So right now I have chosen the Kubelwagen as a test vehicles.
-----------------------------------------------------------------------------------------------
function OnInitID()

-- [[ Markers ]]

-- [[ Squad Groups ]]
--When entering mud layer top layer Vehicle will get a random chance off damage engine or excurse


_top_layer=true

--Germans Forces
= If
_kubelwagen_type_82_mp ={ability = kubelwagen_type82_mp, isvehicle=true}

= Then

import random
if random.randint(0,100) < 36:
do_stuff(_disable_vehicles=true)


-- [[ Entity Groups ]]

end


Please help me with some ideas off what I am doing wrong.

best regards Von_Smedman


0 user is browsing this thread:

SHOUT IT OUT!

No ProfanityNumber of ShoutsRefresh Shout Box
Lady Xenarra: Ah, the gren faust-replacing-rifles bug/exploit. :ph34r:
Today, 18:24 PM
aerafield: CoH3 high elo is truly the dumbest CoH experience that ever existed
Today, 17:25 PM
aerafield: @OKSpitfire tbh I find it quite challenging to get the Pershing in time, having to suffer through the CoH3 tickrate and this endless bullshit meta of massive blobs going back and forth to the forward heal truck
Today, 17:24 PM
OKSpitfire: Well... going to be seeing the Pershing a lot for a little while, that thing is a monster.
Today, 11:44 AM
NigelBallsworth: axis stuff is getting more meme by the second
Yesterday, 23:32 PM
aerafield: Cloaked instapin MGs at 0cp. I wanna see no more crying about the Dingo while that shit is in the game :snfPeter:
Yesterday, 20:38 PM
Willy Pete: And only on annihilation, and I have to let the AI live long enough...
Yesterday, 02:04 AM
Willy Pete: Pershing is absurd, but ive still only gotten to use it against AI
Yesterday, 02:03 AM
Lady Xenarra: WTB Pershing for Axis, that is all :lolol:
Last Thursday, 13:32 PM
donofsandiego: :clap:
Last Thursday, 02:34 AM
donofsandiego: Return of the chatGPT writing prompt. Lets see how shinasukac responds to these questions utilizing the Socratic Method. Maybe he will give us an interesting look into his opinions
Last Thursday, 02:34 AM
Willy Pete: I havent even seen a pershing yet. Coh3 games still move too fast for it lol
Last Thursday, 00:30 AM
shinasukac: kingtiger=kingjoker
Last Wednesday, 16:27 PM
Lady Xenarra: Has anyone actually used the KT much? My experience is that the match is usually over long before I get the CPs for it
Last Wednesday, 14:35 PM
Rosbone: Can someone message me the day you can look at Coh3 and not face palm yourself in disbelief that actual humans worked on it? Much appreciated.
Last Wednesday, 06:40 AM
Rosbone: The only way to feel good about Coh3 is to never look at Coh3. Once you see it, you cant unsee it.
Last Wednesday, 06:37 AM
Rosbone: Observer mode sucks, player stats pages are scatter brained mess, etc etc etc
Last Wednesday, 06:35 AM
Rosbone: It is really hard to tell people to buy the DLC with feeling like they are throwing their money down the toilet for a nearly dead game. But Big Tonks!!! Oh well, not my problem.
Last Tuesday, 18:12 PM
Rosbone: No 4v4 maps, busted menus 2 years after release, still have not fixed janky sounds people have complained about for over 2 years, etc etc.
Last Tuesday, 18:10 PM
Rosbone: And the skirmish menus are still at a BETA level. Just the largest game play mode completely ignored... again.
Last Tuesday, 18:09 PM

Ladders Top 10

  • #
    Steam Alias
    W
    L
    %
    Streak
Data provided by Relic Relic Entertainment

Replay highlight

VS
  • U.S. Forces flag cblanco ★
  • The British Forces flag 보드카 중대
  • Oberkommando West flag VonManteuffel
  • Ostheer flag Heartless Jäger
uploaded by XXxxHeartlessxxXX

Board Info

704 users are online: 704 guests
3 posts in the last 24h
23 posts in the last week
55 posts in the last month
Registered members: 52120
Welcome our newest member, shafbartn48
Most online: 2043 users on 29 Oct 2023, 01:04 AM