Forum

> > CS2D > General > Construction Related Settings
ForenübersichtCS2D-ÜbersichtGeneral-ÜbersichtEinloggen, um zu antworten

Englisch Construction Related Settings

12 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Construction Related Settings

Deas
User Off Offline

Zitieren
hi, can anyone list all Construction related settings?
such as building limit (already know this one thu)
how fast they build, ect

thank you!

alt Re: Construction Related Settings

Happy Camper
User Off Offline

Zitieren
Ok, here's a list. I have probably missed some, though.

mp_building_health
mp_building_limit
mp_building_price
mp_dispenser_health
mp_dispenser_money
mp_killbuildingmoney
mp_killbuildings
mp_killteambuildings
mp_turretdamage
mp_unbuildable

alt Re: Construction Related Settings

Deas
User Off Offline

Zitieren
thanks

but what about how close to each-other they can be and how fast you build them? I've seen a few servers that had no building time or how close dispenser could be to each-other, is that all with scripting?

alt Re: Construction Related Settings

Happy Camper
User Off Offline

Zitieren
Sure. It's not so complicated. First I add a buildattempthook. If someone is trying to build something, the hook will be called. The hook checks if the building is a turret. If it is, it opens a new menu where the builder can select to build a single, double or triple turret. The script then checks if the player has enough money to build. If he has, it deducts the cost from his money and spawns the building. Spawning a building is an instant operation.

alt Re: Construction Related Settings

Deas
User Off Offline

Zitieren
Happy Camper hat geschrieben
Sure. It's not so complicated. First I add a buildattempthook. If someone is trying to build something, the hook will be called. The hook checks if the building is a turret. If it is, it opens a new menu where the builder can select to build a single, double or triple turret. The script then checks if the player has enough money to build. If he has, it deducts the cost from his money and spawns the building. Spawning a building is an instant operation.


oh, so you basically rewrite the building function?

alt Re: Construction Related Settings

Happy Camper
User Off Offline

Zitieren
I guess you can say that. The build function is designed to be slow while spawnobject creates a building instantly. Beware, it's easy to build a lot of triple turrets with this script and that could cause your server to lag (and your head to ache).

alt Re: Construction Related Settings

Deas
User Off Offline

Zitieren
Happy Camper hat geschrieben
Beware, it's easy to build a lot of triple turrets with this script and that could cause your server to lag (and your head to ache).


hmm, i see.

any suggestions on how i make a timer or limit how many someone can build (before i try to make one)?

i'd prefer if i could use some sort of setting like mp_building_limit

alt Re: Construction Related Settings

Happy Camper
User Off Offline

Zitieren
You could use the Lua call object(0,"table") to get a list of all dynamic objects (including buildings). Then loop through all of them to check if the player has already reached the limit for that type of building. If so, don't let him build.

If you want a delay between the builds you could store the time when the player builds something. Next time, check the time against the previous build time. If they are too close, refuse the build. The drawback with this is that the player will probably be frustrated.

A better solution is to start a timer (use the Lua function timer(time,"func",["p"],[c])) at each build attempt. When the timer expires, you spawn the building. You should also refuse all build attempts until the timer has expired to prevent a player from starting multiple build attempts.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antwortenGeneral-ÜbersichtCS2D-ÜbersichtForenübersicht