Jump to content

Help with Script ?


Recommended Posts

Can someone help, Keep getting these errors:

 

(113,12): type mismatch while assigning to a actor (cast missing or types unrelated)
(116,12): type mismatch while assigning to a actor (cast missing or types unrelated)
(119,12): type mismatch while assigning to a actor (cast missing or types unrelated)

(122,12): type mismatch while assigning to a actor (cast missing or types unrelated)

.......

 

 

 

Scriptname MOSummoner extends ObjectReference

Armor Property CommandRadio Auto Const

Actor Property Player Auto

MiscObject Property Caps Auto

Message Property MessageSettlers Auto

Message Property MessageMinutemen Auto

Message Property MessageAnimals Auto

Message Property MessageAbilities Auto

Message Property MessageWeapons Auto

Message Property MessageOutfits Auto

Message Property FirstMessage Auto

Spell Property Recruit Auto

Spell Property Dismiss Auto

Spell Property Fly Auto

Spell Property Land Auto

LeveledItem Property WeaponHeavy Auto

LeveledItem Property WeaponAutomatic Auto

LeveledItem Property WeaponShotgun Auto

LeveledItem Property WeaponMelee Auto

LeveledItem Property OutfitHeavy Auto

LeveledItem Property OutfitMedium Auto

LeveledItem Property OutfitLight Auto

Weapon Property Flare Auto

ActorBase Property SettlerM Auto

ActorBase Property Settler Auto

ActorBase Property SettlerR Auto

ActorBase Property SettlerPA Auto

ActorBase Property BoSElite Auto

ActorBase Property SettlerG Auto

Message Property MessageVertibird Auto

ActorBase Property MinuteC Auto

ActorBase Property MinuteREC Auto

ActorBase Property MinuteV Auto

ActorBase Property MinuteR Auto

ActorBase Property MinuteRangedF Auto

ActorBase Property MinuteSO Auto

ActorBase Property MinuteO Auto

ActorBase Property AnimGroup Auto

ActorBase Property AnimArmoredGroup Auto

ActorBase Property AnimDogA Auto

ActorBase Property AnimCatA Auto

ActorBase Property RailRangedF Auto

ActorBase Property cat Auto

ActorBase Property Dog Auto

ActorBase Property VertTravel Auto

ActorBase Property VertDef Auto

GlobalVariable Property SoldiersRecruited Auto Const

Event OnEquipped(Actor akActor)
        Menu()
        Player.RemoveItem(CommandRadio, 1)
        Player.AddItem(CommandRadio, 1)
EndEvent

Function Menu(Bool abMenu = True, Int aiButton = 0)
Int iCaps = 0 ; total cost of the purchase
    Int iButton = FirstMessage.Show()
    If(iButton == 0)
        Return ; 0 would make a handy "cancel" button
    ElseIf(iButton == 1)
        Actor rPlaced = None
        ; ---- pick the soldier here ----
        iButton = MessageMinutemen.Show()
        If(iButton == 0)
            Return ; 0 would make a handy "cancel" button
        ElseIf(iButton == 1)
            rPlaced = Player.PlaceAtMe(MinuteSO, 1)
            iCaps += 1000
        ElseIf(iButton == 2)
            rPlaced = Player.PlaceAtMe(MinuteO, 1)
            iCaps += 1000
        ElseIf(iButton == 3)
            rPlaced = Player.PlaceAtMe(MinuteR, 1)
            iCaps += 1000
        ElseIf(iButton == 4)
            rPlaced = Player.PlaceAtMe(MinuteV, 1)
            iCaps += 1000
        ElseIf(iButton == 5)
            rPlaced = Player.PlaceAtMe(MinuteC, 1)
            iCaps += 1000
        ElseIf(iButton == 6)
            rPlaced = Player.PlaceAtMe(MinuteREC, 1)
            iCaps += 1000
        EndIf
        ; ---- soldier pick over ----
        Utility.Wait(0.5) ; wait a little maybe?
        ; ---- pick weapon ----
        iButton = MessageWeapons.Show() ; move on to weapon picking
        If(iButton == 0)
            Return
        ElseIf(iButton == 1)
            rPlaced.AddItem(WeaponHeavy, 1)
            Utility.Wait(0.5)
            rPlaced.EquipItem(WeaponHeavy)
            iCaps += 800
        ElseIf(iButton == 2)
            rPlaced.AddItem(WeaponAutomatic, 1)
            Utility.Wait(0.5)
            rPlaced.EquipItem(WeaponAutomatic)
            iCaps += 800
        ElseIf(iButton == 3)
            rPlaced.AddItem(WeaponShotgun, 1)
            Utility.Wait(0.5)
            rPlaced.EquipItem(WeaponShotgun)
            iCaps += 800
        ElseIf(iButton == 4)
            rPlaced.AddItem(WeaponMelee, 1)
            Utility.Wait(0.5)
            rPlaced.EquipItem(WeaponMelee)
            iCaps += 800
        EndIf
        ; ---- weapon pick over ----
        Utility.Wait(0.5)
        ; --- pick outfit ---
        iButton = MessageOutfits.Show()
        If(iButton == 0)
            Return
        ElseIf(iButton == 1)
            rPlaced.AddItem(OutfitHeavy, 1)
            Utility.Wait(0.5)
            rPlaced.EquipItem(OutfitHeavy)
            iCaps += 500
        ElseIf(iButton == 2)
            rPlaced.AddItem(OutfitMedium, 1)
            Utility.Wait(0.5)
            rPlaced.EquipItem(OutfitMedium)
            iCaps += 500
        ElseIf(iButton == 3)
            rPlaced.AddItem(OutfitLight, 1)
            Utility.Wait(0.5)
            rPlaced.EquipItem(OutfitLight)
            iCaps += 500
            
        EndIf
        ; ---- outfit pick over ----
    ElseIf(iButton == 2) ; something other than those soldiers
        Actor rPlaced = None
        ; ---- pick the soldier here ----
        iButton = MessageSettlers.Show()
        If(iButton == 0)
            Return ; 0 would make a handy "cancel" button
        ElseIf(iButton == 1)
            rPlaced = Player.PlaceAtMe(Settler, 1)
            iCaps += 1000
        ElseIf(iButton == 2)
            rPlaced = Player.PlaceAtMe(SettlerM, 1)
            iCaps += 1000
        ElseIf(iButton == 3)
            rPlaced = Player.PlaceAtMe(SettlerR, 1)
            iCaps += 1000
        ElseIf(iButton == 4)
            rPlaced = Player.PlaceAtMe(SettlerPA, 1)
            iCaps += 1000
        ElseIf(iButton == 5)
            rPlaced = Player.PlaceAtMe(SettlerG, 3)
            iCaps += 1000
        EndIf
        ; ---- soldier pick over ----
        Utility.Wait(0.5) ; wait a little maybe?
        ; ---- pick weapon ----
        iButton = MessageWeapons.Show() ; move on to weapon picking
        If(iButton == 0)
            Return
        ElseIf(iButton == 1)
            rPlaced.AddItem(WeaponHeavy, 1)
            Utility.Wait(0.5)
            rPlaced.EquipItem(WeaponHeavy)
            iCaps += 800
        ElseIf(iButton == 2)
            rPlaced.AddItem(WeaponAutomatic, 1)
            Utility.Wait(0.5)
            rPlaced.EquipItem(WeaponAutomatic)
            iCaps += 800
        ElseIf(iButton == 3)
            rPlaced.AddItem(WeaponShotgun, 1)
            Utility.Wait(0.5)
            rPlaced.EquipItem(WeaponShotgun)
            iCaps += 800
        ElseIf(iButton == 4)
            rPlaced.AddItem(WeaponMelee, 1)
            Utility.Wait(0.5)
            rPlaced.EquipItem(WeaponMelee)
            iCaps += 800
        EndIf
        ; ---- weapon pick over ----
        Utility.Wait(0.5)
        ; --- pick outfit ---
        iButton = MessageOutfits.Show()
        If(iButton == 0)
            Return
        ElseIf(iButton == 1)
            rPlaced.AddItem(OutfitHeavy, 1)
            Utility.Wait(0.5)
            rPlaced.EquipItem(OutfitHeavy)
            iCaps += 500
        ElseIf(iButton == 2)
            rPlaced.AddItem(OutfitMedium, 1)
            Utility.Wait(0.5)
            rPlaced.EquipItem(OutfitMedium)
            iCaps += 500
        ElseIf(iButton == 3)
            rPlaced.AddItem(OutfitLight, 1)
            Utility.Wait(0.5)
            rPlaced.EquipItem(OutfitLight)
            iCaps += 500
            
        EndIf
        ; ---- outfit pick over ----
        ElseIf(iButton == 3) ; something other than those soldiers
        Actor rPlaced = None
        ; ---- pick the soldier here ----
        iButton = MessageAnimals.Show()
        If(iButton == 0)
            Return ; 0 would make a handy "cancel" button
        ElseIf(iButton == 1)
            rPlaced = Player.PlaceAtMe(Cat, 1)
            iCaps += 1000
        ElseIf(iButton == 2)
            rPlaced = Player.PlaceAtMe(Dog, 1)
            iCaps += 1000
        ElseIf(iButton == 3)
            rPlaced = Player.PlaceAtMe(AnimCatA, 1)
            iCaps += 1000
        ElseIf(iButton == 4)
            rPlaced = Player.PlaceAtMe(AnimDogA, 1)
            iCaps += 1000
        ElseIf(iButton == 5)
            rPlaced = Player.PlaceAtMe(AnimGroup, 3)
            iCaps += 1000
        ElseIf(iButton == 6)
            rPlaced = Player.PlaceAtMe(AnimArmoredGroup, 3)
            iCaps += 1000
        EndIf
    Player.RemoveItem(Caps, iCaps, False) ; remove whole price at the end
        EndIf
EndFunction

 

 

Link to comment

So, I did the outfits like this:

 

 

                ; --- pick outfit ---
        iButton = MessageOutfits.Show()
        If(iButton == 0)
            Return
        ElseIf(iButton == 1)
            rPlaced.AddItem(OutfitHeavy, 1)
            (rPlaced as Actor).EquipItem(OutfitHeavy)
            Utility.Wait(0.5)
            iCaps += 500
        ElseIf(iButton == 2)
            rPlaced.AddItem(OutfitMedium, 1)
            (rPlaced as Actor).EquipItem(OutfitMedium)
            Utility.Wait(0.5)
            iCaps += 500
        ElseIf(iButton == 3)
            rPlaced.AddItem(OutfitLight, 1)
            (rPlaced as Actor).EquipItem(OutfitLight)
            Utility.Wait(0.5)
            iCaps += 500
            
        EndIf

 

 

 

Still same problem It will add the outfits but they won't equip the outfits. They will equip the weapon automatically cause of the Package I have attached forces them to draw the weapon. But for some reason they won't equip anything.

Link to comment

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use