Can i get some help with this script?

Yes, but I am spawning the critter(s) via a map script, so I have to reference them and can't use self_obj. Should have written that before, though.
 
Lexx said:
Yes, but I am spawning the critter(s) via a map script, so I have to reference them and can't use self_obj. Should have written that before, though.

You can set that in the script of the created critters to turn as soon as they appear on the map. But it's just academic talking, the anim function will work just fine.
 
I have done this before, as workaround. But I found it to be ugly and bloated. Especially because the critter script is used in a different place as well, etc.

Though, sooner or later I will have to rewrite parts of my scripts anyway... Everything becomes very bloated and hackery because of all the things that can change and influence each other, which was added by me in later script sessions. A bit annoying.
 
Lexx said:
Though, sooner or later I will have to rewrite parts of my scripts anyway... Everything becomes very bloated and hackery because of all the things that can change and influence each other, which was added by me in later script sessions. A bit annoying.

Yeah, more time spent on detailed design saves you time on scripting.
 
Got a new question. I am trying to take away *only* the weapon / object that the player has in his hands currently, but it doesn't really work. It's a scripted scene, where the player has no control over his character...


Code:
variable gun;

gun:=obj_carrying_pid_obj(dude_obj, PID_FLAMER);
wield_obj_critter(dude_obj, gun);

...

destroy_obj_inven(gun);

destroy_obj_inven is the hairy part in here. If I remember correct, it worked (to take away only the gun in PCs hands), if I write "destroy_obj_inven(dude_obj, gun);" - this actually compiles with FSE, but Timeslips script editor yells an error here, so I'll had to take out the dude_obj part, because it's was an unneeded argument.

Anyway, now the problem is, that with the above code, I don't only remove the gun in PCs hands, but his whole inventory.

Someone got any ideas?
 
Look for the script which does the sharpening spear task in Arroyo. Basically, the spear is taken from player's inventory (either in hands or in inventory), is destroyed and a new, sharper one is given to him.
 
Mhm, I've done it quite similar. I've changed the details to how it's done in the Arroyo script and now it seems to work. Thanks for the hint.



Feels as if I've fixed like a million bugs in my mod today... Huh.
 
Bah, I've got some shitty script problem again.

I want to read the current value of a dude_obj skill and save it to a (temporary) variabel:

Code:
ValThrowing:=(get_critter_stat(dude_obj,SKILL_THROWING));

Problem is, that regardless of what I do, "(get_critter_stat(dude_obj,SKILL_THROWING))" always gives me the value 5, always. I am testing this in the mapper, where dude_obj's SPECIAL stats are all 5. If I test it in the game with different SPECIAL stats, it changes to i. e. 6 (tested it only once, though).

The problem is not related to the variable, as I've checked out the value in my debug output and this gives only 5 as well.

Does someone know if that's a bug or if there is any other way to get the current pc skill value? Is that possible at all (because looking at condition.h, I don't think it is)? As far as I know, there is not a single BIS script that is using it (at least I couldn't find any examples).


/Edit: Bah² fuck this shit. Solved it *now* AFTER I've posted in a forum about it... again, just like always. The thing is, "get_stat" doesn't work with skills. You have to use "has_skill" instead, as stupid and unrecognisable this is.
 
Got a new problem. :smug:

Does someone know how I can count all items of X the player currently has in his inventry? In example, I want to know how many PID_MUTATED_FRUIT the player currently has. Today I noticed that I have no clue how to do this, as I've never needed it... until now.

/Edit: Ok, this is slowly getting a tiny little bit embaressing. Got it now, just after I've posted this message. Example:

Code:
variable FruitTest;

      FruitTest:=dude_item_count(PID_MUTATED_FRUIT);
 
Back
Top