Aller au contenu

Photo

Spawn script


  • Veuillez vous connecter pour répondre
38 réponses à ce sujet

#26
jsd313

jsd313
  • Members
  • 184 messages
oops yeah added that in but still no warning message. I think you're right though, maybe try a different event.

#27
jsd313

jsd313
  • Members
  • 184 messages
Maybe I can add something to destroy any object thats on TeamId 0 or has a certain tag like "enemy" during my modules script GAME_MODE handling.



case EVENT_TYPE_SET_GAME_MODE:

{

int nGameMode = GetEventInteger(ev, 0);

if ( nGameMode == GM_DEAD )

{

DoAreaTransition("arena", "start");

nEventHandled = TRUE;

}

break;

}

}

#28
Axe_Murderer

Axe_Murderer
  • Members
  • 279 messages
Does that area transition take you to another different area?
Have you tried just walking out of the area and then back in again without fighting at all?


By the way your posts would be much cleaner if you surrounded your code with dascript tags:
[dascript]
code here
[/dascript]

Modifié par Axe_Murderer, 10 janvier 2010 - 03:14 .


#29
jsd313

jsd313
  • Members
  • 184 messages
yes, if I die it puts me back at the starting waypoint of my starting area.

#30
jsd313

jsd313
  • Members
  • 184 messages
hah I was gonna ask how to post them like you where, thank you.

Modifié par jsd313, 10 janvier 2010 - 03:16 .


#31
Axe_Murderer

Axe_Murderer
  • Members
  • 279 messages
Quick reply window doesn't understand them so use standard form when you have code to post.

#32
jsd313

jsd313
  • Members
  • 184 messages
I will give you a quick rundown on my module. The area u start in is a large locked room. You gather some party members from the people standing around. You then talk to a guy who represents a certain arena. His conversation offers you a 2v2, 3v3, or 4v4 match and to exit. Depending what u selec depends on what area u get set to and how many enemy teammates spawn to fight against you.



So when you win you get ported back to where you came in at, and if you die you get ported back to the starting waypoint. All of the arena are closed areas no way out but to win or lose.

#33
Axe_Murderer

Axe_Murderer
  • Members
  • 279 messages
Ok this ought to do it I think.
[dascript]
#include "utility_h"
#include "wrappers_h"
#include "events_h"
#include "var_constants_h"
 
void main()
{  int nEventHandled = FALSE;
   switch( GetEventType( GetCurrentEvent() ))
   {
      case EVENT_TYPE_AREALOAD_PRELOADEXIT:
      { object oWaypoint = GetObjectByTag( "cod4v4_team1" );
         Safe_Destroy_Object( UT_GetNearestObjectByTag( oWaypoint, "SpecialWarrior01" ), 0 );
         Safe_Destroy_Object( UT_GetNearestObjectByTag( oWaypoint, "SpecialPriest01" ),    0 );
         Safe_Destroy_Object( UT_GetNearestObjectByTag( oWaypoint, "SpecialHunter01" ),  0 );
         Safe_Destroy_Object( UT_GetNearestObjectByTag( oWaypoint, "SpecialMage02" ),    0 );

         SetTag( CreateObject( OBJECT_TYPE_CREATURE, R"warrior01.utc", GetSafeLocation( GetLocation( oWaypoint )) ), "SpecialWarrior01" );
        
         oWaypoint = GetObjectByTag( "cod4v4_team2" );
         SetTag( CreateObject( OBJECT_TYPE_CREATURE, R"priest01.utc", GetSafeLocation( GetLocation( oWaypoint )) ), "SpecialPriest01" );
        
         oWaypoint = GetObjectByTag( "cod4v4_team3" );
         SetTag( CreateObject( OBJECT_TYPE_CREATURE, R"hunter01.utc", GetSafeLocation( GetLocation( oWaypoint )) ), "SpecialHunter01" );

         oWaypoint = GetObjectByTag( "cod4v4_team4" );
         SetTag( CreateObject( OBJECT_TYPE_CREATURE, R"mage02.utc", GetSafeLocation( GetLocation( oWaypoint )) ), "SpecialMage02" );
      }
      break;

      case EVENT_TYPE_TEAM_DESTROYED:
      { DoAreaTransition( "arena", "cod" );
         nEventHandled = TRUE; // set this if no further action is required for this event
      }
      break;
   }

   // If this event wasn't handled by this script, let the core script try
   if ( !nEventHandled ) HandleEvent( GetCurrentEvent(), RESOURCE_SCRIPT_AREA_CORE );
}
[/dascript]

Modifié par Axe_Murderer, 10 janvier 2010 - 03:28 .


#34
jsd313

jsd313
  • Members
  • 184 messages
OMG it WORKS!!!!!



[dascript]

#include "utility_h"

#include "wrappers_h"

#include "events_h"

#include "var_constants_h"



void main()

{ int nEventHandled = FALSE;

switch( GetEventType( GetCurrentEvent() ))

{

case EVENT_TYPE_AREALOAD_PRELOADEXIT:

{

object oWaypoint = GetObjectByTag( "test" );

Safe_Destroy_Object( UT_GetNearestObjectByTag( oWaypoint, "enemy" ), 0 );

SetTag( CreateObject( OBJECT_TYPE_CREATURE, R"knight.utc", GetSafeLocation( GetLocation( oWaypoint )) ), "enemy" );

}

break;



case EVENT_TYPE_TEAM_DESTROYED:

{

DoAreaTransition( "arena", "duels" );

nEventHandled = TRUE; // set this if no further action is required for this event

}

break;

}



// If this event wasn't handled by this script, let the core script try

if ( !nEventHandled ) HandleEvent( GetCurrentEvent(), RESOURCE_SCRIPT_AREA_CORE );

}

[/dascript]

#35
Axe_Murderer

Axe_Murderer
  • Members
  • 279 messages
Cool cuz I was out of ideas...

#36
jsd313

jsd313
  • Members
  • 184 messages
Wow man thank you so much, and so far I have killed this guy 6 times and no corpses just blood spots. When I zone in after getting him to half health the first time, it don't matter he is 100% health now!.



Again thank you so much for your time on this man, you helped me solve a major issue. I really appreciate it.

#37
jsd313

jsd313
  • Members
  • 184 messages
Worst part about this.. I now have like 30 scripts to update lol

#38
Craig Graff

Craig Graff
  • Members
  • 608 messages
You should make all your similar area scripts point to one my_area_core script, then do your common handling there

#39
jsd313

jsd313
  • Members
  • 184 messages
That's a great idea, next major change I think I'll move everything over and try that.