Hi! Welcome to the forum for Platinum Arts Sandbox Free 3D Game Maker. I currently have the forums locked as I am attempting to properly update them.

In the meantime please join the new Discord Server!

If you have any questions please e-mail me through the Platinum Arts website.

factions (RPG)

Having issues not related to a specific Sandbox game mode? Get help here!
Please also read the rules for support when posting support requests.
Failure to comply with the forum rules may result in your topic being locked without resolution.
Locked
User avatar
wildflower
Member
Member
Posts: 76
Joined: August 11th, 2011, 5:10 am
Name: Sandie

factions (RPG)

Post by wildflower »

I know how to make an otherwise friendly npc attack the player, but is it possible to have an entire city become hostile if the player attack a friendly npc?
Hirato
Developer
Developer
Posts: 689
Joined: May 30th, 2009, 1:23 pm
IRC Username: hirato

Re: factions (RPG)

Post by Hirato »

nothing like this is being done yet, but it should be fully possible with the current framework.

At present, if you give something an attack directive, it will attack regardless of faction allegiances.
But essentially you'll have to do what I was planning to go anyway, place an update script of sorts for all critters that checks for all visible critters and their faction relationships, your code will be something like this

Code: Select all

r_select_faction (r_get_faction self) [
    r_loop_ents curmap ent [
        if (&& (r_cansee ent) (<= (r_faction_get_relation (r_get_faction actor)) 0)) [
           //attack here
        ]
    ]
]
I haven't entirely finalized everything regarding factions yet, so there will probably be some oddities, eg, creatures being friendly to others who are hostile towards them
This is not a url, clicking it is pointless
User avatar
wildflower
Member
Member
Posts: 76
Joined: August 11th, 2011, 5:10 am
Name: Sandie

Re: factions (RPG)

Post by wildflower »

@Hirato
Thanks, this is exactly what I was looking for :D

btw. I haven't had any oddities so far.
Locked