 |
 |
 |
|
 |
 |
 |
|
 |
 |
|
|
|
|
12:12:12 14 July 2012 |
|
ddraig
Senior Resident
On forum: 06/19/2012
 Message edited by: ddraig 07/14/2012 12:13:03
Messages: 158
|
Odd scripting question
I've run into quite a bit of a dilemma. It basically concerns a way of doing a certain thing and I'm not sure if there's a more elegant solution or not (I'm not a very good coder, and have only very recently started)
I'm modifying an AMK file, news_main.script
There's a function that determines what weapon a stalker was killed with.
Here's the exact function:
http://pastebin.com/1N0TpPvV
The problem is that I'm using a custom mod that switches arms based on what suit you're using, and it does this by creating seperate versions of all weapons with the name of the suit attached which then uses a seperate mesh for the hud display... this has created quite a messy script when I attempt to add them to this function (just adding the base weapon name doesn't really work, as thanks to the mod they don't really exist anymore)
This is the way the current script looks:
http://pastebin.com/zhVZNznN
As you can see, it's a bit headache inducing compared to the other one.. would there be an easy way to add all possible variants of a weapon and cutting down on the amount of entries? Something like wpn_name(wildcard_outfit) or something? |
18:10:08 14 July 2012 |
|
ddraig
Senior Resident
On forum: 06/19/2012
 Message edited by: ddraig 07/14/2012 18:10:58
Messages: 158
|
It's that simple? Vintar, you're a true hero
Would it be possible to include an or statement in there? So to be something like
if string.find(id, "wpn_pm" or "wpn_fort") then
return 1
end
Sorry if this is a really stupid question, but I really am terrible new this to this sort of thing,. |
02:46:19 15 July 2012 |
|
ddraig
Senior Resident
On forum: 06/19/2012
Messages: 158
|
---QUOTATION--- No, won't work that way. You'd need to write it like that:
if string.find(id, "wpn_pm") or string.find(id, "wpn_fort") then
return 1
end
---END QUOTATION---
Thanks for the help! I love your dynamic shaders, by the way.
One thing that impresses me about the Stalker community is how helpful and amazing people can be. |
|
1 | All Messages |
|
|
|
» » |
|
All short dates are in Month-Day-Year format. |
 |
|
 |
|
|
|
 |
 |
 |