Jump to content

Skevitj, or anyone else that knows, I need more scripting help!&#3


ABVXYzackattack

Recommended Posts

Hey Skevitj. I said I was done needing your help, but a few of my scripts for some reason aren't working like they should:

 

This one is confusing why it didn't work. It's a effect on a radio to call in an artillery strike, but it's not working:

 

------------------------------------------------------------------

scn ZArtilleryRadioEffectScript

 

short doonce

 

Begin ScriptEffectStart

 

if doonce == 0 && menumode == 0

 

ZNCRShot1.placeatme NellisArtilleryExplosion

ZNCRShot2.placeatme NellisArtilleryExplosion

ZNCRShot3.placeatme NellisArtilleryExplosion

player.removeitem ZNCRArtilleryRadio 1

 

set doonce to 1

 

endif

 

end

-----------------------------------------------------------------

 

This one's a bit more complex. But it involved making a gunship fly over and launch a few rockets in a trigger zone area:

 

--------------------------------------------------------------------

scn ZGunshipScript

 

short RunTimer

float TimerVar

 

Begin OnTriggerEnter Player

 

If ZRenoBasinMission.choice3 == 1

GetSecondsPassed

set TimerVar to 0

set RunTimer to 1

ZNCRGunShipNEW.playgroup fastleft 1

endif

end

 

Begin GameMode

if RunTimer < 1

return

endif

set TimerVar to TimerVar + GetSecondsPassed

 

if TimerVar>=13

ZGunShipMissile1.fireweapon WeapMissileLauncher

ZGunShipMissile2.fireweapon WeapMissileLauncher

ZGunShipMissile3.fireweapon WeapMissileLauncher

ZGunShipMissile4.fireweapon WeapMissileLauncher

ZGunShipMissile5.fireweapon WeapMissileLauncher

set RunTimer to 0

 

endif

 

end

--------------------------------------------------------------------------

 

What can I do to fix these scripts!?!?!?

Link to comment
Share on other sites

lol at my name in the topic. If you want my help with a problem, a better bet might be to PM me with the problem or a link to where you posted it. I only really look at the "New Topics" tab so I usually miss a fair few, it was only luck that I saw this one.

 

What exactly are you trying to do with the first script? Is the radio an activator, consumable, other etc?

I'm assuming the radio object (ZNCRArtilleryRadio) is a "consumable" item (As far as I know, you can't use activators and other objects as you can't trigger OnActivate)? If the script is applied to the actual object ScriptEffectStart will never trigger, however if you use that script to create a "Base Effect" which uses the script, IE: For a "Base Effect", "Effect Archetype" should be "script" and "Assoc. Item" should be the script, then use that base effect as a "Result" effect of the consumable radio, that will ensure the script runs when the object is equipped/consumed, and it will also take care of the removal of the object since you're "consuming" it.

scn...

Begin ScriptEffectStart
ZNCRShot1.placeatme NellisArtilleryExplosion
ZNCRShot2.placeatme NellisArtilleryExplosion
ZNCRShot3.placeatme NellisArtilleryExplosion
end

This would be sufficient assuming the radio is implemented as I've said above. An alternative if you can get the mesh sorted out would be to have the radio as a weapon (and the script directly on the weapon), so the PC equips it, then using the OnFire block type you could have it's effects trigger when the PC "fires" (left mouse) while it is equipped. That's probably the most realistic, but would also require the most work, unless you can find a pre-made radio mesh (with the correct attachments or whatever you need for it to be equip-able) someone is willing to let you use.

 

 

As for the second script, what's the script attached to? The OnTriggerEnter needs to know what zone is triggering it, hence if that block is used the script needs to be attached to the relevant trigger zone. If it's attached to the gunship, then change the OnTriggerEnter to OnActivate and place a script on the trigger zone which will "Activate" the vertibird.

scn...

Begin OnTriggerEnter Player
VertibirdRef.Activate this 1
end

I'm not entirely sure how the Activate command should be structured, but at any rate the RunOnActivateBlockFlag needs to be 1. "this" may be redundant, but I'm not sure if it will interpret the flag correctly if you don't specify the ActionRef.

Edited by Skevitj
Link to comment
Share on other sites

  • Recently Browsing   0 members

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