ProjectsWhat's NewDownloadsCommunitySupportCompany
Forum Index » S.T.A.L.K.E.R.: Shadow of Chernobyl Forum » Mod discussion
[PoC] Progressive weapons

« Previous 10 events | 1 2 3 4 5 | All Messages
Posted by/on
Question/AnswerMake Newest Up Sort by Descending
  04:36:46  14 November 2012
profilee-mailreply Message URLTo the Top
Nuor
Senior Resident
 

 
On forum: 03/10/2009
 

Message edited by:
Nuor
11/14/2012 7:52:54
Messages: 735

---QUOTATION---

function get_upgrade(section)
	local sect,new_sect = section
	local ids,idx,ver = string.find(sect,"_up(%d+)", string.len(sect)-4)
	if ids ~= nil then
		sect = string.sub(sect, 1, ids-1)
		new_sect = sect.."_up"..tonumber(ver)+1
	else
		new_sect = sect.."_up1"
	end
	if system_ini():section_exist(new_sect) then return new_sect end
	return sect
end	



Something close to this might avoid the need for tables.


Added that to wpn_mod.script, I get this error when I use either of the kits.

FATAL ERROR

[error]Expression : fatal error
[error]Function : CScriptEngine::lua_error
[error]File : E:\stalker\patch_1_0004\xr_3da\xrGame\script_engine.cpp
[error]Line : 73
[error]Description : <no expression>
[error]Arguments : LUA error: ... shadow of chernobyl\gamedata\scripts\wpn_mod.script:254: bad argument #1 to 'len' (string expected, got nil)


stack trace:

On the bright side of all this, at least it is using that part of the wpn_mod.script.
---END QUOTATION---



My first thought is that "section" is nil.

Put in a check.

	if section == nil or not system_ini():section_exist(section) then
		printf("%s is not a valid weapon section", section)
		return
	end
	local sect,new_sect = section, section
	...



try something along those lines.
edit: bad cut and paste
  23:41:31  14 November 2012
profilee-mailreply Message URLTo the Top
FatalFunnel
(Senior)
 
On forum: 11/07/2011
Messages: 133
I tried that and although now it doesn't crash, it seems to not work when I try to upgrade weapons. Still this doesn't bother me, I'll try to solve it later with you when I can make a port that works over vanilla and link you to that. Then we can figure this thing out.

Trying to make backpacks able to be picked up by the actor was more frustrating to me, probably because the principle of it was very easy, yet I was still getting many things wrong. I've got that part working now, so this is currently the only hurdle I have left.

And ultimately, if I'm not able to get the kits working, I can just make the weapons modifiable to the upgrade sections via dialog.
  00:49:17  15 November 2012
profilee-mailreply Message URLTo the Top
Nuor
Senior Resident
 

 
On forum: 03/10/2009
Messages: 735

---QUOTATION---
I tried that and although now it doesn't crash, it seems to not work when I try to upgrade weapons.
---END QUOTATION---



You are probably passing a nil value for "section" into the function. All that check I posted does is see if "section" is a valid weapon name and bail out if it isn't.
  01:05:52  15 November 2012
profilee-mailreply Message URLTo the Top
Alundaio
Sad Clown
(Resident)

 

 
On forum: 04/05/2010
 

Message edited by:
Alundaio
11/15/2012 1:08:18
Messages: 2230
I see a few issues in that pastebin script.


    chk local weapons
    if wpn_name(wpn_id) in local weapons then
    chk local weapons_nv2 (wpn_id)



What is going on here?
  01:25:08  15 November 2012
profilee-mailreply Message URLTo the Top
FatalFunnel
(Senior)
 
On forum: 11/07/2011
Messages: 133

---QUOTATION---
I tried that and although now it doesn't crash, it seems to not work when I try to upgrade weapons.

You are probably passing a nil value for "section" into the function. All that check I posted does is see if "section" is a valid weapon name and bail out if it isn't.
---END QUOTATION---



Yes.
 
Each word should be at least 3 characters long.
Search:    
Search conditions:    - spaces as AND    - spaces as OR   
 
Forum Index » S.T.A.L.K.E.R.: Shadow of Chernobyl Forum » Mod discussion
 

All short dates are in Month-Day-Year format.


 

Copyright © 1995-2020 GSC Game World. All rights reserved.
This site is best viewed in Internet Explorer 4.xx and up and Javascript enabled. Webmaster.
Opera Software products are not supported.
If any problem concerning the site functioning under Opera Software appears apply
to Opera Software technical support service.