Page 1 of 1

Changing mapmodels and factions by triggers

Posted: October 10th, 2011, 7:02 pm
by java.x.beast
I was wondering if it was possible to change mapmodel numbers and factions by triggers.

The reason for changing mapmodels was so that the creature would "respawn". I was thinking if it was possible to place a bunch of invisble map models with numbers of -1 or less and then when a trigger is triggered, it would change the mapmodel number from -1 to the number of the creature.

Another way I was thinking of doing this was by putting the change mapmodel number code into the r_destroy command, so that when the creature is killed, it will change the mapmodel number to -1 and then sleep for 30000 milliseconds, then change the mapmodel number back to the creature's original number.

Also, I wanted to know if I could do the same thing with factions, so that I can have friendly creatures like in runescape. So that they only attack you when you attack them. If there was a way to code it so that the faction would be the same as yours and then when you attack it, it changes the faction to the enemies.

Thanks,
CEO of Vulcanis Entertainment,
Addis Regassa

Re: Changing mapmodels and factions by triggers

Posted: October 10th, 2011, 8:10 pm
by BlackGulf
just like Mercenaries 2: World In Flames
but seriously i doubt it, maybe you should ask Hirato, as CP Pointed Out

Re: Changing mapmodels and factions by triggers

Posted: October 10th, 2011, 8:44 pm
by chocolatepie33
blackgulf, that's not helping. Try to post something actually helpful/meaningful.

@java: this might be possible, but I've never heard of anything even similar to this being executed. Hirato will likely have some kind of method to get what you're achieving. I've heard of using doors and teleporters to teleport mass amounts of creatures before, but this is a bit more complex. If you want something like this in the future, it's best you PM it to Hirato, or you could put it up at the 2.8 wishlist post. Then you may get some more ideas.

Re: Changing mapmodels and factions by triggers

Posted: October 10th, 2011, 11:04 pm
by Hirato
The reason for changing mapmodels was so that the creature would "respawn". I was thinking if it was possible to place a bunch of invisble map models with numbers of -1 or less and then when a trigger is triggered, it would change the mapmodel number from -1 to the number of the creature.

Another way I was thinking of doing this was by putting the change mapmodel number code into the r_destroy command, so that when the creature is killed, it will change the mapmodel number to -1 and then sleep for 30000 milliseconds, then change the mapmodel number back to the creature's original number.
You should really delete (r_destroy) the dead ones after a while, the RPG provides spawning mechanisms via r_spawn_* commands and the spawn entity, use them!
Also, I wanted to know if I could do the same thing with factions, so that I can have friendly creatures like in runescape. So that they only attack you when you attack them. If there was a way to code it so that the faction would be the same as yours and then when you attack it, it changes the faction to the enemies.
You could, but there's nothing stopping you from having making a faction go hostile to another or likewise become friendly. I am definitely going for something similar (ie, they retaliate when you attack them). The RPG does have the means to do that presently, but I'm not quite sure if everything's ready.

if you want to change their faction, it would work as follows

Code: Select all

r_select_char foe_reference [
  r_char_faction new_fac
]