Small amount of help needed (masda)

Small amount of help needed (masda)

Postby Incinerate » Tue Sep 14, 2010 3:48 pm

so the only problem i have in my map so far, is tthat the triggers are quite different from war3.. so i am not sure what to do here. this is the only part mas where i need some help :P

as you can see i have attempted it but i not sure why its not working . Basically the error is that as any base dies, the victory screen shows.


How to set up a proper base defeat trigger for a footmen frenzy type map in sc2 mas ?


here is what i have so far , as soon as any base dies the victory screen comes up :S . Any help appreciated

map initialization trigger =
Image


1st piece of base defeat trigger =
Image


2nd piece of base defeat trigger =
Image


3rd piece of base defeat trigger =
Image
Incinerate
Headhunter
 
Posts: 260
Joined: Sat Jan 19, 2008 7:13 pm

Re: Small amount of help needed (masda)

Postby spheresword » Tue Sep 14, 2010 7:39 pm

Insert debugging statements into each of the if/else lines. Put in "test #" for each one and see which one executes. That should get you closer to an answer.
Image

"Boy, you're dumb as a mule and twice as ugly. If a strange man offers you a ride; I say take it."
Major of the Sheep Brigade, Second Division
User avatar
spheresword
Raider
 
Posts: 1215
Joined: Fri Mar 16, 2007 11:01 pm
Location: Zai

Re: Small amount of help needed (masda)

Postby Incinerate » Tue Sep 14, 2010 8:11 pm

i think the problem has something to do with "forceplayercount" variables im using... ( forceplayercount is intended to record the teams left in the game . Total teams = 4) anyway i think the way how i used forceplayercount in the trigger is whats causing it too mess up.. the thing is i not sure exactly how to make such a trigger . i wont know what to do with the debug comments sphere :(


I need the great Mas hax for this one.

again the trigger works, all the units are killed whenever a base dies, the problem is that after 3 seconds, i believe the force player count thing messes up and then gives almost everybody a defeat with score screen.
Incinerate
Headhunter
 
Posts: 260
Joined: Sat Jan 19, 2008 7:13 pm

Re: Small amount of help needed (masda)

Postby masda70 » Wed Sep 15, 2010 11:32 pm

I found something on the 1st piece of base defeat trigger.

codeerror.png
codeerror.png (17.84 KiB) Viewed 101 times


The -1 should be outside the [] I think.

I didn't inspect the rest of the code, but it makes sense that this alone could be causing the errors.
User avatar
masda70
Clan Shaman
 
Posts: 569
Joined: Fri Mar 16, 2007 6:55 pm

Re: Small amount of help needed (masda)

Postby Incinerate » Thu Sep 16, 2010 12:47 am

shucks the thing still refuses to work, i put in the fix for the -1 to be outside the bracket,

whats happening now is that when bases die, only the units die with them, but no score screen comes up if you are the last team in the game.

so basically im having a problem with trying to recognize when there is only one team left in the game to show the score screen..

Ive tried hard to figure it out :( , anymore help mas?
Incinerate
Headhunter
 
Posts: 260
Joined: Sat Jan 19, 2008 7:13 pm

Re: Small amount of help needed (masda)

Postby masda70 » Thu Sep 16, 2010 10:17 am

Ok, I didn't notice where the real problem was.

It's got to do with how you manipulate variable ForcePlayerCount, both in that line I pointed out earlier, and the in the map init trigger.

First, in the map init trigger, do something like this:

ForcePlayerCount[((Picked Integer-1)/3)+1]=ForcePlayerCount[((Picked Integer-1)/3)+1]+1

in the other line I screenshoted,

ForcePlayerCount[((local_player-1)/3)+1]=ForcePlayerCount[(((local_player-1)/3)+1]+1
User avatar
masda70
Clan Shaman
 
Posts: 569
Joined: Fri Mar 16, 2007 6:55 pm

Re: Small amount of help needed (masda)

Postby Incinerate » Thu Sep 16, 2010 4:10 pm

ok so i did that, and the damn thing still refuses to work, When any base in the game dies, it gives score screen for everybody i think.

Question masda, The way how i set this up in the trigger , would you have implemented it in a similar fashion? or would you have done a different method (if so, please mention the other method, cause i not sure this way even works with any amount of tampering )



This is the implemented code in map init =
Image







and base defeat =
Image
Incinerate
Headhunter
 
Posts: 260
Joined: Sat Jan 19, 2008 7:13 pm

Re: Small amount of help needed (masda)

Postby masda70 » Thu Sep 16, 2010 9:52 pm

Haha, I'm dumb. I obviously meant to say

ForcePlayerCount[((local_player-1)/3)+1]=ForcePlayerCount[(((local_player-1)/3)+1] -1

for the base defeat trigger (notice the -1 at the end).


On a side-note, I would have aimed for much cleaner code, since I there is a lot of repetition the way the base defeat has been coded and now with those ugly (((local_player-1)/3)+1 formulas. Using variables, loops and shit could fix it, but making such clean code with GUI could end up in a code mess. Since this kind of trigger will never need to be changed once you get it to work, you might want to stay with what you have as soon as you fix the error.
User avatar
masda70
Clan Shaman
 
Posts: 569
Joined: Fri Mar 16, 2007 6:55 pm

Re: Small amount of help needed (masda)

Postby Incinerate » Fri Sep 17, 2010 1:15 am

damn no success , i put the -1 outside forceplayercount in the base defeat trigger. Now it instantly gives score screen when a base dies.

is local_player im using set to correct variable? right now its integer, i couldnt find "player" type for it.


in warcraft for the footy map i made used a very similar trigger, instead it was

-map init "forceplayer= [ ((team number of (player ((integer A))))+1 ] = [ ((team number of (player ((integer A))))+1 ] +1)

- and in base defeat it was [ ((team number of (player ((integer A))))+1 ] = [ ((team number of (player ((integer A))))+1 ] -1)


it worked there, but now when i try to do it in sc2, its a failure.


theres a couple things missing in sc2 that were part of this trigger and is maybe the reason why its failing?

- firstly local_player was of the variable type "player" in warcraft 3. In sc2 as you can see local_player is of variable type "integer" now as thats the closest thing i could find.

-in the warcraft 3 the part where i used "forceplayercount was set up like this, firstly it was "arithmetic", then "player team" , then state the variable.
In sc2 the "player team" part does not exist.


So where i believe sc2 trigger is messing up has something to do with [((local_player-1)/3)+1]=ForcePlayerCount[(((local_player-1)/3)+1] -1 The part where it says local player it should be "team number of local player". but there is none in sc2.


I probably confusing you with all this crap, got any other solutions mas?
Incinerate
Headhunter
 
Posts: 260
Joined: Sat Jan 19, 2008 7:13 pm

Re: Small amount of help needed (masda)

Postby masda70 » Fri Sep 17, 2010 6:13 am

There are no Player and Player Team types for variables in SC2. Integers are fine.

The way you have set up your teams, (((local_player-1)/3)+1 actually stands for the team number that's lost a member in integer arithmetics, when local_player is the player whose base has been destroyed.

short example:

if local_player==5,

5-1 = 4
4/3 = 1 (integer arithmetics)
1 + 1 = 2

player 5's team = 2

Hm... but now that I think about it, have you initialized ForcePlayerCount to 0? In the map init trigger, add right at the beginning a Pick each integer from 1 to 4, and in the corpus, add Set Variable ForcePlayerCount[Picked Integer] = 0.

If that doesn't work, then maybe player 0 is actually exists in team 1... (well that doesn't sound right considering your map init trigger...). If anything comes to worst, try ((local_player)/3)+1, and ((Picked Integer)/3)+1, where appropriate, but I'm pretty sure the formula right now is OK.

You are right this worked in WC3 with player team. Double check whether you are doing Integer arithmetics for the division (but from what I'm seeing in one of your screenshots, you are indeed doing that...). Then follow Spheresword advice and print messages with the value given by (((local_player-1)/3)+1, and output ForcePlayerCount values at map init, and every time a base is destroyed.

PS: I'm going away for the weekend, good luck with that.
User avatar
masda70
Clan Shaman
 
Posts: 569
Joined: Fri Mar 16, 2007 6:55 pm

Re: Small amount of help needed (masda)

Postby Incinerate » Fri Sep 17, 2010 2:50 pm

thanks guys, i got it too work .

i initialized the variable to 0 . then i used sphere debug statements to see how many times it executed , and i noticed something. It only executed once on startup . which makes sense because the only player playing in the test is me = thus once. so if i kill any base it will give me an instant score screen. ( the reason bases are still alive is because i disabled the "kill picked unit "action deliberately for testing purposes , so variable wasn't accounting for the bases that should have been dead and thats where the confusion came from.

So I manually made forceplayercounter execute 12 times (12 players) on startup to see if it works and it does :D .. so problem solved.. It was working correctly all along . So in a real game it should work no problem.


Masda big thanks for your formula, works great :) and thanks spheresworld for actually bringing to my attention its possible to check the debugs .
Incinerate
Headhunter
 
Posts: 260
Joined: Sat Jan 19, 2008 7:13 pm


Return to Starcraft 2 Map Projects

Who is online

Users browsing this forum: No registered users and 1 guest