Scar troubles -1 reply

Please wait...

Tau're

>.

50 XP

6th April 2008

0 Uploads

184 Posts

0 Threads

#1 10 years ago

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

SCAR is fun!

50 XP

14th January 2009

0 Uploads

13 Posts

0 Threads

#2 10 years ago

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 : 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

ONE MAN ARMY

50 XP

14th September 2008

0 Uploads

181 Posts

0 Threads

#3 10 years ago

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

>.

50 XP

6th April 2008

0 Uploads

184 Posts

0 Threads

#4 10 years ago

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

>.

50 XP

6th April 2008

0 Uploads

184 Posts

0 Threads

#5 10 years ago

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

SCAR is fun!

50 XP

14th January 2009

0 Uploads

13 Posts

0 Threads

#6 10 years ago

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.

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") endThis should work better this way.




Tau're

>.

50 XP

6th April 2008

0 Uploads

184 Posts

0 Threads

#7 10 years ago

Omg, Thank You,




Tau're

>.

50 XP

6th April 2008

0 Uploads

184 Posts

0 Threads

#8 10 years ago

OMG, THANK YOU, i can




Tau're

>.

50 XP

6th April 2008

0 Uploads

184 Posts

0 Threads

#9 10 years ago

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