Special collectible gear for scripts and missions

5 replies [Last post]
Wuzzy
Wuzzy's picture
User offline. Last seen 4 days 2 hours ago. Offline
Joined: 2012-06-20
Posts: 1301
I suggest a new gear: A new kind of collectible item, similar to the weapon crate but when you collect it, nothing happens except for playing the “collect” sound maybe. The gear could look like an ammo crate, but with an exclamation mark or some other symbol on it. This gear can be used a a collectible in missions and scripts to trigger certain events, for example. Such a gear would be similar to the target gear, which is also only used in missions. Please note that thes same can be kinda (!) achieved with other crates, like a weapon crate with amNothing in it (or 0 of something) or a health crate when health bonus is set to 0. But this is still sub-optimal, as both trigger messages and the health crate still cures poison.
Hi, I am a Hedgewars developer. Smile
sheepluva
sheepluva's picture
User is online Online
Joined: 2009-07-18
Posts: 561
Please don't forget to check [url=http://hw.ercatec.net/docs/lua_wiki_check.php]the script that checks for undocumented Lua-API calls[/url] Smile Did you check following functions out? [code]SpawnFakeAmmoCrate SpawnFakeHealthCrate SpawnFakeUtilityCrate[/code] They might do exactly what you want. I think I used one of them in the Contact-Shoppa script.
  [url=/user/3290][color=white][b]sheepluva[/b][/color][/url][color=#90BA5D] <- me[float=right]  [/float][float=right][url=https://www.openhub.net/accounts/80048][img]https://www.openhub.net/accounts/80048/widgets/account_tiny.gif[/img][/url][/float][float=right]my code stats -> [/float][/color] [i][color=#6080C0][size=8]a[size=4] [/size][/size][/color][color=yellow]Hedgewars Developer[/color][/i] [center][float=left]  [/float][float=left][url=https://twitter.com/sheepytweety][img]/images/twitter.png[/img][/url][/float] [url=/privatemsg/new/3290][color=#C0C0C0]click here to message me[/color][/url][/center] [color=#90BA5D][float=left]  [/float][float=left][url=https://en.wikipedia.org/wiki/Austria][img]/images/Flags/austria.png[/img][/url][/float][float=left] <- where I'm from[/float][float=right]  [/float][float=right][img]/images/Flags/united_kingdom.png[/img][/float][float=right][img]/images/Flags/germany.png[/img][/float][float=right]what I speak -> [/float][/color]
Wuzzy
Wuzzy's picture
User offline. Last seen 4 days 2 hours ago. Offline
Joined: 2012-06-20
Posts: 1301
Thanks for pointing this out. I added the link to my bookmarks. This page still doesn’t say how to use these functions, nor does it specify any parameters. So I looked into the source code, and I guess I have found out the correct syntax. For future generations, here I leave behind how to use these functions: The syntax of all three functions is this: (x, y, explode, poison) x and y specify the position where the box is spawned. explode is a boolean, if it is true, the box will explode when collected. poison is a boolean, if it is true, the collector will be poisoned. As far I can tell all parameters are mandatory. I have tested the functions and they work so far. I was a bit disappointed as I didn’t hear a “collect” sound (I set both explode and poison to false in my test). (Maybe add this as a 5th optional parameter?) But: It is not my fault the wiki is soooo outdated and incomplete. :P And how was I, as a non-core developer, supposed to find this obscure URL on my own?: http://hw.ercatec.net/docs/lua_wiki_check.php I never found this one in the wiki.
Hi, I am a Hedgewars developer. Smile
sheepluva
sheepluva's picture
User is online Online
Joined: 2009-07-18
Posts: 561
[quote=Wuzzy]This page still doesn’t say how to use these functions, nor does it specify any parameters.[/quote] Yes, because it's just a simple script that searches words in the code and on the wiki, based on some patterns. Which then shows the difference. That script doesn't know how to figure out the parameters ( => you have proven you're smarter than the script ). It might be able to do so in the future. Some while ago I started working on making the uScript.pas code more structured and self-documenting. At some point I'll be hopefully able to generate a lua API wiki documentation automatically and completely (including descriptions etc.) from the code itself. Also I added the feature that calling a function with wrong parameter count will give a syntax message listing the number and names of the parameters. So just calling any function with empty brackets should do the trick. Oh and also I added the "/lua" chat command that allows you to e.g. do such thing directly in a local/quick game... [quote=Wuzzy]I was a bit disappointed as I didn’t hear a “collect” sound[/quote] Oh? I'll look into that, I guess. [quote=Wuzzy]It is not my fault the wiki is soooo outdated and incomplete. :P[/quote] So you added your latest findings to the wiki, right? Great ;p [quote=Wuzzy]And how was I, as a non-core developer, supposed to find this obscure URL on my own?[/quote] You weren't. It's just some lame script running on a lame server of mine. I think I put it in the wiki the other day, but then removed it again - for some weird or obscure reason. Ya know, like all my reasons.
  [url=/user/3290][color=white][b]sheepluva[/b][/color][/url][color=#90BA5D] <- me[float=right]  [/float][float=right][url=https://www.openhub.net/accounts/80048][img]https://www.openhub.net/accounts/80048/widgets/account_tiny.gif[/img][/url][/float][float=right]my code stats -> [/float][/color] [i][color=#6080C0][size=8]a[size=4] [/size][/size][/color][color=yellow]Hedgewars Developer[/color][/i] [center][float=left]  [/float][float=left][url=https://twitter.com/sheepytweety][img]/images/twitter.png[/img][/url][/float] [url=/privatemsg/new/3290][color=#C0C0C0]click here to message me[/color][/url][/center] [color=#90BA5D][float=left]  [/float][float=left][url=https://en.wikipedia.org/wiki/Austria][img]/images/Flags/austria.png[/img][/url][/float][float=left] <- where I'm from[/float][float=right]  [/float][float=right][img]/images/Flags/united_kingdom.png[/img][/float][float=right][img]/images/Flags/germany.png[/img][/float][float=right]what I speak -> [/float][/color]
Wuzzy
Wuzzy's picture
User offline. Last seen 4 days 2 hours ago. Offline
Joined: 2012-06-20
Posts: 1301
[quote=sheepluva] [quote=Wuzzy]It is not my fault the wiki is soooo outdated and incomplete. :P[/quote] So you added your latest findings to the wiki, right? Great ;p[/quote] No, I didn’t. But it is literally not my fault. I am not allowed to edit the wiki. Duh!
Hi, I am a Hedgewars developer. Smile
sheepluva
sheepluva's picture
User is online Online
Joined: 2009-07-18
Posts: 561
[quote=Wuzzy] No, I didn’t. But it is literally not my fault. I am not allowed to edit the wiki. Duh! [/quote] Yikes, sorry! I forgot that thing needs special permissions to be edited (silly amiright?) I gave "Edit Wiki"-permission to the account that you use for creating issues! Thanks for contributing! Smile
  [url=/user/3290][color=white][b]sheepluva[/b][/color][/url][color=#90BA5D] <- me[float=right]  [/float][float=right][url=https://www.openhub.net/accounts/80048][img]https://www.openhub.net/accounts/80048/widgets/account_tiny.gif[/img][/url][/float][float=right]my code stats -> [/float][/color] [i][color=#6080C0][size=8]a[size=4] [/size][/size][/color][color=yellow]Hedgewars Developer[/color][/i] [center][float=left]  [/float][float=left][url=https://twitter.com/sheepytweety][img]/images/twitter.png[/img][/url][/float] [url=/privatemsg/new/3290][color=#C0C0C0]click here to message me[/color][/url][/center] [color=#90BA5D][float=left]  [/float][float=left][url=https://en.wikipedia.org/wiki/Austria][img]/images/Flags/austria.png[/img][/url][/float][float=left] <- where I'm from[/float][float=right]  [/float][float=right][img]/images/Flags/united_kingdom.png[/img][/float][float=right][img]/images/Flags/germany.png[/img][/float][float=right]what I speak -> [/float][/color]
Copyright © 2004-2023 Hedgewars Project. All rights reserved. [ contact ]