Coding problom

1 reply [Last post]
Samuelfrost4
User offline. Last seen 10 years 42 weeks ago. Offline
Joined: 2011-05-19
Posts: 42

I want so when you start a turn that you have no weapon equipped. Heres what I have thats not working.

loadfile(GetDataPath() .. "Scripts/Locale.lua")()

function onNewTurn
set weapon to amNothing
end

lol yes not much. But Its not working. Anyone know how to do this?

Henek
Henek's picture
User offline. Last seen 5 years 43 weeks ago. Offline
Joined: 2010-04-06
Posts: 55

Hi, the problem I see is that you do not know how Lua works.
Try looking at existing scripts and some of our wiki pages from here (http://code.google.com/p/hedgewars/w/list) related to Lua and maybe search google for a quick Lua tutorial.
If you after that have other questions you can ask on our irc-channel.

Ps. there is a game mode that already resets weapons on new turn, you HAVE TO use that one as it is not possible to change the ammo store later on in lua.

Good Luck

One of those hedgewars developers. I am specially knowledgeable in lua scripting, and the father of gameplay scripts.

User login

Copyright © 2004-2024 Hedgewars Project. All rights reserved. [ contact ]