• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

CnP inline

Status
Not open for further replies.
When I tried to copy and paste my vJass code from my map, whatever inlining I had was inlined to two spaces.
I believe that this is a Hive 2 thing.

Example.
JASS:
library dasfs
  
  static method fhsjka takes nothing returns nothing
  local thistype this = 11
  
  loop
  //stuff
  
  exitwhen this == 0
  set this = this - 1
  endloop
  endmethod
  
endlibrary
How it's meant to look.
JASS:
library dasfs
   
    static method fhsjka takes nothing returns nothing
        local thistype this = 11
       
        loop
            //stuff
           
            exitwhen this == 0
            set this = this - 1
        endloop
    endmethod
   
endlibrary
I have to manually add the spaces in manually to make it look like it does in the editor.
Same issue when I CnP into Notepad into the messenger here.
 

Chaosy

Tutorial Reviewer
Level 41
Joined
Jun 9, 2011
Messages
13,241
Works for me.
JASS:
//! zinc
    library DEMO requires Blackboard
    {
        integer currentChar = 1;
        integer endChar;
        integer currentLine = 0;
        string toWrite[];
        multiboard m;
        multiboarditem mi;
        Blackboard bb;
        string color = "|c00FFFC01";
        string colorEnd = "|r";
        boolean first = false;
        //Writing # should highlight the everything until the next #
        function onLoop()
        {
            string char = SubString(toWrite[currentLine], currentChar, currentChar + 1);
            string pre;
            string end;
            if(char == " ")
            {
                currentChar += 1;
                char = SubString(toWrite[currentLine], currentChar, currentChar + 1);
            }
            if(char == "#")
            {
                pre = SubString(toWrite[currentLine], 0, currentChar);
                end = SubString(toWrite[currentLine], currentChar + 1, StringLength(toWrite[currentLine]));
                if(!first)
                {
                    toWrite[currentLine] = pre + color + end;
                    currentChar += StringLength(color);
                    first = true;
                }
                else if(first)
                {
                    toWrite[currentLine] = pre + colorEnd + end;
                    currentChar += StringLength(colorEnd);
                    first = false;
                }
            }
            mi = MultiboardGetItem(m, currentLine, 0);
            MultiboardSetItemValue(mi, SubString(toWrite[currentLine], 0, currentChar));
            currentChar += 1;
            if(currentChar > StringLength(toWrite[currentLine]))
            {
                currentLine += 1;
                if(toWrite[currentLine] != "" && toWrite[currentLine] != null)
                {
                    currentChar = 1;
                }
                else
                {
                    DestroyTimer(GetExpiredTimer());
                }
            }
        }
      
        function onZero()
        {
            bb = Blackboard.instance_of(Player(0));
            toWrite[0] = "hello! this is a test #message# which should appear periodically.";
            toWrite[1] = "Roses are red, violets are blue, I got a random #message# for you.";
            bb.write_line("");
            bb.write_line("");
            m = bb.show(bb.HALF_WIDTH);
            TimerStart(CreateTimer(), 0.05, true, function onLoop);
        }
      
        function onInit()
        {
            TimerStart(CreateTimer(), 0, false, function onZero);
        }
    }
//! endzinc
 

Rheiko

Spell Reviewer
Level 27
Joined
Aug 27, 2013
Messages
4,217
Same goes with the trigger tags. I had to do it manually.
I'm using firefox, haven't tested it with other browsers.

CnP
  • Test
    • Events
    • Map initialization
    • Conditions
    • ((Triggering unit) is A structure) Equal to True
    • Actions
    • Unit - Create 1 Footman for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
How it's meant to look
  • Test
    • Events
      • Map initialization
    • Conditions
      • ((Triggering unit) is A structure) Equal to True
    • Actions
      • Unit - Create 1 Footman for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
 

Rheiko

Spell Reviewer
Level 27
Joined
Aug 27, 2013
Messages
4,217
It worked flawlessly when I disabled Wysiwyg.
  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
        • Then - Actions
          • Melee Game - Limit Heroes to 1 per Hero-type (for all players)
          • Melee Game - Use melee time of day (for all players)
          • Melee Game - Set starting resources (for all players)
          • Melee Game - Remove creeps and critters from used start locations (for all players)
          • Melee Game - Enforce victory/defeat conditions (for all players)
          • Melee Game - Give trained Heroes a Scroll of Town Portal (for all players)
          • Melee Game - Run melee AI scripts (for computer players)
          • Melee Game - Create starting units (for all players)
        • Else - Actions
 

Rheiko

Spell Reviewer
Level 27
Joined
Aug 27, 2013
Messages
4,217
ZF6M9RI.png
 
Last edited:
Status
Not open for further replies.
Top