Jump to content
The Dark Mod Forums

Recommended Posts

Posted

I've been trying to finish off a handful of projects and experiments I had started a while ago, and remembered that I ran into a roadblock.  I was trying to build some custom entities with slightly complex behavior and had wanted to access a def_attach'd entity from the script on its parent object.  These script functions sounded pretty close:

scriptEvent entity getAttachment(string attName);

Get the attached entity with the given attachment name Will be NULL if the name is invalid or if the entity no longer exists
Spawnclasses responding to this event: idActor

scriptEvent entity getAttachmentInd(float index);

Get the attached entity at the given index. Will be NULL if the index is invalid or the entity no longer exists
index: starts at 0
Spawnclasses responding to this event: idActor

scriptEvent float getNumAttachments();

Return the number of attachments on an AI. Used to iterate through the attachments if desired.
Spawnclasses responding to this event: idActor

But as you can see, they only apply to idActors.  I dug into the source code and found that the code that handles all 3 of these functions just calls into the idEntity base class to retrieve the attachment, and there does not appear to be anything specific to idActor with those.  As such, I'm fairly certain that these script events could be moved to idEntity without breaking any existing usages (assuming script event inheritance works as expected).  Are there any downsides to doing this? 

I can create a bugtracker entry and/or provide a patch if there are no objections.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • Ansome

      Terribly difficult juggling map designing with work, but I'm still alive and chipping away at something very special. I'm actually making a collaboration of sorts with a friend, I make the map itself and he acts as my "Chief Scope Creep Consultant" that checks in every so often to make sure this project isn't getting out of hand. It's a good system!
      · 0 replies
    • JackFarmer

      We don't need artificial intelligence; we need artistic intelligence. 
      Ralf Hütter, Kraftwerk
      · 5 replies
    • taaaki

      The post editor for the dark themes should be working again. Apologies for the inconvenience.
      · 1 reply
    • jaxa

      Talk GabeCube:
      https://forums.thedarkmod.com/index.php?/topic/18055-2016-cpugpu-news/page/39/#findComment-508710
      · 3 replies
    • The Black Arrow

      Things have been so bad these days for me...
      Just a year ago, I've been feeling dizzy, I thought it was nothing, today's stress, that type of thing, went to sleep...Still dizzy! 9 more days dizzy, went to doctor (I would have gone on the first day if NOT for the long appointment time)
      Said it may be Neck Dizziness...I did exercises for 6 months, no changes.
      Went to a Physical Therapist, went to another, no changes.
      I've asked my doctor for a full check this time.
      I hated yesteryear so much due to personal reasons, this year might be the same.
      To be brutally honest, I'd rather have cancer or/and chronic pain than suffer dizziness any second longer, especially when nothing helps.
      Hard to enjoy Thief when you're dizzy so I was hoping this year, Winter will be best for me.
      · 7 replies
×
×
  • Create New...