Jump to content
  • 0

Viewpoint and npc that does not appear


Kakaroto

Question


  • Group:  Members
  • Topic Count:  99
  • Topics Per Day:  0.02
  • Content Count:  626
  • Reputation:   94
  • Joined:  05/11/12
  • Last Seen:  

Hello.

 

I'm trying to create a custom instance, but can not make a npc appear when the given time, and not to show a viewpoint on the mini map, the following error on map_server:

 

37WxvW2.png

 

 

Script:

1@glast,1,1,0    script    #snfescape    CLEAR_NPC,{
        end;
    OnStart:
        initnpctimer;
        end;
        
    OnTimer1500:
        donpcevent instance_npcname("#snfBGM")+"::OnEscape";
        .@map$ = instance_mapname("1@glast");
        viewpoint 1,351,271,1,0x00FF00;
        for(.@i = 1; .@i <= 5; .@i++) {

My other problem is this, I can not instantiate this npc:

1@glast,176,179,4    script    Tesouro#snf1    4_TREASURE_BOX,{
    .@map$ = instance_mapname("1@glast");
    setarray .@gain,912,719,723,730,730,730,7228,7229,7229,6803,15121,8523;
    setarray .@rate,900,800,800,500,300,200, 300, 500, 200, 100,   10,  10;
    getmapxy(.@map$,.@x,.@y,1,instance_npcname(strnpcinfo(0)));
    specialeffect 10;
    hideonnpc instance_npcname(strnpcinfo(0));
    for(.@i = 0; .@i<getarraysize(.@gain); .@i++) {
        if(rand(1000) < .@rate[.@i])
            makeitem .@gain[.@i],1,.@map$,.@x+rand(3)-1,.@y+rand(3)-1;
    }
    end;
OnInstanceInit:
    disablenpc instance_npcname(strnpcinfo(0));
    end;
}
1@glast,62,279,0    duplicate(Tesouro#snf1)    Tesouro#snf2    4_TREASURE_BOX
1@glast,200,135,4    duplicate(Tesouro#snf1)    Tesouro#snf3    4_TREASURE_BOX
1@glast,97,38,4    duplicate(Tesouro#snf1)    Tesouro#snf4    4_TREASURE_BOX
1@glast,267,351,0    duplicate(Tesouro#snf1)    Tesouro#snf5    4_TREASURE_BOX

In the same npc top that has the viewpoint, it should enable the treasures, but they do not activate:

1@glast,1,1,0    script    #snfescape    CLEAR_NPC,{
        end;
    OnStart:
        initnpctimer;
        end;
        
    OnTimer1500:
        donpcevent instance_npcname("#snfBGM")+"::OnEscape";
        .@map$ = instance_mapname("1@glast");
        viewpoint 1,351,271,1,0x00FF00;
        for(.@i = 1; .@i <= 5; .@i++) {
            enablenpc instance_npcname("Tesouro#snf"+.@i);

Can someone help me?

Edited by Kakaroto
Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2352
  • Joined:  10/28/11
  • Last Seen:  

use attachnpctimer before you use the initnpctimer

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  386
  • Reputation:   38
  • Joined:  04/28/13
  • Last Seen:  

1@glast,1,1,0    script    #snfescape    CLEAR_NPC,{
        end; // <--------- Wtf?
    OnStart:
        initnpctimer;
        end;
        
    OnTimer1500:
        donpcevent instance_npcname("#snfBGM")+"::OnEscape";
        .@map$ = instance_mapname("1@glast");
        viewpoint 1,351,271,1,0x00FF00;
        for(.@i = 1; .@i <= 5; .@i++) {
            enablenpc instance_npcname("Tesouro#snf"+.@i);

 btw, check the x,y map

and try by changing #snfBGM for snfBGM - #snfescape for snfescape

Edited by Promise
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  99
  • Topics Per Day:  0.02
  • Content Count:  626
  • Reputation:   94
  • Joined:  05/11/12
  • Last Seen:  

1@glast,1,1,0    script    #snfescape    CLEAR_NPC,{
        end; // <--------- Wtf?
    OnStart:
        initnpctimer;
        end;
        
    OnTimer1500:
        donpcevent instance_npcname("#snfBGM")+"::OnEscape";
        .@map$ = instance_mapname("1@glast");
        viewpoint 1,351,271,1,0x00FF00;
        for(.@i = 1; .@i <= 5; .@i++) {
            enablenpc instance_npcname("Tesouro#snf"+.@i);

 btw, check the x,y map

and try by changing #snfBGM for snfBGM - #snfescape for snfescape

 

 

 

 
 
Did not work '-'
Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2352
  • Joined:  10/28/11
  • Last Seen:  

you need to attach the timer to a player.  viewpoint only work if there are any player attached to current executing script.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  99
  • Topics Per Day:  0.02
  • Content Count:  626
  • Reputation:   94
  • Joined:  05/11/12
  • Last Seen:  

you need to attach the timer to a player.  viewpoint only work if there are any player attached to current executing script.

 

 
 
thnx, I'll try.

you need to attach the timer to a player.  viewpoint only work if there are any player attached to current executing script.

 

 

 
 
arg ... how do it '-'
Edited by Kakaroto
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  99
  • Topics Per Day:  0.02
  • Content Count:  626
  • Reputation:   94
  • Joined:  05/11/12
  • Last Seen:  

use attachnpctimer before you use the initnpctimer

    OnStart:
        attachnpctimer getcharid(3);
        initnpctimer;
        end;
 
 
like this?
 
Wv1SJda.png
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...