Artifacts revisited

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

Artifacts revisited

Post by NoQ »

Can anybody come up with a good way of using the new map mod support to add artifacts with technologies to skirmish maps?

Something good enough to be implemented in FlaME, probably. It's easy interface-wise: add a "Technology" object property, that is the artifact dropped for any object that is not an artifact and the technology unlocked if the object is an artifact.

That might be useful for example for hover maps, where you can get hover technology earlier by defeating some scavenger base or something like that.
User avatar
effigy
Regular
Regular
Posts: 1217
Joined: 22 Jan 2010, 03:21
Contact:

Re: Artifacts revisited

Post by effigy »

I've thought about this too. It would be a great feature :)

I've seen many maps were the Crate Artifact was place all over the map. They'd light the mini map with dozens of green blips, but all I ever found when I recovered them was disappointment :(
This is why some features aren't implemented: http://forums.wz2100.net/viewtopic.php?f=30&t=7490&view=unread#p87241
User avatar
Flail13
Code contributor
Code contributor
Posts: 263
Joined: 16 May 2008, 12:00

Re: Artifacts revisited

Post by Flail13 »

I tested some scripts for it today and it worked in 2.3.8. Master doesn't seem to load scripts for skirmish though, in my few attempts.
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: Artifacts revisited

Post by NoQ »

Flail13 wrote:some scripts
Do want! :D
User avatar
Iluvalar
Regular
Regular
Posts: 1828
Joined: 02 Oct 2010, 18:44

Re: Artifacts revisited

Post by Iluvalar »

look at my mod artefactV04.wz here : https://skydrive.live.com/?cid=9506c397 ... 59C968!288

You will see on top of the mountain in sk-rush a pylon that you can grab by moving close enough. It unlock hover research.

The tricky part was to use something else then the artefact to use as item. Since that "crate'" have it's own behavior in source code. that make it disapear half of the time with no research.

I'll let Flail13 look at that. It's a bit messy right now. I needed to reproduce the trigger for each players to work properly in mp. I dont know if he have a better solution...

@NoQ : the file that I edit to do that is the same that gives the starting research. I dont know how much you want it to be on the map. But we could also give it straight away.
Heretic 2.3 improver and proud of it.
User avatar
Flail13
Code contributor
Code contributor
Posts: 263
Joined: 16 May 2008, 12:00

Re: Artifacts revisited

Post by Flail13 »

a map with an artifact script

The script I used is similar to Iluvalar's. I thought it was better to use a loop to cycle each player for picking up the artifact, and it relies on a structure being destroyed to place the artifact. Scavangers need to be turned on for the research facility that provides the artifact to exist, and again, it doesn't work in master.
I didn't realise the artifact disappeared by itself sometimes, so I adjusted my script to only refer only to a position, instead of the position of the artifact.
Like Iluvalar's script, it is probably better to use something other than a "crate" to receive the research, and rewriting rules.slo might also be better than my unique scripts. I'll get around to testing it some more another day.
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: Artifacts revisited

Post by NoQ »

I think having artifact script as a separate file is better, because we don't need to maintain rules.* up to date with every new version. Still, using *.wrf files seems to be discouraged nowadays, so we should ask how are we actually supposed to script for master (?)

Probably this topic should be moved to development/scripting (?)
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: Artifacts revisited

Post by Per »

NoQ wrote:so we should ask how are we actually supposed to script for master
We are still thinking about that, so the question should rather be asked back -- how would you like to script for master? :geek:
User avatar
Iluvalar
Regular
Regular
Posts: 1828
Joined: 02 Oct 2010, 18:44

Re: Artifacts revisited

Post by Iluvalar »

Flail13 wrote:a map with an artifact script

I thought it was better to use a loop to cycle each player for picking up the artifact
that's what missed me :

Code: Select all

function void art1Take(INT _player)
the fun part is i tried both "void art1Take" and "function art1Take". Per was not on IRC when I looked . :(

The wrf part is a lot cleaner gj. I think it's compatible with 2.3.7 and previous :o . And I believe it's a lot better the merging in rules.slo.
Heretic 2.3 improver and proud of it.
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: Artifacts revisited

Post by NoQ »

Per wrote:
NoQ wrote:so we should ask how are we actually supposed to script for master
We are still thinking about that, so the question should rather be asked back -- how would you like to script for master? :geek:

Code: Select all

do_what_i_want();
(this might require libastral.so as a dependency)

I mean, i'm in no position to advice here, i'm a simple map maker, i hardly know even the current system :oops: :oops: :oops:
My only wish is that there is at least some part of it that i can use for map-mods that doesn't break every 3 versions :roll:
User avatar
milo christiansen
Regular
Regular
Posts: 749
Joined: 02 Jun 2009, 21:23
Location: Perrinton Michigan

Re: Artifacts revisited

Post by milo christiansen »

When I used artifacts for fastplay I would place them in script then check for distance from player units and remove it if distance < 200. Then you could trigger whatever behavior you wanted such as adding units or giving research.

I think I'll take a look a these maps/scripts they sound interesting :wink:
In general, if you see glowing, pulsating things in the game, you should click on them.
- Demigod Game Ganual
User avatar
milo christiansen
Regular
Regular
Posts: 749
Joined: 02 Jun 2009, 21:23
Location: Perrinton Michigan

Re: Artifacts revisited

Post by milo christiansen »

My (untested) try at a set of artifact scripts.

The scripts as is are optimized for use with things like random placement. You just call a function with the coords to place the artifact at and use the return value to index into an array of status flags waiting until it equals SLOTCOLLECTED then do your thing and set the flag to SLOTCLEAR so it can be reused. Not the best way to use for pre-placing artifacts but cool if you want them to randomly spawn or be placed when something is destroyed.
Attachments
MP-SK Artifact Scripts.7z
WARNING!!! Untested, sorry ran out of time :)
(2.04 KiB) Downloaded 205 times
In general, if you see glowing, pulsating things in the game, you should click on them.
- Demigod Game Ganual
User avatar
milo christiansen
Regular
Regular
Posts: 749
Joined: 02 Jun 2009, 21:23
Location: Perrinton Michigan

Re: Artifacts revisited

Post by milo christiansen »

Updated scripts

This pack includes my earlier ones along with a set made for placement in the map editor. The new scripts have been made with machine generation in mind so including them in a map from flame should plausible :)

I f you want to use both dynamic and static placement in the same map you can rename the current scripts so they don't clash or you can just wait a day or so until I do the final version(s) :wink:

WARNING!!! The dynamic placement scripts in this file have BIG problems mostly fixed in the next download farther down the page. :lecture:
Attachments
MP-SK Artifact Scripts.7z
Artifact scripts - Tested and working :)
(2.53 KiB) Downloaded 200 times
Last edited by milo christiansen on 14 Jul 2011, 20:14, edited 1 time in total.
In general, if you see glowing, pulsating things in the game, you should click on them.
- Demigod Game Ganual
User avatar
Flail13
Code contributor
Code contributor
Posts: 263
Joined: 16 May 2008, 12:00

Re: Artifacts revisited

Post by Flail13 »

a few points about the scripts...
have they been tested in multiplayer?
should we be using crates with their hard-coded disappearing?
would it be better to have them in the unique map folder, to give them unique paths for each map?
User avatar
milo christiansen
Regular
Regular
Posts: 749
Joined: 02 Jun 2009, 21:23
Location: Perrinton Michigan

Re: Artifacts revisited

Post by milo christiansen »

Flail13 wrote:a few points about the scripts...
have they been tested in multiplayer?
should we be using crates with their hard-coded disappearing?
would it be better to have them in the unique map folder, to give them unique paths for each map?
As for testing... They have only been tested in 2.3.8 skirmish Master will not load scripts in skirmish it seems :stressed: and I don't have internet at home :(

As far as I know crates don't disappear unless you destroy them in script, at least they never did in my tests. This I tested in both 2.3.8 and Master.

As for unique paths, they are not needed because the mod data is loaded on-the-fly so you always get the right copy. This is how the new map/mod support works. The only way this would be a consideration is if you are using a version of warzone that does not support map/mods.


For some reason the script parser chokes on the dynamic placement scripts vlo :augh:

Here's the vlo:

Code: Select all

script "Artifacts-Dynamic.slo"
run
{

// Artifacts
crate		FEATURESTAT		"Crate"
ArtSnd		SOUND			"pcv352.ogg"	//artifact sound

ExampleRes	RESEARCHSTAT	"R-Vehicle-Prop-Hover"

}
And here's the log:

Code: Select all

--- Starting log ---
error   |12:29:13: [eventSetContextVar] eventSetContextVar: Variable type mismatch (var type: 2009463936, data type: 29)
error   |12:29:13: [eventSetContextVar] Assert in Warzone: ../../../../lib/script/event.c:760 (0), last script event: '<none>'
error   |12:29:13: [scrv_error] VLO parse error: Set Value Failed for 0 at line 6, text: 'Crate'
fatal   |12:29:13: [dataScriptLoadVals] Script Artifacts-Dynamic.vlo did not compile
error   |12:29:13: [resLoadFile] resLoadFile: The load function for resource type "SCRIPTVAL" failed for file "Artifacts-Dynamic.vlo"
fatal   |12:29:13: [resLoad] Failed to parse wrf/Artifacts-Dynamic.wrf
fatal   |12:29:13: [startGameLoop] Shutting down after failure
The weird part is that the code it seems to be having a problem with is copy pasted from an old artifact handler I wrote for fastplay missions which is in turn copy/pasted from fastdemo.vlo. Both work fine, I just retested them today.

At first I thought it was a cam vs sk/mp data problem but both versions of features.txt define a "Crate". I've done every thing I an think of but it still won't work.
Attachments
MP-SK Artifact Scripts.7z
Ready to go artifact placement scripts, complete with test map and nonworking dynamic placement scripts :p
(2.53 KiB) Downloaded 211 times
In general, if you see glowing, pulsating things in the game, you should click on them.
- Demigod Game Ganual
Post Reply