Go Back   Savage 2: A Tortured Soul Forum > Savage 2 Modding > Released Projects

Notices

Released Projects Share your finished/beta modifications with the community!

Reply
 
Thread Tools Display Modes
Old 12-11-2011, 10:28 PM   #81
Xbye

Xbye's Avatar
 
Join Date: Jun 2010
Posts: 138
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sorry for the double post, but now I have a new obstacle.

I am currently modifying my script even more, and right now I've came to this impass. How do I create an arguement for commanders? IE. If Commander, Show name. If no commander, show "No One" in text."

This is my current script so far: (Yes, I do plan to make it smaller and send less than 3 messages at once.)

HTML Code:
If [_eo_flood > 0] "goto EOF"

Action ToggleScoreOverlay 1
Sleep 10
Action ToggleScoreOverlay 0

If #StringEquals(|#LobbyTeamAverageSF0|#,--)# goto ASK

CreateVar int _SF0 #LobbyTeamAverageSF0#
CreateVar int _SF1 #LobbyTeamAverageSF1#
CreateVar int _LV0 #LobbyTeamAverageLevel0#
CreateVar int _LV1 #LobbyTeamAverageLevel1#
CreateVar int _TPH #ScoreboardNumPlayers0#
CreateVar int _TPB #ScoreboardNumPlayers1#
CreateVar int _TEH #TeamExperience0#
CreateVar int _TEB #TeamExperience1#
CreateVar int _CMHSF #ScoreboardCommanderSF0#
CreateVar int _CMBSF #ScoreboardCommanderSF1#

    Set _CMH #ScoreboardCommander0#
    Set _CMB #ScoreboardCommander1#
    Set _TAdvName "^cNo One^940"
    Set _TAdvNumb "NILL"
    Set _bclr "^470"
    Set _hclr "^775"
    Set _dclr "^940"
    Set _CommanderHuman "$_hclr$$_CMH$^r(^c$_CMHSF$^r)"
    Set _CommanderBeast "$_bclr$$_CMB$^r(^c$_CMBSF$^r)"
    
    Set _TAdvNumb [_SF0 - _SF1]
    If [_TAdvNumb < 0] "Set _TAdvNumb [0 - _TAdvNumb]"

    If [_SF0 > _SF1] "Set _TAdvName $_hclr$Humans^y"; Else If [_SF0 < _SF1] "Set _TAdvName $_bclr$Beast^y"
    
Set _msg1 "^gUsers: ^y[$_hclr$$_TPH$ ^y/ $_bclr$$_TPB$^y]^g SF:^y[$_hclr$$_SF0$ ^y/ $_bclr$$_SF1$^y]^g Lvl:^y[$_hclr$$_LV0$ ^y/ $_bclr$$_LV1$^y]
Set _msg2 "^y[$_TAdvName$]
Set _msg3 "$_dclr$have a ^y[^c$_TAdvNumb$^y] $_dclr$SF advantage."
Set _msg4 "^gTotal Exp ^y[^c$_TEH$ ^y/ ^c$_TEB$^y]"
Set _msg5 "^gCommanders: $_CommanderHuman$ ^gVS $_CommanderBeast$$_dclr$.

    If [(_TEH + _TEB)<1] "Set _msg4 "
    If [_TAdvNumb < 1] "goto EQUAL"
    goto FINAL
    
@EQUAL
    
    
@FINAL
    Allchat "$_msg1$"
    Allchat "$_msg2$ $_msg3$ $_msg4$"
    Allchat "$_msg5$"
    CreateVar int _eo_flood 1
    Sleep 500
    Set _eo_flood 0
    
@EOF
I understand I can probably make it check the Commander's SF, and if it's 0 then it shows "No one", but if the enemy commander is new (Or Smurf.) I don't want the script to confuse him/her with "No one".

Thanks in Advance =)
Xbye is offline   Reply With Quote
Old 12-11-2011, 10:35 PM   #82
Old55

Old55's Avatar
 
Join Date: Jun 2009
Posts: 2,586
Thanks: 14
Thanked 428 Times in 209 Posts
Default

Check out game.xml and look for the "No Commander!". Check which watch is used for that.

To see who a team's commander currently is, you can look at game_score_overlay.xml and see which watch is used for that.
__________________
Old55 is offline   Reply With Quote
Old 12-11-2011, 10:47 PM   #83
Xbye

Xbye's Avatar
 
Join Date: Jun 2010
Posts: 138
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Old55 View Post
Check out game.xml and look for the "No Commander!". Check which watch is used for that.

To see who a team's commander currently is, you can look at game_score_overlay.xml and see which watch is used for that.
I'm already using the Game Score Overlay, thanks anyways =D. I just need to find the trigger that tells the game If commander = truel/false. I checked Game.xml but I couldn't find what I was looking for. Let me check again, brb.

This is the one that I found from before:
"LobbyPhase HasCommander"
but how would I go about that? It doesn't seem to have a way to designate team. Unless I combine #ScoreboardCommander{Team}# with it, but how woudl I do that?

Last edited by Xbye; 12-11-2011 at 10:50 PM.
Xbye is offline   Reply With Quote
Old 12-11-2011, 11:42 PM   #84
Old55

Old55's Avatar
 
Join Date: Jun 2009
Posts: 2,586
Thanks: 14
Thanked 428 Times in 209 Posts
Default

Quote:
Originally Posted by Xbye View Post
I'm already using the Game Score Overlay, thanks anyways =D. I just need to find the trigger that tells the game If commander = truel/false. I checked Game.xml but I couldn't find what I was looking for. Let me check again, brb.

This is the one that I found from before:
"LobbyPhase HasCommander"
but how would I go about that? It doesn't seem to have a way to designate team. Unless I combine #ScoreboardCommander{Team}# with it, but how woudl I do that?
Those are two different watches: LobbyPhase and HasCommander. You are interested in the HasCommander. It is either true or false.

For your problem: If you just check the length of ScoreboardCommander{team} that should be enough to determine if the team has a commander and who it is.
__________________

Last edited by Old55; 12-11-2011 at 11:44 PM.
Old55 is offline   Reply With Quote
Old 12-11-2011, 11:56 PM   #85
Xbye

Xbye's Avatar
 
Join Date: Jun 2010
Posts: 138
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Old55 View Post
Those are two different watches: LobbyPhase and HasCommander. You are interested in the HasCommander. It is either true or false.

For your problem: If you just check the length of ScoreboardCommander{team} that should be enough to determine if the team has a commander and who it is.
How would I go about checking the length of ScoreboardCommander{team}?
Xbye is offline   Reply With Quote
Old 12-12-2011, 12:48 AM   #86
Old55

Old55's Avatar
 
Join Date: Jun 2009
Posts: 2,586
Thanks: 14
Thanked 428 Times in 209 Posts
Default

Quote:
Originally Posted by Xbye View Post
How would I go about checking the length of ScoreboardCommander{team}?
StringLength(ScoreboardCommander0);
__________________
Old55 is offline   Reply With Quote
Old 12-12-2011, 01:27 AM   #87
Xbye

Xbye's Avatar
 
Join Date: Jun 2010
Posts: 138
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Old55 View Post
StringLength(ScoreboardCommander0);
So, in other words it'd be something like this?
HTML Code:
If [(StringLength(ScoreboardCommander0))<1] "Set msg test"; Else If [(StringLength(ScoreboardCommander1))<1] "Set msg2 test2"
I'll give it a shot in a sec. Trial and error.


The stringlength seems to be 20, whether or not someone is in the commander's seat.

HTML Code:
Set _test1 StringLength(#ScoreboardCommander0#)
Set _test2 StringLength(#ScoreboardCommander1#)  
If [_test1 < 1] "Set _CommanderHuman No One."
That is what I've got... but it's not reading it. If I do it without the "#" it reads the "StringLength" as 20 all the time, it's counting the letters inside the (). If I put in the ##, it comes out as "StringLength(Xbye)" but it's not counting the stringlength. It just is stuck like that.

Aight well, after 2 hours of trying to bang my head against the wall trying to get this to work, I think Ima wait for some further help before I go back to trying to get the stringlength. Thx in advance.

Last edited by Xbye; 12-12-2011 at 05:18 AM.
Xbye is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 07:49 PM.