Jump to content

Quick parsing question


Recommended Posts

You may have an error on a previous line affecting the processing of lines below. Won't know that without the full script and the full compiler error.

 

Otherwise, all I can suggest is to make sure you have all your variables properly declared and defined. As it sounds like iButtonA may not have a value associated with it and thus not comparing well with a value of 1. But it could also be an issue with the ObjToBeDest variable. So double check both.

Link to comment
Share on other sites

Of course...

 

ObjectReference Property StartFuseMarker Auto
ObjectReference Property RocksMarker Auto
ObjectReference Property ExpMarker Auto
Explosion Property MyExp Auto
Explosion Property MyExp2 Auto
Int Property ObjToBeDest Auto
Light Property HasTorch Auto
MagicEffect Property MyEff Auto
Message Property Greet Auto
Message Property NeedGPowder Auto
Message Property NeedSewKit Auto
Message Property NeedGunSew Auto
Message Property EquipTorch Auto
Message Property NeedFlame Auto
Message Property ExpMenu Auto
Message Property SBack Auto
MiscObject Property GPowder Auto
MiscObject Property SewKit Auto
Sound Property ExpSND Auto
String Property Text1 Auto
String Property Text2 Auto

; ObjToBeDest values associated with destructible items
; 0 Solid structures that can only be blown up – rocks, solid wood
; 1 Objects that can be ignited with kindling or accelerant – log piles
; 2 Objects that are easily ignitable – paper, material, oil

Auto State Waiting
Event OnActivate(ObjectReference akActionRef)
if (akActionRef == Game.GetPlayer())
Int iButtonA = Greet.Show() ; Shows first menu
; check to see if player Literally Has Nothing useful
If iButtonA == 0; explosives chosen
ExplosivesOptions()
EndIf
;31
If (iButtonA == 1) && (ObjToBeDest.GetValue() == 0.0); fire chosen but won’t work on this object
debug.notification("It’s too solid to be set alight")
GoToState("Waiting")
else
FireOptions()
EndIf

If iButtonA == 2; other chosen
OtherOptions()
EndIf

GoToState("Waiting")

EndIf
debug.notification("Script Ended")
EndEvent
EndState
;----------------------------------------------------------------------
Function ExplosivesOptions()
debug.notification("Explosives Chosen")
Int iButtonExp = ExpMenu.Show(); shows explosives menu which checks inventory
If iButtonExp == 0; gunpowder
debug.notification("Gunpowder Chosen")
EndIf
EndFunction

Function FireOptions()
debug.notification("Fire Chosen")
EndFunction

Function OtherOptions()
debug.notification("Other Chosen")
EndFunction

 

 

(39,35): int is not a known user-defined type
(39,46): cannot compare a none to a float (cast missing or types unrelated)

Link to comment
Share on other sites

This is going to be an issue. I intend the script, when finished, to cover all occurances of blowing s**t up.

 

 

Int Property ObjToBeDest Auto

That line is intended for use so as I can input the value depending on the object about to blown up or set fire to as mentioned in the comments.

Otherwise I am going to write a new script for each episode of 'blow s**t up.'

This method sounded practical when I started - now, I dunno.

Link to comment
Share on other sites

@maxarturo - Er… No.

Script is similar to what we previously worked on. Script will go through various inventory checks but firstly script needs to know what object the player is dealing with - hence the comments.

; ObjToBeDest values associated with destructible items
; 0 Solid structures that can only be blown up – rocks, solid wood
; 1 Objects that can be ignited with kindling or accelerant – log piles
; 2 Objects that are easily ignitable – paper, material, oil

 

These are for my purpose. I will input the value. Script is intending to be an all round 'blow up stuff' script. In the scenario I was working on when this script came to mind - player approaches a supporting beam. Through clues, etc, player knows that destroying this beam will release a trap bridge above and player can continue. In other scenarios player will approach a fallen tree, this can be dealt with a naked flame or the object is easily ignitable like paper, cloth again naked flame. Some objects, like the script we previously worked on will require ignition, flame/flint and an kindling/accelerant. The final category is 'Other'. If a scenario can be solved, optionally, with another simpler/obvious method, in the case of the beam if player has a saw then he/she can saw through it (more time consuming but equally possible).

So this all in one script would only present menus depending on the object that needs dealing with.

In the case of the beam, which can be blown up or if player has found a saw cut through, I would enter the value 0 in the property...

Int Property ObjToBeDest Auto

So the line I posted above...

If iButtonA == 1 && ObjToBeDest.GetValue() == 0; cannot be destroyed

… says the player chose 'fire' option the integer value tells me that this object cannot be destroyed by fire - therefore I will show a message saying this and go back to the menu options.

Basically the value entered will filter options presented.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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