Items scripts

Forgotten Knight

Time traveler stuck in time...
Modder
:( My english not so good. Just help please, will ya?

1. I really can't find any scripts related to hardcored items like motion sensor, geiger counter... I tried to write scripts for some new items in my mod(yet in development) but can't get them to work like those items above. What i mean is when you pick up an item it gives +20 to your outdoorsman skill, that part i managed to get working. But when you drop it, outdoorsman skill will have the same value or when i use command in the drop_p_proc:
critter_mod_skill(Dude_obj,SKILL_OUTDOORSMAN,-20);
it just adds 20 instead of -20. Can skill points be substracted by using script.
2. I had another problem with item that doesn't use ammo. I can't get that item to spend charges when i use it in item slot, although i put D small cell or S small cell for ammo and 10 charges, but ammo indicator is still intact so i can use that item like hundred times, and i don't want that. I tried greater charges, but... all the same. Maybe charges can be managed by a script?
 
Hi there.
1) I tried the same with night goggles giving +1 to perception... and got the same result. Never found a way to fix this problem.
2) in case of weapons there are similar problems, and they can be fixed by registering them in the appropriate header. I don't know if this applies to items too: all the items which use charges are hardcoded.
The only modder who managed to get some result out of hardcoded-like items is Lich. Try to look for info in his posts, or try to get in contact with him (even if he's not been around for quite some time, now).
Make sure you give a look at his scripts at his site (link in his signature). Text is in Polish, but his code will probably give you some hints.
See you and good luck.
 
Rather than have a seperate script for the item, could you add the code to the obj_dude script? Would that eliminate this problem?
 
Try this example formula:

Code:
variable decrease_value:=5;

while (has_skill(dude_obj, SKILL_OUTDOORSMAN))>decrease_value do 
begin

critter_mod_skill(dude_obj, SKILL_OUTDOORSMAN, has_skill(dude_obj, SKILL_OUTDOORSMAN)-decrease_value);

end

I did not test this but should work.
 
So you can actually decrease stat/skill values? :)
Yay, a couple of trinkets for the science guy coming!
 
Oh, sorry, I made a mistake, I watch at this what I wrote and I think that this do not work :(
But I didn't test this script so I am not sure.


I have another idea for such items like books:
you can try make this item as drug.
 
Sorry to say but i don't know what that code was supposed to do, as i see it just keeps adding the same value because critter_mod_skill can't substract and doesn't support negative values. It somebody finds the way to do this i would be glad to see it. :) I think that items do not modify skill points directly but use some temporary points when you are on the world map or reduce percent of random encouters possibility <- now that's X-file. :?:
 
Well, I just test this formula and this not work, sorry. I search TeamX docs and forum and there are not any info about substracting values from skills :(
 
Back
Top