Trigger Reference of GS2-Experience Script

Reference for event triggers that call extended scripts, as defined in GS2-Experience

rankCapScript

Event trigger to call GS2-Script when obtaining rank caps.

Request

TypeDescription
namespaceNamespaceNamespace
experienceModelExperienceModelExperience Model
userIdstringUser Id
propertyIdstringProperty ID

Result

TypeRequireDefaultLimitationDescription
rankCaplong~ 2147483645rank cap

Implementation Example

namespace = args.namespace
experienceModel = args.experienceModel
userId = args.userId
propertyId = args.propertyId

result = {
  rankCap=rankCap
}

changeExperience

Event trigger to call GS2-Script before experience changes.

Request

TypeDescription
namespaceNamespaceNamespace
experienceModelExperienceModelExperience Model
statusStatusStatus before change
afterStatusStatusStatus after change

Result

TypeRequireDefaultLimitationDescription
permitboolAllow experience change
overrideExperienceValuelong~ 2147483645Amount of experience change

Implementation Example

namespace = args.namespace
experienceModel = args.experienceModel
status = args.status
afterStatus = args.afterStatus

result = {
  permit=permit,
  overrideExperienceValue=overrideExperienceValue
}

changeExperienceDone

GS2-Script called after experience changes.

Request

TypeDescription
namespaceNamespaceNamespace
experienceModelExperienceModelExperience Model
statusStatusStatus

Result

TypeRequireDefaultLimitationDescription

Implementation Example

namespace = args.namespace
experienceModel = args.experienceModel
status = args.status

result = {
}

changeRank

Event trigger to call GS2-Script before rank changes.

Request

TypeDescription
namespaceNamespaceNamespace
experienceModelExperienceModelExperience Model
statusStatusStatus before change
afterStatusStatusStatus after change

Result

TypeRequireDefaultLimitationDescription
permitboolAllow experience change

Implementation Example

namespace = args.namespace
experienceModel = args.experienceModel
status = args.status
afterStatus = args.afterStatus

result = {
  permit=permit
}

changeRankDone

GS2-Script called after rank changes.

Request

TypeDescription
namespaceNamespaceNamespace
experienceModelExperienceModelExperience Model
statusStatusStatus

Result

TypeRequireDefaultLimitationDescription

Implementation Example

namespace = args.namespace
experienceModel = args.experienceModel
status = args.status

result = {
}

changeRankCap

Event trigger to call GS2-Script before rank cap changes.

Request

TypeDescription
namespaceNamespaceNamespace
experienceModelExperienceModelExperience Model
statusStatusStatus before change
afterStatusStatusStatus after change

Result

TypeRequireDefaultLimitationDescription
permitboolAllow rank cap change
overrideRankCapValuelong~ 2147483645New rank cap

Implementation Example

namespace = args.namespace
experienceModel = args.experienceModel
status = args.status
afterStatus = args.afterStatus

result = {
  permit=permit,
  overrideRankCapValue=overrideRankCapValue
}

changeRankCapDone

GS2-Script called after rank cap changes.

Request

TypeDescription
namespaceNamespaceNamespace
experienceModelExperienceModelExperience Model
statusStatusStatus

Result

TypeRequireDefaultLimitationDescription

Implementation Example

namespace = args.namespace
experienceModel = args.experienceModel
status = args.status

result = {
}

overflowExperience

Event trigger to call GS2-Script when experience overflow occurs.

Request

TypeDescription
namespaceNamespaceNamespace
experienceModelExperienceModelExperience Model
statusStatusStatus
overflowExperienceValuelongExperience overflow value

Result

TypeRequireDefaultLimitationDescription
permitboolAllow experience overflow

Implementation Example

namespace = args.namespace
experienceModel = args.experienceModel
status = args.status
overflowExperienceValue = args.overflowExperienceValue

result = {
  permit=permit
}