An invasion OSP script?

Users who are viewing this thread

You still could have answered the question, I would also like to find out how to do this. I remember looking before but didn't find it so could people find out how to do this.
 
With a bit of use of my memory and a search engine, allow me to quote myself:
Lumos said:
module_party_templates:
Code:
  ("invaders","Invaders",icon_khergit|carries_goods(2)|pf_show_faction,0,fac_outlaws,bandit_personality,[(trp_swadian_knight,100,320),]),
       # I hate the evil swadians... :)
module_triggers:
Code:
(8765,0,ti_once,[],[
     (set_spawn_radius, 4),
     (try_for_range, ":i", 0, 251), # 251 = number of invaders to spawn + 1
           (spawn_around_party, "p_town_1", "pt_invaders"),
           (val_add, ":i", 1), # i++, so no "unused local var" message
     (try_end),

This will make 250 Invader parties spawn after a year passes. Change the "ti_once" to 0 if you want it every year. :wink:

Feel free to look around at the whole topic for more info.
 
All they'll do is attack Swadian Lords moving around the map, though; making them do other stuff, like besieging towns and generally acting like Lords but without all of the other Lord code is fairly hard (but can be done).
 
Using this code what makes them attack swadian lords, I don't notice anything that specify's them to attack a certain faction.
 
@Lumos: (You can use ":unused" to avoid a build warning.) Nice and simple, easy for beginners to put it in.
@Pearse: actually they will attack mostly Nords, as town_1 is Sargoth
 
I wrote that code a long, long time ago, I was almost a newbie back then. And in that same topic, dunde told me the same about the :unused var. :razz:
Also, that was just an idea, it wasn't supposed to be a full invasion script, just a tip on how one could begin working on such.
 
Im not any good when it comes to code so what does this mean if you change it.

(try_for_range, ":unused", 0, 251),

Also the spawned party do they just attack near their spawn location like patrolling the area or do they roam the entire map looking for fights. I wouldn't really know how to develop the script to make it more advanced but something simple like this would suit me just fine as randomly blob of zombies appear and attack so nothing complex is needed since they're zombies.
 
What would happen if I made a new faction, like "FACTION 7" and rather than giving them any towns/castles/villages at the start, I used that piece of code to make trp_knight_1_1 or whatever the faction leader would be called, appear after 2 years along with 200 swadian knights?

Would that cause a completely new faction to appear after 2 years, or would it just crash the game?
 
Maxim Suvorov said:
Lumos said:
    (try_for_range, ":i", 0, 251), # 251 = number of invaders to spawn + 1
          (val_add, ":i", 1), # i++, so no "unused local var" message
tip>>
(try_for_range, ":unused", 0, 251),
Excuse me, but the following statement was on the previous post:
Lumos said:
I wrote that code a long, long time ago, I was almost a newbie back then. And in that same topic, dunde told me the same about the :unused var. :razz:
Yeah, I'd been programming mostly on C# before I started learning the ModSys.

EDIT from 2015: It's amazing, in retrospect, how something as little as having forgotten to include a number sign after the name of a programming language, creates a lie of immense proportions...
 
Lumos said:
module_party_templates:
Code:
  ("invaders","Invaders",icon_khergit|carries_goods(2)|pf_show_faction,0,fac_outlaws,bandit_personality,[(trp_swadian_knight,100,320),]),
       # I hate the evil swadians... :)
module_triggers:
Code:
(8765,0,ti_once,[],[
     (set_spawn_radius, 4),
     (try_for_range, ":i", 0, 251), # 251 = number of invaders to spawn + 1
           (spawn_around_party, "p_town_1", "pt_invaders"),
           (val_add, ":i", 1), # i++, so no "unused local var" message
     (try_end),

This will make 250 Invader parties spawn after a year passes. Change the "ti_once" to 0 if you want it every year. :wink:

but where does it state for it to be 250 days i dont see it in the module triggers
 
Back
Top Bottom