Add a single event. Best way?

Get some help with creating maps or modding.
Need a map editor or other tools, look here!
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Add a single event. Best way?

Post by NoQ »

Suppose i'm making a mod, and all i need to do is add a single event and a function that handles it. Here is an example: i add a timer event and a function that gives the players power every time the timer ticks.

In the example, i've added the code to rules.slo. This means if rules.slo change, the mod will break.

Is it possible to just add an extra file, without replacing existing ones, to achieve what i want? If not, what is the safest way of doing what i want? (:
User avatar
milo christiansen
Regular
Regular
Posts: 749
Joined: 02 Jun 2009, 21:23
Location: Perrinton Michigan

Re: Add a single event. Best way?

Post by milo christiansen »

The best thing to do is look for every wrf that includes rules.slo and add "givepower.slo" and "givepower.vlo" (or whatever name you used) in the right place.

I have no idea what wrf(s) you need but you could look in the addon.lev file for a clue if you don't feel like opening every one :)

Of course this leads to the problem of the wrf changing but I think that would be less common than a script change.
In general, if you see glowing, pulsating things in the game, you should click on them.
- Demigod Game Ganual
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: Add a single event. Best way?

Post by Per »

rules.slo is not likely to change for 2.3; for master, things are likely to change and break massively anyway.

You can run additional scripts by listing them in a .wrf that is included by the map. I'm not sure how that works with the new mapmod stuff, though.
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: Add a single event. Best way?

Post by NoQ »

Per wrote:You can run additional scripts by listing them in a .wrf that is included by the map. I'm not sure how that works with the new mapmod stuff, though.
That's the way i did spectators on some of my maps, and it works. But i'm talking about standalone mods right now.
milo christiansen wrote:wrf
oh well (:
Per wrote:rules.slo is not likely to change for 2.3
ok got it! (:
Per wrote:for master, things are likely to change and break massively anyway.
Ok, if wishes are still accepted for new modding technology, i'd really like an ability to add things without substituting things! :3
Last edited by NoQ on 01 Sep 2011, 12:52, edited 1 time in total.
User avatar
Terminator
Regular
Regular
Posts: 1077
Joined: 05 Aug 2006, 13:46
Location: Ukraine

Re: Add a single event. Best way?

Post by Terminator »

I just wanted to advice you to modify some wrf files that won't be changed in MP, its skirmish wrf files, "skirmish4.wrf" -its simple to add your own scrip files.
Death is the only way out... sh*t Happens !

Russian-speaking Social network Group http://vk.com/warzone2100
User avatar
Iluvalar
Regular
Regular
Posts: 1828
Joined: 02 Oct 2010, 18:44

Re: Add a single event. Best way?

Post by Iluvalar »

I agree with Per. If the game change so much that your rules.slo doesn't work anymore, You'll need to remake your mod anyway. The wrf version will have a maximal longevity but when I think about the extra effort you'll do for it or another "X-T1" mumbo-jumbo trick I know. You might be better just copy paste your event in rules.slo and repeat that when needed.

A better way would be to have the game load all a directory instead of cherry picked files. Then we could add a new event just like that...
Heretic 2.3 improver and proud of it.