FileFront Forums

FileFront Forums (http://forums.filefront.com/)
-   DoW Modding and Editing (http://forums.filefront.com/dow-modding-editing-1013/)
-   -   Scar troubles (http://forums.filefront.com/dow-modding-editing/390647-scar-troubles.html)

Tau're January 12th, 2009 08:00 PM

Scar troubles
 
Can anyone help me, im making a map with its own objectives for dark crusade but i can only make it as a map that u can choose in skirmish because of the campaign changes between winter assault and dark crusade. So u have to choose win condition which annoys me since i have all these objectives and then destroy hq or annihlate or sumthing like that which kinda ruins the whole concept of the map, is there anyway to get rid of these win conditions using the scar in my map?

dark40k January 13th, 2009 10:13 AM

Re: Scar troubles
 
It is feasible but not very easy.

You can check and kill winconditions using SCAR. Basic functions to search for are Rule_Exists and Rule_Remove.
Importing and launching the rule you need can be done with import :
Code:

import("winconditions\\assassinate.scar")
AssassinateInit()

The problem may come from the AIs that will have problem to handle the change. I don't know.

Hope this helps.

nemitis January 13th, 2009 03:31 PM

Re: Scar troubles
 
if this is a campaign map (which it kinda sounds like it is from ur post) then y dont u make ur own win condition? one that will go along better with the map. or u can make buildings invincible until a certain point in the game if anihlate and destroy hq is the problem.

Tau're January 13th, 2009 08:07 PM

Re: Scar troubles
 
ok, it is a campaign map but as u all no that dark crusade doesnt have the same type of campaign as dawn of war where u can choose which campaign u r playing so i had to make it as a skirmish map (where u can choose the map from skirmish map selection) and i have made my own objectives etc, but it is annoying me coz since i made it like a skirmish map it imports the win conditions like a skirmish map so now i have all these custom objectives then annihlate or destroy hq or sumthing like that aswell which doesnt fit in with my map at all, so i just want to know how to scrap those objectives and just keep mine...

Tau're January 14th, 2009 06:45 AM

Re: Scar troubles
 
sorry for double post but i also like to add that i tried wot dark40k suggested (importing a win condition and telling it to remove the rule b4 it adds it) but it said i was duplicating the rule and came up with scar error!

dark40k January 14th, 2009 10:10 AM

Re: Scar troubles
 
I gave a closer look and it is more complex than I thought. The problem is that the wincondition is initialized after your code starts because the map custom code is runned before the wincondition is loaded.

A workaround is to use the OnGameSetup() function. If this function exists then it is runned before the map starts but after the winconditions are loaded.

The following code removes Annihilate wincondition if it is set and forces Assassinate if it is not set. This is the whole code for the map. OnGameSetup() is not to be called with Scar_AddInit(). Note that there is no need to launch the rule as assassinate.scar already contains the Scar_AddInit() call to initialize the rule.

Look in the console for the print messages.

Code:

function OnGameSetup()
    if Annihilate~=nil then
        if Scar_InitExists(Annihilate) then
            print("OnGameSetup => killing annihilate wincondition")
            Scar_RemoveInit(Annihilate)
        end
    end

    print("OnGameSetup => forcing assassinate wincondition")
    import("winconditions\\assassinate.scar")
end

This should work better this way.

Tau're January 14th, 2009 06:39 PM

Re: Scar troubles
 
Omg, Thank You,

Tau're January 14th, 2009 06:39 PM

Re: Scar troubles
 
OMG, THANK YOU, i can

Tau're January 14th, 2009 06:39 PM

Re: Scar troubles
 
OMG, THANK YOU, i can finally get on with my map now thank you!, o and i dont no wot happend then with the triple posting, my net jst glitched or sumthing


All times are GMT -7.

Powered by vBulletin®
Copyright ©2000 - 2016, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 ©2011, Crawlability, Inc.