Jump to content
  • 0

Viewpoint and npc that does not appear


Question

Posted (edited)

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

6 answers to this question

Recommended Posts

  • 0
Posted (edited)
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
  • 0
Posted
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 '-'
  • 0
Posted (edited)

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

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...