Jump to content

Object reference without FOSE?


ModderIsLife

Recommended Posts

Hello, first of all I want to apologize if I have created many topics in a few days, I hope not to include any rule or anything, I'm finishing my mod, so I will not create a new topic in a long time, as I said before, I do not know minimum time rule to create themes or something.

 

I do not entertain you anymore and I ask my question ...

 

I do not have FOSE, and I would like to know if in the normal geckt, there is a function that identifies the type of target I shot, person, creature, or object type (static, moveable static, misc item etc).

 

It would be to use that information, for example ...

 

If I shot 10 mole rats, it shows a message (showmessage)

 

The ideal would be a generic function for anything in the game, but if it is impossible, what I need for my mod is to identify static and moveable static objects.

 

I hope you can help me.

 

A greeting.

Link to comment
Share on other sites

Delineate betweenStatic and Movable static for return ref. I didn't know it was possible except a jip function possibly. Which means FNV . But there might be one in Fose.

Which you shouldn't fear to use really. Unless it's a purist approach for nostalgia.

Which Iunderstand ... but other than that ... there really is no reason not to use Fose with Fo3.

It's a simple patch to the engine for both geck user and mod user.

Which most people are already using. And simply just gives the engine more scripting language it understands. Everything works the same with vanilla.

Link to comment
Share on other sites

How would you do that with FOSE?

The only thing I can think of (and it would be with vanilla scripting) is to put a script on all creatures with an OnDeath block:

for a Mole Rat

Beging OnDeath player
   Set MyMoleRatCountGlobal to MyMoleRatCountGlobal + 1
endif

You would have a quest script monitor the globals and do something when the total is reached.

 

Is there a way to do such a thing in a general script that can track each creature the PC kills?

 

Thanks.

Edited by GamerRick
Link to comment
Share on other sites

.. purely vanilla ..

http://geck.bethsoft.com/index.php?title=GetCombatTarget

http://geck.bethsoft.com/index.php?title=GetIsCreatureType

.. whole slew of useful information in the functions listings to figure out if it's possible to do other things ..

 

(a very simple example that should work for kill counting .. this would be used attached to a high priority, low delay running quest)

ref Rcreature
short iKilled

Begin GameMode

set Rcreature to player.getCombatTarget

IF (Rcreature.getIsCreatureType 1) == 1

  IF (Rcreature.getDead) == 1

    IF (Rcreature.IsKiller player) == 1
      set iKilled to iKilled + 1
    ENDif

  ENDif

ENDif

END

.. to think of it .. there may already be an example of something similar in the scripting for the Quest where you test the Molerat Repellent for Moira

Edited by skittered
Link to comment
Share on other sites

You peaked my curiosity. So I took a look.

 

The MoleRat Repellent quest has a scripted effect on the repellent stick (MS03MoleRatRepellantScript). To only work on Mole Rats its does a faction check. The GetIsCreatureType and GetCreatureType commands return a generic type and can't be used to distinguish Mole Rats from Mirelurks.

 

As for getCombatTarget, would it work if you used a mine or grenade to kill several at once? What if you are targeting a creature that gets killed by someone or something else before you hit it?

 

Thanks.

Link to comment
Share on other sites

Thank you very much to all but I owe you an apology, the murder of rats mole was just an example, my doubt is object oriented, forgive but explain me well.

Is there any way to find out if I have fired at 20 objects of any kind, without using fose ?.

Link to comment
Share on other sites

You peaked my curiosity. So I took a look.

 

The MoleRat Repellent quest has a scripted effect on the repellent stick (MS03MoleRatRepellantScript). To only work on Mole Rats its does a faction check. The GetIsCreatureType and GetCreatureType commands return a generic type and can't be used to distinguish Mole Rats from Mirelurks.

 

As for getCombatTarget, would it work if you used a mine or grenade to kill several at once? What if you are targeting a creature that gets killed by someone or something else before you hit it?

 

Thanks.

Ah, so that's how it was done. Hadn't gone looking for that as I posted just before going to sleep and it was a bit of an afterthought at the end of the post..

 

I should have thought longer before I posted that example. There are enough things wrong with it that it probably won't work as is unless you kill what you're aiming at very quickly.

 

getCombatTarget only gets one target at a time, so you'd need to find a way to target and store a bunch of them 'before' killing them .. there is a check in there that checks to see if the target was killed by you. There are also various other things that could be used to narrow down the result to just the specific type you're trying to track, but it may get quite convoluted.

 

The game seems to already track kills by type, along with a whole bunch of other things, so it might be easier to just look up that value and track it till it reaches +(##) of the kill count you need for yourself.

 

 

Thank you very much to all but I owe you an apology, the murder of rats mole was just an example, my doubt is object oriented, forgive but explain me well.

Is there any way to find out if I have fired at 20 objects of any kind, without using fose ?.

Apologies. My first post was off topic ..

 

As far as I've found looking through the built in functions for my own purposes, there doesn't seem to be a way to 'generally' track "objects" that you're aiming//shooting at.

 

There may be a way to track things 'specifically', but it most likely requires making specialized changes and/or items for doing those things, and would most likely also end up creating a lot of conflicts with other mods.

 

.. the only other thing I can suggest is reading through the available functions yourself to see if you can figure something out.

 

(it also looks like fose wouldn't be able to do exactly what you want without a lot of specific scripting)

Edited by skittered
Link to comment
Share on other sites

Without possibility of fose, I am doing it by the long way :p

changing the name of all the objects that I want to destroy and then adding them to a search ...

 

If object1Ref.getdestroyed == 1

; action, for example showmessage

 

It works, what happens is that I only want the message to appear once, but as the condition of if it is destroyed is still valid, the message does not stop appearing ...

Even if the object is still destroyed, how can I get the message to go out only once?

Link to comment
Share on other sites

Thank you very much skittered, it works perfectly, finally I have a constant doubt, because I have opened 3 threads and as it could not be done as I wanted, then I did it in another way, it seems that someone owned me and found out things by myself, 5 minutes after asking them :p Edited by ModderIsLife
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...