Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
freem
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Openai/69185ed9-16a4-8011-b841-20ce53d80746
(section)
Add languages
Page
Discussion
English
Read
Edit
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
Edit source
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Assistant: Great — thanks for sharing the link for the DrGBase | Nextbot Base mod. === Great — thanks for sharing the link for the DrGBase | Nextbot Base mod. Here is the full modified function for you and the creator, ready to drop into lua/entities/drgbase_nextbot/relationships.lua. You can paste this in place of the existing UpdateRelationshipWith (or patch it accordingly). <syntaxhighlight lang="lua">-- In relationships.lua (around line 524 or where UpdateRelationshipWith is defined) function ENT:UpdateRelationshipWith( target, rel ) if not IsValid( target ) then return end -- If a table of relationships is passed, handle each if type(rel) == "table" then for _, r in ipairs( rel ) do self:UpdateRelationshipWith( target, r ) end return end -- Ensure we have a string if type(rel) ~= "string" then print( "[DRGBase][Warning] Relationship is not a string or table!", rel, target, debug.traceback() ) return end rel = string.upper( rel ) -- Continue original logic below... -- (existing code in the function remains unchanged from here) -- Example continuation: -- local cur = self.Relations[ target ] or "NEUTRAL" -- local newrel = rel -- if cur == newrel then return end -- self.Relations[ target ] = newrel -- etc. end </syntaxhighlight> ===== ✅ What this patch does: ===== * If rel is a table, it loops through each element and calls the function recursively. * If rel is not a string or table, it prints a warning with the value and target (and traceback for debugging) and exits safely. * If rel is a string, it upper‑cases it safely and proceeds with the rest of the logic. * Prevents the bad argument #1 to 'upper' (string expected, got table) crash. * Keeps compatibility for both Singleplayer (SP) and Multiplayer (MP). ===== 📋 Info for the creator: ===== * Reported error: ``<code> lua/entities/drgbase_nextbot/relationships.lua:524: bad argument #1 to 'upper' (string expected, got table) </code>`` (Seen in SP and MP) * Likely cause: UpdateRelationshipWith being passed a table instead of a string. * Occurs when spawning nextbots that have relationship definitions as tables or via addons/custom scripts. * Fix: add type‑check logic above and optionally support table input as shown. You can copy‑paste this chat into your message to the mod creator so they have context + the patch ready. If you like, I can also format a full issue text (markdown) suitable for posting on the GitHub issues section of DrGBase. Would you like me to generate that?
Summary:
Please note that all contributions to freem are considered to be released under the Creative Commons Attribution-ShareAlike 4.0 (see
Freem:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)