• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

Player Controller Change

Status
Not open for further replies.
is there a way to change a user into a computer, not run ai on a user..
its basically i want computer to take over a player when they leave the game
but i want '((Picked player) controller) Equal to Computer' to fire on the player, after they leave. I could just use a different player group... but that would involve recoding quite a bit of stuff that already refrences that group..
GUI or Jass is acceptable, and im in no particular hurry
 
  • Trigger
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • For each (Integer A) from 1 to 12, do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • ((Player((Integer A))) controller) Equal to User
            • ((Player((Integer A))) slot status) Equal to Is playing
          • Then - Actions
            • Trigger - Add to Two <gen> the event (Player - (Player((Integer A))) leaves the game)
          • Else - Actions
  • Two
    • Events
    • Conditions
    • Actions
      • AI - Start melee AI script for (Triggering player): map.ai
Something like this?

In case the AI is not initialized, you might do the following: Use an unused slot and set it to Computer from Player Properties (E.g. Player's 12 (Brown). Then, you can do this:
  • Trigger
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • AI - Start melee AI script for Player 12 (Brown): map.ai
    • For each (Integer A) from 1 to 12, do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • ((Player((Integer A))) controller) Equal to User
            • ((Player((Integer A))) slot status) Equal to Is playing
          • Then - Actions
            • Trigger - Add to Two <gen> the event (Player - (Player((Integer A))) leaves the game)
          • Else - Actions
  • Two
  • Events
  • Conditions
  • Actions
    • Player - For Player 12 (Brown), turn Full shared units On toward (Triggering player)
So, you share the units with Brown player, which might take over control of the leaving player's units.
 
i dont just want ai to run... thats only part of the problem..
i coded My own AI, and it uses the condition: slot status = computer, basically i want that condition to start fireing after a player leaves..., without having to just create a new playergroup... which ill do if all else fails, i tried the following:

Player Group - Add (Triggering player) to (All players controlled by a Computer player)

but that had no effect

Chances are there isnt a GUI way to do what im trying.. but either is acceptable if you happen to find one..
but im just gonna go with recoding that other stuff to use a new playergroup..., so unless someone knows the answer right off top of head, dont bother with it..
 
Last edited:
Level 11
Joined
Sep 12, 2008
Messages
657
Oh awesome.. btw.. mind telling me whats better?

1. a textmacro with 1 function that has 28 text macros basing it xD
2. many many many functions (28 actually..)

i find textmacros easier to work with.. cuz 28 methods..
will drive me crazy..

i prefer the one that is more efficent.. so;p
(i dont know if textmacros do something bad if you use em too much.. like 7 values?)

JASS:
            //! textmacro GetAndSet takes Manual, DataType, Recieves, Returns, ReturnedData, Base, Base2, ForNewMissle
            
            $ForNewMissle$static method $Manual$$DataType$ takes $Recieves$ returns $Returns$
                $Base$
                $Base2$
                return $ReturnedData$
            endmethod
            
            //! endtextmacro

and a example:

JASS:
//! runtextmacro GetAndSet("Set", "Damage", "thistype id, real damage", "nothing", "", "set id.Damage = damage", "", "")

thanks in advance.
 
Status
Not open for further replies.
Top